This page covers data collection for the Genre variable. See Genre for the corresponding reporting dimension.
The genre variable is the content genre as defined by the producer (for example, "Drama", "Comedy", or "Drama,Action"). Comma-delimit multiple values when the content fits more than one genre. In reporting, the list variable splits each value into a separate line item, with each line item receiving equal metric weight.
mediaReporting.sessionDetails.genreList (a list field). The older mediaReporting.sessionDetails.genre path remains functional but genreList is recommended.a.media.genreWeb SDK
Set genre inside mediaCollection.sessionDetails when calling sendEvent:
alloy("sendEvent", {
xdm: {
eventType: "media.sessionStart",
mediaCollection: {
sessionDetails: {
genre: "Drama,Action"
},
playhead: 0
}
}
});
Mobile SDK
Pass the genre string as a metadata key in the HashMap argument to trackSessionStart. Use MediaConstants.VideoMetadataKeys.GENRE.
iOS (Swift)
var metadata: [String: String] = [:]
metadata[MediaConstants.VideoMetadataKeys.GENRE] = "Drama,Action"
tracker.trackSessionStart(info: mediaObject, metadata: metadata)
Android (Kotlin)
val metadata = HashMap<String, String>()
metadata[MediaConstants.VideoMetadataKeys.GENRE] = "Drama,Action"
tracker.trackSessionStart(mediaInfo, metadata)
Roku (BrightScript)
Use createMediaSession to set genre inside sessionDetails:
m.aepSdk.createMediaSession({
"xdm": {
"eventType": "media.sessionStart",
"mediaCollection": {
"sessionDetails": {
"genre": "Drama,Action"
},
"playhead": 0
}
}
})
Media Edge API
Call the sessionStart endpoint with genre inside mediaCollection.sessionDetails:
{
"events": [{
"xdm": {
"eventType": "media.sessionStart",
"mediaCollection": {
"sessionDetails": {
"name": "video-123",
"length": 128,
"contentType": "vod",
"playerName": "HTML5 Player",
"channel": "Sports",
"genre": "Drama,Action"
},
"playhead": 0
}
}
}]
}
Media SDK
Pass the genre in the contextData object using ADB.Media.VideoMetadataKeys.Genre:
var contextData = {};
contextData[ADB.Media.VideoMetadataKeys.Genre] = "Drama,Action";
tracker.trackSessionStart(mediaInfo, contextData);
Media Collection API
Include media.genre in the params object:
{
"playerTime": { "playhead": 0, "ts": 1699523820000 },
"eventType": "sessionStart",
"params": {
"media.genre": "Drama,Action"
}
}
See the Media Collection API sessions reference for the full request structure.