Session complete

The session complete event signals that the viewer reached the end of the main content. It does not immediately close the session; the session remains open until it expires naturally. If you want to immediately close the session, call Session end instead.

Web SDK

Call sendEvent with eventType: "media.sessionComplete":

alloy("sendEvent", {
  xdm: {
    eventType: "media.sessionComplete",
    mediaCollection: {
      sessionID: "{sid}",
      playhead: 128
    }
  }
});

Mobile SDK

Call trackComplete when the media player reaches the end of content.

iOS (Swift)

tracker.trackComplete()

Android (Kotlin)

tracker.trackComplete()

Roku (BrightScript)

Call sendMediaEvent with eventType: "media.sessionComplete":

m.aepSdk.sendMediaEvent({
    "xdm": {
        "eventType": "media.sessionComplete",
        "mediaCollection": {
            "playhead": 128
        }
    }
})

Media Edge API

Call the sessionComplete endpoint:

curl -X POST "https://edge.adobedc.net/ee/va/v1/sessionComplete?configId={datastreamID}" \
--header 'Content-Type: application/json' \
--data '{
  "events": [{
    "xdm": {
      "eventType": "media.sessionComplete",
      "mediaCollection": {
        "sessionID": "{sid}",
        "playhead": 128
      },
      "timestamp": "YYYY-08-20T22:41:40+00:00"
    }
  }]
}'

Media SDK

Call trackComplete when the media player reaches the end of content:

tracker.trackComplete();

Media Collection API

Send a sessionComplete POST to the events endpoint:

{
  "playerTime": { "playhead": 128, "ts": 1699523820000 },
  "eventType": "sessionComplete"
}
recommendation-more-help
media-analytics-help