Station

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

The station variable is the name or ID of the radio station broadcasting the audio content (for example, "NPR" or "WXYZ-FM"). Use it to compare engagement across stations in a syndicated network.

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

Web SDK

Set station inside mediaCollection.sessionDetails when calling sendEvent:

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

Mobile SDK

Pass the station as a metadata key in the HashMap argument to trackSessionStart. Use MediaConstants.AudioMetadataKeys.STATION.

iOS (Swift)

var metadata: [String: String] = [:]
metadata[MediaConstants.AudioMetadataKeys.STATION] = "NPR"

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

Android (Kotlin)

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

tracker.trackSessionStart(mediaInfo, metadata)

Roku (BrightScript)

Use createMediaSession to set station inside sessionDetails:

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

Media Edge API

Call the sessionStart endpoint with station inside mediaCollection.sessionDetails:

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

Media SDK

Pass the station in the contextData object using ADB.Media.AudioMetadataKeys.Station:

var contextData = {};
contextData[ADB.Media.AudioMetadataKeys.Station] = "NPR";

tracker.trackSessionStart(mediaInfo, contextData);

Media Collection API

Include media.station in the params object:

{
  "playerTime": { "playhead": 0, "ts": 1699523820000 },
  "eventType": "sessionStart",
  "params": {
    "media.station": "NPR"
  }
}

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

recommendation-more-help
media-analytics-help