Creative ID

This page covers data collection for the Creative ID variable. See Creative ID for the corresponding reporting dimension.

The creative ID variable identifies the specific ad creative. Any string value (typically a creative ID from your ad-server platform) is acceptable.

Property
Value
Context data variable
a.media.ad.creative
XDM collection field
mediaCollection.advertisingDetails.creativeID
Audience Manager trait
c_contextdata.a.media.ad.creative
Required
No
Sent with
Ad start, ad close

Web SDK

Set creativeID inside mediaCollection.advertisingDetails when calling sendEvent:

alloy("sendEvent", {
  xdm: {
    eventType: "media.adStart",
    mediaCollection: {
      advertisingDetails: {
        name: "ad-2125",
        creativeID: "creative-987"
      },
      sessionID: "{sid}",
      playhead: 0
    }
  }
});

Mobile SDK

Pass the creative ID as a metadata key in the HashMap argument to trackEvent(AdStart). Use MediaConstants.AdMetadataKeys.CREATIVE_ID.

iOS (Swift)

var metadata: [String: String] = [:]
metadata[MediaConstants.AdMetadataKeys.CREATIVE_ID] = "creative-987"

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

Android (Kotlin)

val metadata = HashMap<String, String>()
metadata[MediaConstants.AdMetadataKeys.CREATIVE_ID] = "creative-987"

tracker.trackEvent(Media.Event.AdStart, adObject, metadata)

Roku (BrightScript)

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

m.aepSdk.sendMediaEvent({
    "xdm": {
        "eventType": "media.adStart",
        "mediaCollection": {
            "advertisingDetails": {
                "name": "ad-2125",
                "creativeID": "creative-987"
            },
            "playhead": 0
        }
    }
})

Media Edge API

Call the adStart endpoint with creativeID inside mediaCollection.advertisingDetails:

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

Media SDK

Pass the creative ID in the contextData object using ADB.Media.AdMetadataKeys.CreativeId:

var contextData = {};
contextData[ADB.Media.AdMetadataKeys.CreativeId] = "creative-987";

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

Media Collection API

Include media.ad.creativeId in the params object:

{
  "playerTime": { "playhead": 0, "ts": 1699523820000 },
  "eventType": "adStart",
  "params": {
    "media.ad.creativeId": "creative-987"
  }
}

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

recommendation-more-help
media-analytics-help