The following instructions provide guidance for implementation using the 2.x SDKs.
If you are implementing a 1.x version of the SDK, you can download 1.x Developers Guides here: Download SDKs.
Constant name | Description |
---|---|
AdBreakStart |
Constant for tracking AdBreak Start event |
AdBreakComplete |
Constant for tracking AdBreak Complete event |
AdStart |
Constant for tracking Ad Start event |
AdComplete |
Constant for tracking Ad Complete event |
AdSkip |
Constant for tracking Ad Skip event |
Identify when the ad break boundary begins, including pre-roll, and create an AdBreakObject
by using the ad break information.
Ad break object creation: createAdBreakObject
adBreakInfo = ADBMobile.media.createAdBreakObject("First Ad-Break", 1, AD_BREAK_START_TIME, playerName);
Call trackEvent()
with AdBreakStart
in the MediaHeartbeat
instance to begin tracking the ad break: trackEvent
ADBMobile.media.trackEvent(ADBMobile.media.Event.AdBreakStart, getAdBreakInfo());
Identify when the ad asset starts and create an AdObject
instance using the ad information.
Ad object creation: createAdObject
adInfo = ADBMobile.media.createAdObject("Sample ad", "001", 1, AD_LENGTH);
Optionally attach standard and/or ad metadata to the media tracking session through context data variables.
Call trackEvent()
with the AdStart
event to begin tracking the ad playback.
Include a reference to your custom metadata variable (or an empty object) as the third parameter in the event call: trackEvent
ADBMobile.media.trackEvent(ADBMobile.media.Event.AdStart, getAdInfo(), adContextData);
When the ad asset playback reaches the end of the ad, call trackEvent()
with the AdComplete
event: trackEvent
ADBMobile.media.trackEvent(ADBMobile.media.Event.AdComplete);
If there are any additional ads within the same AdBreak
, repeat steps 3 through 6 again.
When the ad break is complete, use the AdBreakComplete
event to track: trackEvent
ADBMobile.media.trackEvent(ADBMobile.media.Event.AdBreakComplete, getAdBreakInfo());
See the tracking scenario VOD playback with pre-roll ads for more information.