Analytics with the Service Chat SDK for Android
You can listen to user-driven events from the Service Chat
SDK using the ServiceAnalytics system.
Implement ServiceAnalyticsListener and add your listener to ServiceAnalytics to start receiving events.
In Java:
ServiceAnalytics.addListener(new ServiceAnalyticsListener() {
@Override public void onServiceAnalyticsEvent(String behaviorId,
Map<String, Object> eventData) {
// TO DO: Do something with analytics data
}
});
In Kotlin:
ServiceAnalytics.addListener { behaviorId, eventData ->
// TO DO: Do something with analytics data
}
When you receive an event, inspect the behaviorId to see the behavior that caused the event (for example, KNOWLEDGE_UI_USER_LAUNCH). Inspect the eventData map for contextual data related to the event (for example, KnowledgeUIAnalytics.DATA_CATEGORY_GROUP_NAME).
For a list of behaviors and the key constants for parsing the eventData map, see the analytics class for the desired feature.
- Knowledge Analytics
- KnowledgeUIAnalytics
- Case Management Analytics
- CasesUIAnalytics
- Chat Analytics
- ChatAnalytics