Skip to main content
Version: 7.6.0


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


Web SDKAndroid SDKiOS SDKtvOS SDKAndroid TV SDKChromecast SDK

Code example


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 ''
compile ''
  1. Set your application for THEOplayer when the Application is created:

public class MyApplication extends Application {
@Overridepublic void onCreate() {
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


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


Configure the Moat partner code.

new THEOplayer.Player(containerElement, {
libraryLocation: "",
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()
.analytics(new MoatOptions.Builder("NAMESPACE", "<PARTNER_CODE>").loggingEnabled(true).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)]