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:
1ServiceAnalytics.addListener(new ServiceAnalyticsListener() {
2 @Override public void onServiceAnalyticsEvent(String behaviorId,
3 Map<String, Object> eventData) {
4 // TO DO: Do something with analytics data
5 }
6});In Kotlin:
1ServiceAnalytics.addListener { behaviorId, eventData ->
2 // TO DO: Do something with analytics data
3}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