Asset ID

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

The asset ID variable is the unique identifier for the underlying media asset (for example, an episode ID, a movie ID, or a live event ID). Typically sourced from metadata authorities such as EIDR, TMS/Gracenote, or Rovi, but proprietary or in-house IDs are also accepted. Use it when you need to compare engagement across distribution platforms that may assign different content IDs to the same underlying asset.

NOTE
The XDM collection field uses uppercase ID: assetID.
Property
Value
Context data variable
a.media.asset
XDM collection field
mediaCollection.sessionDetails.assetID
Required
No
Sent with
Session start, session close

Web SDK

Set assetID inside mediaCollection.sessionDetails when calling sendEvent:

alloy("sendEvent", {
  xdm: {
    eventType: "media.sessionStart",
    mediaCollection: {
      sessionDetails: {
        assetID: "89745363"
      },
      playhead: 0
    }
  }
});

Mobile SDK

Pass the asset ID as a metadata key in the HashMap argument to trackSessionStart. Use MediaConstants.VideoMetadataKeys.ASSET_ID.

iOS (Swift)

var metadata: [String: String] = [:]
metadata[MediaConstants.VideoMetadataKeys.ASSET_ID] = "89745363"

tracker.trackSessionStart(info: mediaObject, metadata: metadata)

Android (Kotlin)

val metadata = HashMap<String, String>()
metadata[MediaConstants.VideoMetadataKeys.ASSET_ID] = "89745363"

tracker.trackSessionStart(mediaInfo, metadata)

Roku (BrightScript)

Use createMediaSession to set assetID inside sessionDetails:

m.aepSdk.createMediaSession({
    "xdm": {
        "eventType": "media.sessionStart",
        "mediaCollection": {
            "sessionDetails": {
                "assetID": "89745363"
            },
            "playhead": 0
        }
    }
})

Media Edge API

Call the sessionStart endpoint with assetID inside mediaCollection.sessionDetails:

{
  "events": [{
    "xdm": {
      "eventType": "media.sessionStart",
      "mediaCollection": {
        "sessionDetails": {
          "name": "video-123",
          "length": 128,
          "contentType": "vod",
          "playerName": "HTML5 Player",
          "channel": "Sports",
          "assetID": "89745363"
        },
        "playhead": 0
      }
    }
  }]
}

Media SDK

Pass the asset ID in the contextData object using ADB.Media.VideoMetadataKeys.AssetId:

var contextData = {};
contextData[ADB.Media.VideoMetadataKeys.AssetId] = "89745363";

tracker.trackSessionStart(mediaInfo, contextData);

Media Collection API

Include media.assetId in the params object:

{
  "playerTime": { "playhead": 0, "ts": 1699523820000 },
  "eventType": "sessionStart",
  "params": {
    "media.assetId": "89745363"
  }
}

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

recommendation-more-help
media-analytics-help