Skip to main content
Version: 8.14.0

Moat

Moat is an analytics service maintained by Oracle. THEOplayer offers a pre-integration for this solution. A demo can be found at https://demo.theoplayer.com/moat-analytics-pre-integration.

SDKs​

Web SDKAndroid SDKiOS SDKtvOS SDKAndroid TV SDKChromecast SDK
YesYesYesNoYesUnverified

Code example​

Prerequisites​

Android (TV) SDK​

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')
}
  1. (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:+'
}
  1. 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);
}
}
iOS (/tvOS) SDK​

THEOplayer supports Moat Analytics integration from Moat SDK version 3.6.0+. This integration is only available upon request.

Once you've received a build which has THEOplayer's Moat integration, you have to import the Moat framework:

import DMSMoatMobileAppKit

Configuration​

The snippets below explain how you can pass on Moat settings to a THEOplayer configuration object.

Web SDK​

Configure the Moat partner code.

new THEOplayer.Player(containerElement, {
libraryLocation: 'https://cdn.theoplayer.com/dash/theoplayer/',
analytics: [
{
integration: 'moat',
partnerCode: '<PARTNER_CODE>',
},
],
});

When you want to make use of Moat for tracking advertisements, you should make use of the IMAAdDescription.

Android (TV) SDK​

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.

iOS (/tvOS) SDK​

Enable Google IMA in your THEOplayer instance:

let config = THEOplayerConfiguration(defaultCSS: true, googleIMA: true)
let theoplayer = THEOplayer(configuration: config)

Configure a Google IMA source with Moat Analytics enabled:

public static var moatPreroll : SourceDescription {
let typedSource = TypedSource(src: "<HLS_STREAM_URL>", type: "application/x-mpegurl")
return SourceDescription(
source : typedSource,
ads: [
GoogleImaAdDescription(src: "<AD_TAG_URL>")],
analytics: [MoatOptions(partnerCode: "<PARTNER_CODE>", debugLoggingEnabled: true)]
)
}