Label

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

The label variable is the name of the record label that released the audio content (for example, "Capitol Records"). Use it to compare engagement across labels in a music or podcast catalog.

Property
Value
Context data variable
a.media.label
XDM collection field
mediaCollection.sessionDetails.label
Audience Manager trait
c_contextdata.a.media.label
Required
No
Sent with
Session start, session close

Web SDK

Set label inside mediaCollection.sessionDetails when calling sendEvent:

alloy("sendEvent", {
  xdm: {
    eventType: "media.sessionStart",
    mediaCollection: {
      sessionDetails: {
        label: "Capitol Records"
      },
      playhead: 0
    }
  }
});

Mobile SDK

Pass the label as a metadata key in the HashMap argument to trackSessionStart. Use MediaConstants.AudioMetadataKeys.LABEL.

iOS (Swift)

var metadata: [String: String] = [:]
metadata[MediaConstants.AudioMetadataKeys.LABEL] = "Capitol Records"

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

Android (Kotlin)

val metadata = HashMap<String, String>()
metadata[MediaConstants.AudioMetadataKeys.LABEL] = "Capitol Records"

tracker.trackSessionStart(mediaInfo, metadata)

Roku (BrightScript)

Use createMediaSession to set label inside sessionDetails:

m.aepSdk.createMediaSession({
    "xdm": {
        "eventType": "media.sessionStart",
        "mediaCollection": {
            "sessionDetails": {
                "label": "Capitol Records"
            },
            "playhead": 0
        }
    }
})

Media Edge API

Call the sessionStart endpoint with label inside mediaCollection.sessionDetails:

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

Media SDK

Pass the label in the contextData object using ADB.Media.AudioMetadataKeys.Label:

var contextData = {};
contextData[ADB.Media.AudioMetadataKeys.Label] = "Capitol Records";

tracker.trackSessionStart(mediaInfo, contextData);

Media Collection API

Include media.label in the params object:

{
  "playerTime": { "playhead": 0, "ts": 1699523820000 },
  "eventType": "sessionStart",
  "params": {
    "media.label": "Capitol Records"
  }
}

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

recommendation-more-help
media-analytics-help