Analytics with the Service Chat SDK for Android

You can listen to user-driven events from the Service Chat SDK using the ServiceAnalytics system.

The legacy chat product is scheduled for retirement on February 14, 2026, and is in maintenance mode until then. During this phase, you can continue to use chat, but we no longer recommend that you implement new chat channels. To avoid service interruptions to your customers, migrate to Messaging for In-App and Web before that date. Messaging offers many of the chat features that you love plus asynchronous conversations that can be picked back up at any time. Learn about chat retirement in Help.

Important

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