Album

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

The album variable is the name of the album the audio track belongs to (for example, "Pinegrove"). Use it to roll up engagement across tracks from the same album.

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

Web SDK

Set album inside mediaCollection.sessionDetails when calling sendEvent:

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

Mobile SDK

Pass the album as a metadata key in the HashMap argument to trackSessionStart. Use MediaConstants.AudioMetadataKeys.ALBUM.

iOS (Swift)

var metadata: [String: String] = [:]
metadata[MediaConstants.AudioMetadataKeys.ALBUM] = "Pinegrove"

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

Android (Kotlin)

val metadata = HashMap<String, String>()
metadata[MediaConstants.AudioMetadataKeys.ALBUM] = "Pinegrove"

tracker.trackSessionStart(mediaInfo, metadata)

Roku (BrightScript)

Use createMediaSession to set album inside sessionDetails:

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

Media Edge API

Call the sessionStart endpoint with album inside mediaCollection.sessionDetails:

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

Media SDK

Pass the album in the contextData object using ADB.Media.AudioMetadataKeys.Album:

var contextData = {};
contextData[ADB.Media.AudioMetadataKeys.Album] = "Pinegrove";

tracker.trackSessionStart(mediaInfo, contextData);

Media Collection API

Include media.album in the params object:

{
  "playerTime": { "playhead": 0, "ts": 1699523820000 },
  "eventType": "sessionStart",
  "params": {
    "media.album": "Pinegrove"
  }
}

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

recommendation-more-help
media-analytics-help