First air date

This page covers data collection for the First air date variable. See First air date for the corresponding reporting dimension.

The first air date variable is the date the content first aired on television. Any date format is accepted but Adobe recommends YYYY-MM-DD for consistency. Use it to compare engagement on new releases vs. catalog content.

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

Set firstAirDate inside xdm.mediaCollection.sessionDetails when calling sendEvent:

code language-javascript
alloy("sendEvent", {
  xdm: {
    eventType: "media.sessionStart",
    mediaCollection: {
      sessionDetails: {
        firstAirDate: "2016-01-25"
      },
      playhead: 0
    }
  }
});
iOS

Pass the first air date as a metadata key in the HashMap argument to trackSessionStart. Use MediaConstants.VideoMetadataKeys.FIRST_AIR_DATE.

code language-swift
var metadata: [String: String] = [:]
metadata[MediaConstants.VideoMetadataKeys.FIRST_AIR_DATE] = "2016-01-25"

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

Pass the first air date as a metadata key in the HashMap argument to trackSessionStart. Use MediaConstants.VideoMetadataKeys.FIRST_AIR_DATE.

code language-kotlin
val metadata = HashMap<String, String>()
metadata[MediaConstants.VideoMetadataKeys.FIRST_AIR_DATE] = "2016-01-25"

tracker.trackSessionStart(mediaInfo, metadata)
Roku Edge

Use createMediaSession to set firstAirDate inside sessionDetails:

code language-brightscript
m.aepSdk.createMediaSession({
    "xdm": {
        "eventType": "media.sessionStart",
        "mediaCollection": {
            "sessionDetails": {
                "firstAirDate": "2016-01-25"
            },
            "playhead": 0
        }
    }
})
Media Edge API

Call the sessionStart endpoint with firstAirDate inside xdm.mediaCollection.sessionDetails:

code language-json
{
  "events": [{
    "xdm": {
      "eventType": "media.sessionStart",
      "mediaCollection": {
        "sessionDetails": {
          "name": "video-123",
          "length": 128,
          "contentType": "vod",
          "playerName": "HTML5 Player",
          "channel": "Sports",
          "firstAirDate": "2016-01-25"
        },
        "playhead": 0
      }
    }
  }]
}

Legacy implementation types (Analytics-only)

Media SDK JS 3.x

Pass the first air date in the contextData object using ADB.Media.VideoMetadataKeys.FirstAirDate:

code language-javascript
var contextData = {};
contextData[ADB.Media.VideoMetadataKeys.FirstAirDate] = "2016-01-25";

tracker.trackSessionStart(mediaInfo, contextData);
Chromecast

Use ADBMobile.media.VideoMetadataKeys.FIRST_AIR_DATE to set the first air date in the StandardMediaMetadata property of the media object before calling trackSessionStart:

code language-javascript
var mediaInfo = ADBMobile.media.createMediaObject("My Video", "video-123", 128,
  ADBMobile.media.StreamType.VOD, ADBMobile.media.MediaType.Video);
var standardMetadata = {};
standardMetadata[ADBMobile.media.VideoMetadataKeys.FIRST_AIR_DATE] = "2016-01-25";
mediaInfo[ADBMobile.media.MediaObjectKey.StandardMediaMetadata] = standardMetadata;
ADBMobile.media.trackSessionStart(mediaInfo, null);
Roku 2.x

Use MEDIA_VideoMetadataKeyFIRST_AIR_DATE to set the first air date in the standard metadata of the media object before calling mediaTrackSessionStart:

code language-brightscript
adb = ADBMobile()
mediaInfo = adb_media_init_mediainfo("My Video", "video-123", 128.0, adb.MEDIA_STREAM_TYPE_VOD, adb.MEDIA_TYPE_VIDEO)

standardMetadata = {}
standardMetadata[adb.MEDIA_VideoMetadataKeyFIRST_AIR_DATE] = "2016-01-25"
mediaInfo[adb.MEDIA_STANDARD_MEDIA_METADATA] = standardMetadata

adb.mediaTrackSessionStart(mediaInfo, invalid)
Media Collection API

Include media.firstAirDate in the params object:

code language-json
{
  "playerTime": { "playhead": 0, "ts": 1699523820000 },
  "eventType": "sessionStart",
  "params": {
    "media.firstAirDate": "2016-01-25"
  }
}

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

recommendation-more-help
media-analytics-help