Chapter start
The chapter start event signals the beginning of a chapter within the content. Chapter tracking is optional and not required for core media tracking.
- Prerequisites: Session start
- Associated metric: Chapter starts
Web SDK
Call sendEvent with eventType: "media.chapterStart" and the required chapterDetails:
alloy("sendEvent", {
xdm: {
eventType: "media.chapterStart",
mediaCollection: {
chapterDetails: {
friendlyName: "Pilot Episode - Opening",
index: 1,
offset: 0,
length: 240
},
sessionID: "{sid}",
playhead: 0
}
}
});
Mobile SDK
Pass the chapter name, position, length, and start time to createChapterObject, then call trackEvent.
iOS (Swift)
let chapterObject = Media.createChapterObjectWith(name: "Pilot Episode - Opening",
position: 1,
length: 240,
startTime: 0)
tracker.trackEvent(event: MediaEvent.ChapterStart, info: chapterObject, metadata: nil)
Android (Kotlin)
val chapterObject = Media.createChapterObject("Pilot Episode - Opening",
1,
240,
0)
tracker.trackEvent(Media.Event.ChapterStart, chapterObject, null)
Roku (BrightScript)
Call sendMediaEvent with eventType: "media.chapterStart" and the required chapterDetails:
m.aepSdk.sendMediaEvent({
"xdm": {
"eventType": "media.chapterStart",
"mediaCollection": {
"chapterDetails": {
"friendlyName": "Pilot Episode - Opening",
"index": 1,
"offset": 0,
"length": 240
},
"playhead": 0
}
}
})
Media Edge API
Call the chapterStart endpoint with the required chapterDetails:
curl -X POST "https://edge.adobedc.net/ee/va/v1/chapterStart?configId={datastreamID}" \
--header 'Content-Type: application/json' \
--data '{
"events": [{
"xdm": {
"eventType": "media.chapterStart",
"mediaCollection": {
"sessionID": "{sid}",
"playhead": 0,
"chapterDetails": {
"index": 1,
"length": 240,
"offset": 0
}
},
"timestamp": "YYYY-08-20T22:41:40+00:00"
}
}]
}'
Media SDK
Pass the chapter name, position, length, and start time to ADB.Media.createChapterObject:
var chapterInfo = ADB.Media.createChapterObject(
"Pilot Episode - Opening", // name
1, // position
240, // length (seconds)
0 // start time (seconds)
);
tracker.trackEvent(ADB.Media.Event.ChapterStart, chapterInfo, null);
Media Collection API
Send a chapterStart POST to the events endpoint:
{
"playerTime": { "playhead": 0, "ts": 1699523820000 },
"eventType": "chapterStart",
"params": {
"media.chapter.friendlyName": "Pilot Episode - Opening",
"media.chapter.index": 1,
"media.chapter.offset": 0,
"media.chapter.length": 240
}
}
recommendation-more-help
media-analytics-help