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 PRESTOplay
import CastlabsYoubora

...

let youboraSettings = YouboraSettings(accountCode: "...")
let youboraPlugin = YouboraPlugin(youboraSettings)

PRESTOplaySDK.shared.register("LICENSE", [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 NpawPlugin to your project. The easiest way is to add it via Podfile:

pod 'NpawPlugin'

To pass custom data:

import PRESTOplay
import CastlabsYoubora
import NpawPlugin

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

...

let youboraMetadata = YouboraMetadata(
    live: false,
    assetId: "assetId")
youboraMetadata.analyticsOptions = NpawPlugin.AnalyticsOptions()
youboraMetadata.analyticsOptions?.adCustomDimension1 = "test"
youboraMetadata.analyticsOptions?.contentTitle = "test"
youboraMetadata.accountCode = "ACCOUNT_CODE"

analytics?.metadata = youboraMetadata

Please check our examples/YouboraDemo for complete implementation.

Broadpeak

Integrate

Register a Broadpeak plugin to PRESTOplay SDK:

import PRESTOplay
import CastlabsBroadpeak

...

let broadpeakSettings = BroadpeakSettings(
    analyticsAddress: "YOUR-ANALYTICS-SERVER-ADDRESS",
    nanoCDNHost: "",
    domainNames: "")
let broadpeakPlugin = BroadpeakPlugin(broadpeakSettings)

PRESTOplaySDK.shared.register("LICENSE", [broadpeakPlugin])

Analytics instance and custom metadata

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

var analytics = 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 CocoaPods:

pod 'ConvivaSDK'

Please find a list of supported versions in configs/deps-versions.

Next, register the Conviva plugin to PRESTOplay SDK:

import PRESTOplay
import CastlabsConviva

...

let convivaSettings = ConvivaSettings(
    customerKey,: "YOUR-CUSTOMER-KEY",
    gatewayUrl: "YOUR-GATEWAY-URL")
let convivaPlugin = ConvivaPlugin(convivaSettings)

PRESTOplaySDK.shared.register("LICENSE", [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.

Mux Data

Integrate

First, include the Mux-Stats-Core library in your project. Here is an example using CocoaPods:

pod 'Mux-Stats-Core'

Please find a list of supported versions in configs/deps-versions.

Next, register the Mux Data plugin to PRESTOplay SDK:

import PRESTOplay
import CastlabsMux

...

let muxSettings = MuxSettings(environmentKey: "ENV_KEY")
let muxPlugin = MuxPlugin(muxSettings)

PRESTOplaySDK.shared.register("LICENSE", [muxPlugin])

Analytics instance

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

var analytics: AnalyticsAPI = PRESTOplaySDK.shared.analytics(for: player, .mux)