Ad complete

The ad complete event signals that an individual ad finished playing. Send it after the ad plays to completion. If the viewer skips the ad, send Ad skip instead.

IMPORTANT
This event must be surrounded by adBreakStart and adBreakComplete bookends, even when a single ad plays. Without these bookends, ad events are ignored and the ad duration is counted as main content duration.

Web SDK

Call sendEvent with eventType: "media.adComplete":

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

Mobile SDK

Call trackEvent with the AdComplete event type.

iOS (Swift)

tracker.trackEvent(event: MediaEvent.AdComplete, info: nil, metadata: nil)

Android (Kotlin)

tracker.trackEvent(Media.Event.AdComplete, null, null)

Roku (BrightScript)

Call sendMediaEvent with eventType: "media.adComplete":

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

Media Edge API

Call the adComplete endpoint:

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

Media SDK

Call trackEvent with the AdComplete event type:

tracker.trackEvent(ADB.Media.Event.AdComplete, null, null);

Media Collection API

Send an adComplete POST to the events endpoint:

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