Skip to main content

Analytics

The LikeMinds SDK provides a set of predefined user events that you might want to track for your chat application.

Refer to Analytics Events to see the list of events that are being tracked.

Callback

To receive these analytics events and handle them according to your requirements implement LMChatCoreCallback.

While setting up LikeMinds Chat SDK in onCreate() method of the Application class, extend LMChatCoreCallback and pass the instance of the same in LMChatCore.setup().

interface LMChatCoreCallback{
fun getAnalyticsEvents(eventName: String, eventProperties: Map<String, String?> = mapOf()) // will be triggered when an event is called.
}
  • eventName: Name of the event triggered.
  • eventProperties : All the properties associated with that particular event.

Example Implementation

val application = this
val enablePushNotifications = false
val deviceId = null
val domain = "ENTER YOUR DOMAIN NAME HERE"

val lmChatCoreCallback = object : LMChatCoreCallback {
override fun getAnalyticsEvents(eventName: String, eventProperties: Map<String, String?>) {
// your implementation for analytics
}
}

LMChatCore.setup(
application = application,
enablePushNotifications = enablePushNotifications,
deviceId = deviceId,
domain = domain,
lmChatCoreCallback = lmChatCoreCallback
)