This article is a good place to start if you are looking for information on how to configure the THEOplayer Youbora pre-integration, which is part of the Analytics API.

Table of Contents


Web SDK Android SDK iOS SDK tvOS SDK Android TV SDK Chromecast SDK
Yes Yes Yes No Yes Yes

Code example


Make sure you load the Youbora plugin in the head of the page.

  • For THEOplayer version 2021.2.0 (api version 2.81.0) and newer:
<script src="https://smartplugin.youbora.com/v6/js/adapters/theoplayer2/6.7.7/sp.min.js"></script>
  • For THEOplayer version 2021.1.0 (api version 2.80.0) and older:
<script src="https://smartplugin.youbora.com/v6/js/adapters/theoplayer2/6.5.7/sp.min.js"></script>

Include the following in your SourceDescription object:

var youbora = {
  integration: "youbora",
  enableAnalytics: true,
  username: "THEO",
  "content.title": "THEO 1 (VOD)",
  "content.duration": 653,
  "content.isLive": false,

var SourceDescription = {
  sources: [typedSource],
  analytics: [youbora],
Android (TV) SDK

You need to first initialize the Youbora library on your application. You can do this in two different ways:

  • While creating the player programmatically:
// create player config
THEOplayerConfig playerConfig = new THEOplayerConfig.Builder()
        .analytics(new YouboraOptions.Builder("YOUR_YOUBORA_ACCOUNT_CODE").build())

// create player
THEOplayerView tpv = new THEOplayerView(this, playerConfig);
  • Or through the player's XML configuration:
    app:youboraAccountCode="YOUR_YOUBORA_ACCOUNT_CODE" />

You can then set a Youbora source like the following:

YouboraOptions youbora = new YouboraOptions.Builder("YOUR_YOUBORA_ACCOUNT_CODE")
        .put("enableAnalytics", "true")
        .put("username", "THEO")
        .put("content.title", "VOD")
        .put("content.duration", "653")
        .put("content.isLive", "false")

SourceDescription elephantsDream = SourceDescription.Builder


ℹ️ Starting from Android SDK API 28, Google introduced some additional network security configurations. By default, http requests are blocked by the OS unless the application explicitly allows it.

In order to allow http requests (and allow Youbora data to be sent to the dashboard), you should follow the instructions in their guide: Network security configuration.

Basically there are 2 different ways to solve this on your app:

  1. Set the android:usesCleartextTraffic="true" flag under your application tag.
  2. If you are using a network security config such as: android:networkSecurityConfig="@xml/network_security_config", include this flag on your configuration, for example:
<?xml version="1.0" encoding="utf-8"?>
    <domain-config cleartextTrafficPermitted="true">
    <base-config cleartextTrafficPermitted="false"/>
Legacy iOS/tvOS SDK (4.12.x)

You need to first initialize the Youbora library on your application. You can do this on your player's configuration object:

let youboraOptions = YouboraOptions(accountCode: "YOUR_YOUBORA_ACCOUNT_CODE")
youboraOptions.put(key: "enableAnalytics", value: "true")
let playerConfiguration = THEOplayerConfiguration(chromeless: true, analytics: [youboraOptions])

You can then provide different Youbora option objects per source you set:

let youbora = YouboraOptions(accountCode: "YOUR_YOUBORA_ACCOUNT_CODE")
youbora.put(key: "enableAnalytics", value: "true")
youbora.put(key: "username", value: "THEO")
youbora.put(key: "content.title", value: "THEO 1 (VOD)")
youbora.put(key: "content.duration", value: "653")
youbora.put(key: "content.isLive", value: "false")
let sourceDescription = SourceDescription(source : typedSource, analytics: [youbora])
Make sure to follow us on GitHub!
Copyright © 2022. All Rights Reserved.
New York