Analytics
Listener & Callback
It's possible to get a callback event for widgets stories.
Init
You can add analytics callback implementing JoinStoriesAnalyticsCallback like :
class Activity : AppCompatActivity(),JoinStoriesAnalyticsCallback {
private lateinit var binding: ActivityBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
...
binding.storyScaffold.analyticsCallback = this
...
}
override fun onAnalyticsCallback(event: JoinStoriesEventType, data: AnalyticsWidgetValue) {
when(event) {
JoinStoriesEventType.WidgetMounted -> //TODO
JoinStoriesEventType.StoriesFetched -> //TODO
JoinStoriesEventType.ComponentVisible50 -> //TODO
JoinStoriesEventType.ComponentVisible75 -> //TODO
JoinStoriesEventType.FirstClickOnWidget -> //TODO
JoinStoriesEventType.AdditionalClickOnWidget -> //TODO
}
}
}
Parameters
AnalyticsWidgetValue
- eventOwner: Join identifier of the customer
- eventType: See below the “JoinStoriesEventType” section
- cpWidgetAlias: Alias of the widget
- cpUserAgent: Android version used. Format android-{version}
- cpGoToUrl: Url of the story
- cpScreenResolution: Screen resolution of the visitor
- cpScreenColor: Number of colors used on the screen of the visitor
- cpWidgetType: Type of the widget
- eventUrl: Always "app"
- cpBaseUrl: Always "app"
- cpBrowserLanguage: Language used on the phone (not in the app if different)
- cpWidgetVersion: The version of the widget used (SDK version)
- eventWidgetWorkspaces: Join identifier of the workspace used
- eventCategory: Always "widget"
- cpTitle: Always "app"
JoinStoriesEventType
- WidgetMounted : Triggers when the widget is mounted
- StoriesFetched : Triggers when the stories are fetched
- ComponentVisible50 : Triggers when the widget is 50% visible
- ComponentVisible75 : Triggers when the widget is 75% visible
- FirstClickOnWidget : Triggers the first time a story is opened (with a click on a widget) during a visit on a screen
- AdditionalClickOnWidget : Triggers every other times a story is opened during a visit on a screen