The Tracker object is responsible for co-ordinating the saving and sending of events as well as managing the optional Session object.
|The Emitter object you create||Yes||Null|
|The name of the tracker instance||Yes||Null|
|The application ID||Yes||Null|
|The Subject that defines a user||No||Null|
|The Session object you create||No||Null|
|The device the Tracker is running on||No||Mobile|
|If we base 64 encode json values||No||True|
A full Tracker construction should look like the following:
IEmitter e1 = new AsyncEmitter ("com.collector.acme") Subject subject = new Subject(); Session session = new Session(); Tracker t1 = new Tracker(e1, "Namespace", "AppId", subject, session, DevicePlatforms.Desktop, true);
All of these variables can be altered after creation with the accompanying
The Tracker also contains several critical functions that must be used to start Tracking.
This function must be called before any events will start being stored or sent. This is due to the fact that we do not want to start any background processing from the constructors so it is left up to the developer to choose when to start everything up.
- Starts the background emitter thread
- Starts the background event processor thread
- Starts the background session check timer (Optional)
Once this is run everything should be in place for asynchronous event tracking.
If you need to temporarily halt the Tracker from tracking events you can run this function. This will bring all event processing, sending and collection to a halt and nothing will be started again until
StartEventTracking() is fired again.
This is the function used for Tracking all events.
Code language: CSS (css)