Ad in pod position

This page covers data collection for the Ad in pod position variable. See Ad in pod position for the corresponding reporting dimension.

The ad in pod position variable is the zero-indexed position of the ad inside its parent ad break. The first ad in a pod has index 0, the second has index 1, and so on. Use the dimension to compare engagement and completion by position within an ad break.

Property
Value
Context data variable
a.media.ad.podPosition
XDM collection field
xdm.mediaCollection.advertisingDetails.podPosition
Audience Manager trait
c_contextdata.a.media.ad.podPosition
Required
Yes
Sent with
Ad start, ad close
Web SDK

Set podPosition inside xdm.mediaCollection.advertisingDetails when calling sendEvent:

code language-javascript
alloy("sendEvent", {
  xdm: {
    eventType: "media.adStart",
    mediaCollection: {
      advertisingDetails: {
        name: "ad-2125",
        podPosition: 0
      },
      sessionID: "{sid}",
      playhead: 0
    }
  }
});
iOS

Pass the position as the third argument to createAdObject.

code language-swift
let adObject = Media.createAdObjectWith(name: "Ford F-150",
                                          id: "ad-2125",
                                    position: 0,
                                      length: 15)

tracker.trackEvent(event: MediaEvent.AdStart, info: adObject, metadata: nil)
Android

Pass the position as the third argument to createAdObject.

code language-kotlin
val adObject = Media.createAdObject("Ford F-150",
                                    "ad-2125",
                                    0L,
                                    15.0)

tracker.trackEvent(Media.Event.AdStart, adObject, null)
Roku

Set podPosition inside xdm.mediaCollection.advertisingDetails when calling sendMediaEvent for media.adStart:

code language-brightscript
m.aepSdk.sendMediaEvent({
    "xdm": {
        "eventType": "media.adStart",
        "mediaCollection": {
            "advertisingDetails": {
                "name": "ad-2125",
                "podPosition": 0,
                "length": 15,
                "playerName": "Roku Player"
            },
            "playhead": 0
        }
    }
})
Media Edge API

Call the adStart endpoint with podPosition inside xdm.mediaCollection.advertisingDetails:

code language-json
{
  "events": [{
    "xdm": {
      "eventType": "media.adStart",
      "mediaCollection": {
        "advertisingDetails": {
          "name": "ad-2125",
          "length": 15,
          "playerName": "Freewheel",
          "podPosition": 0
        },
        "sessionID": "{sid}",
        "playhead": 0
      }
    }
  }]
}

Legacy implementation types (Analytics-only)

Media SDK JS 3.x

Pass the position as the third argument to ADB.Media.createAdObject:

code language-javascript
var adInfo = ADB.Media.createAdObject(
  "Ford F-150",
  "ad-2125",
  0,
  15
);

tracker.trackEvent(ADB.Media.Event.AdStart, adInfo, contextData);
Chromecast

Pass the position as the third argument to ADBMobile.media.createAdObject:

code language-javascript
var adInfo = ADBMobile.media.createAdObject(
  "Ford F-150",
  "ad-2125",
  1,
  30
);
ADBMobile.media.trackEvent(ADBMobile.media.Event.AdStart, adInfo, null);
Media Collection API

Include media.ad.podPosition in the params object:

code language-json
{
  "playerTime": { "playhead": 0, "ts": 1699523820000 },
  "eventType": "adStart",
  "params": {
    "media.ad.podPosition": 0
  }
}

See the Media Collection API events reference for the full request structure.

recommendation-more-help
media-analytics-help