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

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

 

Moat pre-integration

The THEOplayer Android SDK supports Moat analytics (version 2.4.3+) out-of-the-box. Below you can find the steps to enable Moat tracking.

1. Include the moat native Android SDK in the gradle file:

repositories {
  flatDir {
    dirs 'libs'
  }
}

dependencies {
  compile (name: 'moat-mobile-app-kit', ext:'aar')
}

2. (Optional for Moat 2.4.2+) Ensure Google Play Ads dependencies are included.
If this is omitted, this functionality will be limited.

dependencies {
  compile 'com.google.android.gms:play-services-ads:+'
  compile 'com.android.support:support-v4:+'
}

3. Set your application for THEOplayer when the Application is created:

import android.app.Application;
import com.moat.analytics.mobile.moatnamespace.MoatAnalytics;

public class MyApplication extends Application {
  @Overridepublic void onCreate() {
    super.onCreate();
    THEOplayerGlobal.getSharedInstance(this).setApplicationInstance(this);
  }
}

4. Configure the MOAT partner code and namespace and enable Google IMA

new THEOplayerConfig.Builder()
  .googleIma(true)
  .analytics(new MoatOptions.Builder("NAMESPACE", "PARTNER_CODE").loggingEnabled(true).build())
  .build();

 When you want to make use of moat for tracking advertisements, you should make use of the GoogleImaAdDescription.