Content name

This page covers data collection for the Content name variable. See Content name for the corresponding reporting dimension.

The content name variable is the human-readable title of the content (for example, "Blinding Light"). It is optional but strongly recommended. In the XDM schema it maps to friendlyName (not name; name holds the Content ID).

Property
Value
Context data variable
a.media.friendlyName
XDM collection field
mediaCollection.sessionDetails.friendlyName
Required
No
Sent with
Session start, session close

Web SDK

Set friendlyName inside mediaCollection.sessionDetails when calling sendEvent:

alloy("sendEvent", {
  xdm: {
    eventType: "media.sessionStart",
    mediaCollection: {
      sessionDetails: {
        name: "video-123",
        friendlyName: "Blinding Light",
        length: 128,
        contentType: "vod",
        playerName: "HTML5 Player",
        channel: "Sports",
        streamType: "video"
      },
      playhead: 0
    }
  }
});

Mobile SDK

Pass the human-readable name as the first (name) argument to createMediaObject. The second argument is the Content ID.

iOS (Swift)

let mediaObject = Media.createMediaObjectWith(name: "Blinding Light",
                                                id: "video-123",
                                            length: 128,
                                        streamType: MediaConstants.StreamType.VOD,
                                         mediaType: MediaType.Video)

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

Android (Kotlin)

var mediaInfo = Media.createMediaObject("Blinding Light",
                                        "video-123",
                                        128,
                                        MediaConstants.StreamType.VOD,
                                        Media.MediaType.Video)

tracker.trackSessionStart(mediaInfo, null)

Roku (BrightScript)

Set friendlyName inside mediaCollection.sessionDetails when calling createMediaSession:

m.aepSdk.createMediaSession({
    "xdm": {
        "eventType": "media.sessionStart",
        "mediaCollection": {
            "sessionDetails": {
                "name": "video-123",
                "friendlyName": "Blinding Light",
                "length": 128,
                "contentType": "vod",
                "playerName": "Roku Player",
                "channel": "Sports",
                "streamType": "video"
            },
            "playhead": 0
        }
    }
})

Media Edge API

Call the sessionStart endpoint with friendlyName inside mediaCollection.sessionDetails:

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

Media SDK

Pass the human-readable name as the first argument to ADB.Media.createMediaObject:

var mediaInfo = ADB.Media.createMediaObject(
  "Blinding Light",    // name (friendly name)
  "video-123",              // media ID
  128,
  ADB.Media.StreamType.VOD,
  ADB.Media.MediaType.Video
);

tracker.trackSessionStart(mediaInfo, contextData);

Media Collection API

Include media.name in the params object of your sessionStart POST request:

{
  "playerTime": { "playhead": 0, "ts": 1699523820000 },
  "eventType": "sessionStart",
  "params": {
    "media.name": "Blinding Light"
  }
}

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

recommendation-more-help
media-analytics-help