Season

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

The season variable is the season number for the show (typically a string integer like "2"). Set it for content that is part of a series so engagement can be broken out by season. Pair with Show and Episode for full episodic context.

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

Web SDK

Set season inside mediaCollection.sessionDetails when calling sendEvent:

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

Mobile SDK

Pass the season as a metadata key in the HashMap argument to trackSessionStart. Use MediaConstants.VideoMetadataKeys.SEASON.

iOS (Swift)

var metadata: [String: String] = [:]
metadata[MediaConstants.VideoMetadataKeys.SEASON] = "2"

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

Android (Kotlin)

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

tracker.trackSessionStart(mediaInfo, metadata)

Roku (BrightScript)

Use createMediaSession to set season inside sessionDetails:

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

Media Edge API

Call the sessionStart endpoint with season inside mediaCollection.sessionDetails:

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

Media SDK

Pass the season in the contextData object using ADB.Media.VideoMetadataKeys.Season:

var contextData = {};
contextData[ADB.Media.VideoMetadataKeys.Season] = "2";

tracker.trackSessionStart(mediaInfo, contextData);

Media Collection API

Include media.season in the params object:

{
  "playerTime": { "playhead": 0, "ts": 1699523820000 },
  "eventType": "sessionStart",
  "params": {
    "media.season": "2"
  }
}

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

recommendation-more-help
media-analytics-help