The Dynamic Ad Insertion (DAI) Stream Activity Monitor (SAM) API lets you inspect and troubleshoot individual livestream and video-on-demand (VOD) viewing sessions.
To visually inspect and troubleshoot an individual livestream or VOD viewing session, use the
Stream Activity Monitor in
the Google Ad Manager UI.
To programmatically retrieve diagnostic data for a session, use the Ad
Manager API
networks.daiSessions
resource.
Understand the use cases
With the SAM API, you can automate stream diagnostics and resolve ad delivery issues across your DAI integrations, such as the following:
- Verify stream session creation: Confirm the parameters, stitching mode
of
STITCHEDorPOD_SERVING, reporting mode, and content metadata that Google DAI receives when creating a livestream or VOD session. - Audit ad requests and responses: Inspect outgoing Video Ad Serving Template (VAST) and Video Multiple Ad Playlist (VMAP) ad tags, HTTP status codes, response latencies, raw XML response bodies, and wrapper redirect chains.
- Troubleshoot ad pod decisioning and creatives: Verify which ads Google DAI selects or drops for each pod, the duration of each ad in the pod, and the source ad system of the ad creative.
- Track ad prefetch execution: Determine whether Google DAI prefetches an ad pod and check the prefetch stage of each ad pod.
- Validate DAI Ad Break API and Pod serving DAI API calls: Check actual break execution, served ad durations, and inserted slate durations against API calls, such as the DAI Ad Break API and Pod serving DAI API.
- Verify ad event tracking: Confirm whether client-side or server-side tracking pings succeeded and inspect the HTTP responses from ad servers.
- Automate session monitoring and alerting: Parse structured findings
entries with an
INFO,WARNING, orERRORseverity to detect playback or monetization issues in automated integration tests and production monitoring pipelines.
Learn the top level resource
The SAM API is part of the Google Ad Manager REST API (Beta) on the
admanager.googleapis.com endpoint and exposes the
networks.daiSessions.get
read-only method. You can query a DaiSession resource
with a DAI session ID or a custom debug key. DAI retains the session records for
up to three days after playback.
The SAM API doesn't support listing all DaiSession resources in a Google Ad
Manager network.
Inspect DAI stream responses with SAM
To verify how Google DAI processes your stream requests, examine
the DaiSession response:
- Full-service DAI API: Inspect the
creationContext.streamCreateRequestfield to verify the stream registration call, check theadSelectionsandadPodsmaps to review ad decisioning, and examine theadBreaksmap to confirm stitched ad, slate creative, and underlying content durations. - Pod serving DAI API: Confirm that the
creationContext.stitchingTypefield is set to thePOD_SERVINGvalue, cross-check theadBreakIdfield in theadPodsandadBreaksmaps with your pod manifest or pod segment request calls, and inspect server-side or media-verification beacons in thetrackingPingsmap. - DAI Ad Break API: Match the
breakSequencevalue of anAdBreakobject against theAdBreak.breakSequenceproperty.
Make your first request
To set up authentication and retrieve DAI session resources, see Use the Stream Activity Monitor API.