Analytics
Session control
The session control turns possible track the DAU and MAU of your app, and other cool things. You must add the following lines on every activity of your Android application:
@Override
public void onStart() {
super.onStart();
// must be called on every activity
kiwiSDK.analytics().startSession(this);
}
@Override
public void onStop() {
// must be called on every activity
kiwiSDK.analytics().stopSession(this);
super.onStop();
}
Track Events
You can track custom events:
kiwiSDK.analytics().trackEvent("Custom event type", payload);
You can also track duration of custom events
// tracking start
kiwiSDK.analytics().startTrackTimeEvent("watch_video", payload);
// ...
// tracking end
kiwiSDK.analytucs.trackEvent("watch_video", additionalPayload);
When you finish tracking a timed event you can send an additional payload, that will be merged with the previous stored payload.
A timed event can be finished by calling trackEvent on an event with the same name or it will be finished automatically after the session ended.
Reception and open of push notifications:
kiwiSDK.analytics().trackPushReceived(payload);
kiwiSDK.analytics().trackPushOpen(payload);
And audience of content:
kiwiSDK.analytics().trackContentAudience("content-origin", "content-id", payload);
You can also track duration of a Custom Audience event:
// tracking start
kiwiSDK.analytics().startTrackTimeContentAudience("content-origin","content-id", payload);
// ...
// tracking end
kiwiSDK.analytics().trackContentAudience("content-origin","content-id", payload);
NOTE: This operations will perform on a background thread.
Last updated