Android SDK Analytics

Analytics

Youbora pre-integration

The THEOplayer Android SDK supports Youbora analytics out-of-the-box. Below you can find the steps to enable Youbora tracking.

 

1. Set your Youbora analytics account code on player creation

This makes sure the Youbora analytics library is loaded and tracking is enabled.

Using the Java configuration:

// create player config
THEOplayerConfig playerConfig = new THEOplayerConfig.Builder()
.analytics(YouboraOptions.Builder.youboraOptions("YOUR_YOUBORA_ACCOUNT_CODE").build())
.build();

// create player
THEOplayerView tpv = new THEOplayerView(this, playerConfig);

 Using the xml configuration:

<com.theoplayer.android.api.THEOplayerView
android:id="@+id/theo_player_view"
app:youboraAccountCode="YOUR_YOUBORA_ACCOUNT_CODE" />

 

2. (optional) Add extra Youbora options when setting the player source

This allows you to add for example the content title used for tracking

SourceDescpription source = sourceDescription("https://cdn.theoplayer.com/video/elephants-dream/playlist.m3u8")
.analytics(
youboraOptions().put("content.title", "Elephants Dream").build()
).build();
tpv.getPlayer().setSource(source);