Skip to content

Operating offline

Offline mode lets a device keep playing when it loses connectivity. The player pre-fetches a full eligible playlist while online, stores it with its creatives, and rotates locally, buffering every playback event to drain on reconnect.

A stored file also serves an online ad that uses the same media URL. See Caching creatives.

Ahead of any outage, request the playlist with offline=true and download each ad’s creative bytes:

GET /v1/ads?playerid=screen-7&key=retailer-acme&limit=20&offline=true
→ 200 OK with the playlist (no dvactid).

An offline ad plays only if its file is on the device. Download each <MediaFile> at pre-fetch time, not at slot time. Run the pre-fetch on first boot and on a schedule; we recommend every 12 hours. Start playing as soon as the first file is downloaded.

For the caching rules, including a file that is missing at slot time, see Caching creatives.

Every ad in an offline playlist is already eligible for this player. A fixed screen gets only the ads for its own place. A moving player gets the ads for every place in its store and matches the place itself. Offline, the player drops expired ads, matches audience locally, and honors the source mix.

A playlist can hold more than one ad from the same advertiser: one flight with several approved creatives contributes one <Ad> per creative, each with its own <AdServingId>, its own <Creative id>, its own media file and its own tracking URLs. They share a flight_id in verve-metadata and an <Ad id>, and differ in creative.

Two consequences for the player:

  • Group by <Ad id> to avoid repeating an advertiser. Rotating blindly over the stored set can play two creatives of one ad back to back. If the player wants variety of advertiser rather than variety of creative, rotate ads first and creatives within an ad second.
  • Count frequency caps per <Ad id>, never per creative. A cap is the flight’s, and every ad from that flight carries the same audience block and the same frequency_caps. Counting plays per creative would let a three-creative flight run three times its cap. See Enforcing frequency caps offline.

At slot time: drop ads past expires_at, then rotate the rest, honoring the player’s source mix, for example by picking one at random. If every stored ad has expired and the player cannot refresh, see When the player cannot refresh.

Online, we keep the source mix. Offline, the player keeps it. Over the offline window, keep each source’s plays near its target share.

Honoring the source mix offline. The player already holds the per-source percentages; they are the player’s deployment’s configuration. Each ad names its source in source_id. Group the eligible ads by source_id. Rotate them so each source’s plays approach its share over the offline window. If a source has no eligible ads it can’t take its share, so renormalize its portion across the sources the player does have.

Some stored ads carry an audience block in their verve-metadata. Play an ad when its audience matches the player’s current context (detected shoppers, cart contents, weather and, on a moving player, its position). An ad with no audience block targets everyone, so it is always eligible.

The block is a list of targeting_groups. An ad matches when any one group matches (groups are OR’d), and a group matches when all of its conditions match (conditions are AND’d). Each condition is one of:

Condition Matches when
demographic Detected shoppers fit any listed profiles entry: its gender and age_range, and their number fits its group_size. group_size is an object, {"operator": ..., "value": 3}, not a bare number.
device Every key it carries matches. basket: the shopper’s basket contains every listed skus and items value, so a skus of A and B needs both. placement: see Matching the place.
store The current weather is one of the listed weather_types.

Play the ads whose audience matches the current context, then apply the source-mix rotation to that matching set.

Enum values arrive as their platform string names. The verve-metadata schema lists the known values of each field.

gender and age_range follow IAB Audience Taxonomy 1.1. An absent field matches any value. Treat a value you don’t recognise as not matching rather than discarding the ad: these sets grow.

The same gender / age_range values here are the IAB-normalized result of whatever the device reported; see Demographics for how the online seg parameter carries the equivalent live signal.

A player with the SENSOR_LOCATION sensor gets a placement list on each ad that targets a place, online and offline. Online, the list already matches the position the player sent. Each entry uses the same names and values as the position parameters.

The condition matches when the player’s current position matches any one entry. An entry matches when every field it carries matches:

Field Matches when
venue It is the player’s venue, or VENUE_RETAIL_UNSPECIFIED, which covers any retail venue.
retail_grocery_zone, retail_mall_zone The player is in that zone.
aisles The player is at one of the listed aisles.

The player’s venue follows from its position, as in How they combine: a grocery zone or an aisle means VENUE_RETAIL_GROCERY, a mall zone means VENUE_RETAIL_MALL. If the player does not know its position, no entry matches.

A frequency cap limits how many times one player may show a flight within a time window. Online, we enforce the cap. Offline, the player enforces it.

Offline ads of a capped flight carry a frequency_caps array in their verve-metadata, a sibling of audience:

"frequency_caps": [
{ "window": "FREQUENCY_CAP_WINDOW_HOUR", "limit": 2 },
{ "window": "FREQUENCY_CAP_WINDOW_DAY", "limit": 20 }
]
Field Meaning
window The limit’s period: FREQUENCY_CAP_WINDOW_MINUTE (last 60 seconds), _THIRTY_MINUTES (last 30 minutes), _HOUR (last 60 minutes), _DAY (current UTC calendar day), _WEEK (current ISO week in UTC, from Monday), or _FLIGHT (whole flight).
limit The maximum number of plays allowed per player within that window.

Rules for the player:

  • Every entry applies at once. Two entries mean both hold simultaneously (2 per hour and 20 per day). An ad is eligible only while it is under all of its limits.
  • The minute, half hour and hour roll; the day and week reset. For _MINUTE, _THIRTY_MINUTES and _HOUR, count the plays in the 60 seconds, 30 minutes or 60 minutes before now: a play stops counting once it is that old, not at the top of the hour. For _DAY and _WEEK, count the plays since midnight UTC, or since Monday midnight UTC. _FLIGHT never resets.
  • Count per <Ad id>, never per creative. The cap is the flight’s, and every creative from that flight carries the same <Ad id> and frequency_caps. Counting per creative would let a three-creative flight run three times its cap.
  • The player owns the count. The response carries the limit, never a count. The player counts its own plays and stops matching the flight once a window’s limit is reached.
  • No frequency_caps key means no cap for the player to enforce. The key is absent for uncapped flights.

Reported plays still flow normally: the caps change what the player chooses, not what it fires. See Reporting exposure.

  • Clock drift. Replay each stamped URL verbatim, with its sts. The player does nothing else about drift, and we keep its raw ets.
  • Late events are accepted. We accept a fire that arrives after its campaign’s billing window has closed.
  • Reconnect stampede. When a whole site reconnects at once, thousands of buffered fires per screen arrive together. Drain them in bulk with POST /v1/track:batch, up to 250 fires per request. Add a short random delay before the first batch.
  • Bounded buffer. Hold roughly the offline-playlist window of events and drop oldest-first on overflow, so a long-offline device degrades to best-effort rather than unbounded growth.
  • Retrying a batch is safe. Resend a failed or unanswered drain whole. We count each fire once, however many times it arrives, so the player does not need to track which entries landed.

For how to buffer and drain the fires themselves, see Reporting exposure.