Skip to content

Requesting ads

The Ad API is how a player asks for ads to show and reports what happened during playback. It is public: no access token or project header. The two endpoints:

Endpoint Method Purpose
/v1/ads GET Request an ad decision (VAST XML)
/v1/track GET Report a playback event

The /v1/track path is illustrative. The player never builds this URL. The server stamps the real tracking URLs inside the VAST. Read them verbatim from each <Impression> and <Tracking>, then append &ets=<now> and fire. The host, path, and query params are all server-owned; treat them as opaque.

This section is split into focused pages; start here, then follow the loop below into the detail.


Prerequisite How the player gets it
Base URL per environment Provided at onboarding (sandbox host for integration, production host for live traffic).
Player identity A retailer-scoped playerid + key, issued when the player’s device and retailer scope are provisioned.

Conventions:

  • All endpoints are HTTPS. No auth beyond the player’s playerid + key.
  • Timestamps are RFC3339, UTC (2026-05-28T14:32:05.1234Z). Append ets in this format on every fire. The server deduplicates on the parsed instant: two plays of one ad must carry different timestamps, and a replayed fire must carry its original ets. Keep the device clock healthy: a play that starts more than 10 minutes before its ad request is not billed.

This is the whole integration. Everything after it is detail.

Online, per slot:

  1. GET /v1/ads?playerid=…&key=… (add audience signals with seg / products, and &dvactid=… if the player’s sensor gave the player one) → VAST XML. An empty <VAST/> means no ad: play from the player’s stored playlist.
  2. Play each <Ad>, dispatching on its <MediaFile type> (video, image, or HTML5).
  3. As each playback event happens, fire that event’s URL straight from the VAST, appending &ets=<now>. That means <Impression> + start when the creative first renders, and complete when it ends (or its Duration elapses).

Offline (device loses connectivity):

  1. Ahead of time: GET …&offline=true, store the playlist AND download each ad’s creative.
  2. While offline: play from the stored playlist, buffer every fire (URL + ets).
  3. On reconnect: replay the buffered fires as GETs (staggered, so a whole site doesn’t reconnect in lockstep).

Two rules carry most of the design:

  • The player fires every pixel. Read each <Impression> and <Tracking> URL straight from the VAST and fire it, appending ets on every fire. Fire an <Error> URL only when the ad cannot play. With a VAST SDK, drive fires from its progress callbacks and disable its built-in firing: a stock SDK won’t append ets or buffer offline fires.
  • Relay each tracking URL verbatim and never parse its query params. Every param the server stamped (asid, ae, ce, sts) is opaque: treat them as an indivisible URL.

The id of an <Ad> names the ad. It is an opaque string: store it as text, and do not parse it. Offline, an ad with several creatives comes as one <Ad> per creative, with the same id and a different <Creative id>.

Each <Ad> also carries a <Extension type="verve-metadata"> with JSON. The verve-metadata schema defines every field.

Field What the player uses it for
expires_at Drop the ad at slot time once past it. If every stored ad is past it and the player cannot refresh, see When the player cannot refresh. An online ad expires much sooner than an offline one. A play that starts past it is not billed.
request_id Group all ads from one /ads response (correlation / debug).
flight_id Attribution. Optional.
campaign_id Attribution / debug. Optional.
source Which kind of source served the ad.
source_id The source this ad came from. Offline, group stored ads by it to honor the player’s source mix.
audience Offline selection: the flight’s dynamic targeting (targeting_groups) to match against the player’s locally detected audience, cart, and weather. Present only for targeted ads; see Matching audience offline.
frequency_caps Offline selection: how many times this player may show the flight per time window. Count per <Ad id>, not per creative. Absent for uncapped flights; see Enforcing frequency caps offline.

expires_at drives player behavior for every ad, source_id drives the offline source mix, and audience and frequency_caps drive offline selection for the ads that carry them; the rest are optional attribution. Ignore any JSON field or <Extension type> the player does not recognize, and skip any <Ad> whose Extension JSON is malformed (play the others). New fields and types may be added, and older players must keep working.

Some ads also carry a VAST-native <Pricing model="cpm" currency="EUR"> element. It is informational: the player does not need it to render or fire, and it may be absent. Read the price from this <Pricing> element, not from verve-metadata.

Cache creatives by their media URL and key the player’s asset cache on it. The <Creative id> attribute is the logical creative identifier, and <UniversalAdId idRegistry="verve.com"> carries the same id in the VAST-native slot that third-party verification reads.

<Expires> is the ad’s validity period in seconds, the same limit that expires_at gives as a time. On a video <MediaFile>, fileSize (bytes), bitrate (kilobits per second) and codec describe the file. Any of them can be missing.

For which events to fire on each ad and when, see Reporting exposure.


Page What it covers
Basic request The core GET /v1/ads request: parameters, modes, response envelope, status codes, and the player’s MUST / MUST NOT contract.
Demographics Refining selection online with the seg signal: IAB segment composition, per-sensor interpretation, and validation.
Products Refining selection online with the shopper’s basket via products.
Operating offline Pre-fetching, storing, and rotating a playlist offline; honoring the source mix; matching audience locally.
Caching creatives Keeping media files on the device before their slot, and what to do when one is missing.
Creative formats Rendering video, image, and HTML5 creatives, with worked VAST examples.
Reporting exposure Firing playback events to GET /v1/track, which events fire when, and offline buffering.

For full request and response schemas, see the Ad API reference. The response envelope follows the IAB VAST 4.2 standard.