-
- All Implemented Interfaces:
-
com.batch.android.event.EventSender.EventSenderListener
public final class TrackerModule extends BatchModule implements EventSender.EventSenderListener
Event Tracker module of Batch
-
-
Method Summary
Modifier and Type Method Description static TrackerModuleprovide()StringgetId()ID of the module intgetState()Should return the state of the module (usually 0 for deactivated, 1 for activated) voidbatchWillStart()Called by Batch before batch startNB : Context & activity are already available from the runtimeManager voidbatchDidStart()Called by Batch right after batch startNB : Same context and activity that in willStart but with the new state READY set voidbatchDidStop()Called by Batch right after batch stopNB : No context or activity are available voidtrack(String name)Track an event by its name voidtrack(String name, JSONObject parameters)Track an event by its name with additional parameters voidtrack(String name, long timestamp, JSONObject parameters)Track en event by its name, timestamp and with additional parameters voidtrackCollapsible(String name, long timestamp, JSONObject parameters)Track a collapsible event by its name, timestamp and with additional parameters voidtrack(String name, long timestamp)Track an event by its name and timestamp voidtrackCampaignView(@NonNull() String campaignID, @NonNull() JSONObject eventData)Track local campaign view voidonEventsSendSuccess(List<Event> events)Called when events has been sent to server voidonEventsSendFailure(List<Event> events)Called when events has failed to be sent to server List<Event>getEventsToSend()Datasource method that should provide a list of events to send voidwipeData(Context context)-
Methods inherited from class com.batch.android.module.BatchModule
batchContextBecameAvailable, batchIsFinishing, batchWillStop -
Methods inherited from class com.batch.android.event.EventSender.EventSenderListener
onEventsSendFailure, onEventsSendSuccess -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
provide
static TrackerModule provide()
-
getState
int getState()
Should return the state of the module (usually 0 for deactivated, 1 for activated)
-
batchWillStart
void batchWillStart()
Called by Batch before batch startNB : Context & activity are already available from the runtimeManager
-
batchDidStart
void batchDidStart()
Called by Batch right after batch startNB : Same context and activity that in willStart but with the new state READY set
-
batchDidStop
void batchDidStop()
Called by Batch right after batch stopNB : No context or activity are available
-
track
void track(String name, JSONObject parameters)
Track an event by its name with additional parameters
- Parameters:
name- The name of the eventparameters- The parameters of the event
-
track
void track(String name, long timestamp, JSONObject parameters)
Track en event by its name, timestamp and with additional parameters
- Parameters:
name- The name of the eventtimestamp- The timestamp of the eventparameters- The parameters of the event
-
trackCollapsible
void trackCollapsible(String name, long timestamp, JSONObject parameters)
Track a collapsible event by its name, timestamp and with additional parameters
- Parameters:
name- The name of the eventtimestamp- The timestamp of the eventparameters- The parameters of the event
-
track
void track(String name, long timestamp)
Track an event by its name and timestamp
- Parameters:
name- The name of the eventtimestamp- The timestamp of the event
-
trackCampaignView
void trackCampaignView(@NonNull() String campaignID, @NonNull() JSONObject eventData)
Track local campaign view
- Parameters:
campaignID- The campaign identifiereventData- The data of the event
-
onEventsSendSuccess
void onEventsSendSuccess(List<Event> events)
Called when events has been sent to server
- Parameters:
events- sent events
-
onEventsSendFailure
void onEventsSendFailure(List<Event> events)
Called when events has failed to be sent to server
- Parameters:
events- events not sent
-
getEventsToSend
List<Event> getEventsToSend()
Datasource method that should provide a list of events to send
-
-
-
-