Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 923 Bytes

analytics.md

File metadata and controls

31 lines (24 loc) · 923 Bytes

Analytics

Analytics are fairly simple as the main logging happens in the background. HMS has some extra functionality where the page exit can be set as well, this might be needed to get improved analytics accuracy.

Usage

Getting the analytics instance:

val analytics: Analytics = AnalyticsFactory.getAnalytics(this)

Sending custom events:

val bundle: Bundle = Bundle()
bundle.putString("custom_key", "custom_value")
analytics.logEvent("Demo_Analytics_Btn", bundle)

Setting current screen:

analytics.setCurrentScreen(this, "Demo_Analytics_Screen", null)

Setting a user property:

analytics.setUserProperty("loves_tea", "definitely")

Links