Skip to main content

Analytics

What you learn​

You're instantiating DIVA Player in your Roku app and relying on DIVA Back Office as the video streaming source.

The goal of this article is to presents the callback functions DIVA Player provides to customize the events payload sent to the analytics provider.

Analytic event behavior​

DIVA Player provides callback functions to customize the analytic events payload to send to the analytics provider.

Analytic event structure​

The analytics event payload identifies the event. All events have the following parameters:

  • type: String
    • It's the event type name.
  • interactive: boolean
    • It's true the a user interaction raises the event. It's false otherwise.
  • eventArguments: Map
    • It's the dictionary that contains all common (for instance videoMetaData parameters) and event-specific arguments. Find the arguments full list in the Arguments list article.

Instantiation​

To customize the events payload add the observer to the analytics field analyticsEvent from the DivaPlayer, add the following code to the Basic instantiation code:

sub launchBOAdapter(divaLaunchParams as object)
m.dpUtilsNode = CreateObject("roSGNode", "DivaPlayerSDK:DPUtilsNode")
...
' Observe DivaPlayer generic analytics event call
m.dpUtilsNode.observeField("analyticsEvent", "onAnalyticsEventHandler")
...
end sub

sub onAnalyticsEventHandler(evt)
' Generic analytics event handler callback
? evt.getData()
end sub