Analytics
Listener & Callback
It's possible to get a callback event for widgets stories.
Init
You can add analytics callback implementing onAnalyticsCallback(data: AnalyticsCallback) like :
export default function Thumb() {
useEffect(() => {
const onAnalyticsCallback = JoinStories.onAnalyticsCallback((data: AnalyticsCallback) => {
//TODO
})
return () => {
onAnalyticsCallback.remove();
}
});
Parameters
AnalyticsWidgetValue
- eventOwner: Join identifier of the customer
- eventType: See below the “JoinStoriesEventType” section
- cpWidgetAlias: Alias of the story
- cpUserAgent: Android version used. Format android-{version} or ios-{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