Analytics

Analytics

We provide pre-integrations with multiple Analytics vendors. In most cases, you will only need to initialize the plugin with your account credentials and optional custom data. The SDK will take care of sending the required playback events (e.g. playback start/pause/stop, buffering, seeking, ad start/stop…) to the Analytics backend.

Youbora

Youbora Analytics is a comprehensive analytics and monitoring platform specifically designed for online video streaming services. It provides real-time insights and data analytics to help content providers and broadcasters understand the performance and usage of their video content.

Developed by Nice People At Work, Youbora Analytics offers a wide range of features and capabilities to track, measure, and optimize video streaming performance. It collects data from various sources, including video players, content delivery networks (CDNs), and end-user devices, and transforms that data into meaningful metrics and reports.

Our integration is validated by Nice People at Work QA.

Integrate

To start with Youbora Analytics first register a plugin to PRESTOPlay SDK:

import CastlabsYoubora

...

let youboraSettings = YouboraSettings(accountCode: "...")
let youboraPlugin = YouboraPlugin(youboraSettings)
PRESTOPlay.shared.register([youboraPlugin])

Analytics instance and custom metadata

After creating an analytics instance with the player and the .youbora option, set the custom metadata. If you want to use custom Youbora client settings you will have to import YouboraLib to your project. The easiest way is to add it via Podfile:

pod 'YouboraLib'

To pass custom data:

import CastlabsYoubora
import YouboraLib

var analytics: AnalyticsAPI = PRESTOPlaySDK.shared.analytics(for: player, .youbora)

...

let youboraMetadata = YouboraMetadata(
    live: false,
    assetId: "assetId"
)
youboraMetadata.options = YBOptions()
youboraMetadata.options?.adCustomDimension1 = "test"
youboraMetadata.options?.contentTitle = "test"
analytics?.metadata = youboraMetadata

Please check our examples/YouboraDemo for complete implementation.

Broadpeak

Integrate

Register a Broadpeak plugin to PRESTOPlay SDK:

import CastlabsBroadpeak

...

let broadpeakSettings = BroadpeakSettings(
    analyticsAddress: "YOUR-ANALYTICS-SERVER-ADDRESS",
    nanoCDNHost: "",
    domainNames: "")
let broadpeakPlugin = BroadpeakPlugin(broadpeakSettings)
PRESTOPlay.shared.register([broadpeakPlugin])

Analytics instance and custom metadata

After creating an analytics instance with the player and the .broadpeak option, set the custom metadata.

var analytics: AnalyticsAPI = PRESTOPlaySDK.shared.analytics(for: player, .broadpeak)

...

let broadpeakMetadata = AnalyticsMetadata(
    live: false,
    assetId: "assetId")
analytics.metadata = broadpeakMetadata

Please check our examples/BroadpeakDemo for complete implementation.

Conviva

Integrate

First, include the ConvivaSDK library in your project. Here is an example using Cococapods:

pod 'ConvivaSDK'

Next, register the Conviva plugin to PRESTOPlay SDK:

import CastlabsConviva

...

let convivaSettings = ConvivaSettings(
    accountCode: "YOUR-ACCOUNT-CODE",
    gatewayUrl: "YOUR-GATEWAY-URL")
let convivaPlugin = ConvivaPlugin(convivaSettings)
PRESTOPlay.shared.register([convivaPlugin])

Analytics instance

Creating an analytics instance with the player and the .conviva option.

var analytics: AnalyticsAPI = PRESTOPlaySDK.shared.analytics(for: player, .conviva)

Please check our examples/ConvivaDemo for complete implementation.