Skip to main content
Version: 1.7.x

Analytics

Listener & Delegate

It's possible to get a delegate event for widgets stories.

Init

You can add analytics delegate implementing JoinStoriesAnalyticsDelegate like :

class ThumbViewController: UIViewController, JoinStoriesAnalyticsDelegate {

override func viewDidLoad() {
super.viewDidLoad()
...
thumbView.analyticsDelegate = self
...
}

func onAnalyticsCallback(event: JoinStoriesEventType, data: AnalyticsWidgetValue) {
switch event {
case .storiesFetched: //TODO
case .widgetMounted: //TODO
case .componentVisible50: //TODO
case .componentVisible75: //TODO
case .firstClickOnWidget: //TODO
case .additionalClickOnWidget: //TODO
}
}
}

Parameters

AnalyticsWidgetValue

  • eventOwner: Join identifier of the customer
  • eventType: See below the “JoinStoriesEventType” section
  • cpWidgetAlias: Alias of the widget
  • cpUserAgent: iOS version used. Format 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