MP4ERequest access
Runs in the backgroundBy MP4E Signed by mp4e

Ad slots

Billboards, posters and screens inside the picture, filled per viewer by your own ad server.

  • Sends 7 events
  • 1 action for rules and the host
  • Provides 1 variable
  • Ads drawn into surfaces in the video
  • Filled by your VAST 4 ad server
  • House creatives when no ad server is set
  • A background service with no UI of its own
Version 1.0.1

It opens in the Studio, where you place it on your video.

Preview

This plugin has no picture of its own.

About

Ad slots turns surfaces in the video — a billboard, a poster, a screen — into ad inventory that a host's ad server fills for each viewer. You declare the slots; the site that plays the video decides whether to sell them, by naming its VAST 4 ad server. Without one, every slot shows the house creative you chose, and the video plays as made.

  • What it does: one VAST request fills every slot. The linear video ad goes to the video slot; each companion image goes to the image slot with the nearest shape, letterboxed when the shape differs, never stretched.
  • Step 1: install Ad slots and list your slots (an id, image or video, the IAB size the surface matches, and its house creative).
  • Step 2: make each slot a replacement zone whose source reads the plugin's creatives with the house creative as fallback, e.g. {{mp4e:ad-slots:creatives.billboard.src || 'media://house_billboard'}}.
  • Step 3: on each slot's overlay, run Slot Visible on show (visible true) and on hide (visible false), so the plugin knows when the ad is on screen.
  • Counting: an image counts after 1 s on screen, a video after 2 s of playing; then the ad's impression trackers fire, and for video its quartiles.
  • Privacy: the viewer's country goes to the ad server; a viewer id only when the viewer has turned off both Do not track and Do not share identity.
  • For hosts: set the ad server in overrides (plugins['mp4e:ad-slots'].defaultConfig.tagUrl) and follow Ad Requested, Ad Filled, Impression, Quartile, Ad Fallback, Ad Error and View Time.

Settings

What a creator can set in the Studio, and what a host can set in its overrides.

Slots

Slots
SettingTypeDefaultWhat it does
Ad slotsslotsList-The ad inventory in this video. Each slot is a replacement zone in the video; its id is what the zone's source and its Slot Visible actions name.

Ad server

Ad server
SettingTypeDefaultWhat it does
Ad server tagtagUrlText-Set by the host, through overrides, never in the file. The VAST tag URL, with macros {country}, {slots}, {cachebuster} and {viewerId}. Empty: no ad server, house creatives.
Tag per slotslotTagsGroup of settings-Set by the host. A tag URL for one slot ({ "screen": "https://…" }), used instead of the ad server tag for that slot.
Country variablecountryVariableTextviewerCountryThe variable holding the viewer's country, sent as {country}. A change to it requests new ads.
Viewer id variableviewerIdVariableText-Set by the host. The variable holding a viewer id, sent as {viewerId} only when the viewer has turned off Do not track and Do not share identity. Trackers' [IFA] macro carries it only when the request did: the tag must contain {viewerId}. Empty: never sent.

Events and actions

Events you can react to

EventWhen it is sentData
Ad Errorplugin:mp4e:ad-slots:adErrorA request failed: no answer within 2 s, a network or HTTP error, an answer that is not VAST, or only Wrapper ads.
  • {{eventData.reason}}timeout, network, invalid or wrapper
  • {{eventData.message}}What went wrong
  • {{eventData.requestId}}The request
Ad Filledplugin:mp4e:ad-slots:adFilledA slot got a creative from the ad server.
  • {{eventData.fit}}fill, or contain when the creative's shape differs from the slot's
  • {{eventData.src}}The creative's URL
  • {{eventData.kind}}image or video
  • {{eventData.slotId}}The slot
  • {{eventData.requestId}}The request it answered
  • {{eventData.creativeId}}The creative's id in the ad server's answer
Quartileplugin:mp4e:ad-slots:quartileThe video slot's ad reached start, first quartile, midpoint, third quartile or complete on screen.
  • {{eventData.event}}start, firstQuartile, midpoint, thirdQuartile or complete
  • {{eventData.slotId}}The slot
  • {{eventData.seconds}}Seconds of this showing
  • {{eventData.requestId}}The request
  • {{eventData.creativeId}}The creative
View Timeplugin:mp4e:ad-slots:viewTimeA slot left the screen (or changed creative): how long it was shown.
  • {{eventData.filled}}Whether it was an ad server's creative
  • {{eventData.slotId}}The slot
  • {{eventData.seconds}}Seconds on screen in that showing
  • {{eventData.creativeId}}The creative ('' for the house creative)
Ad Fallbackplugin:mp4e:ad-slots:adFallbackA slot keeps its house creative.
  • {{eventData.reason}}timeout, network, invalid, empty, wrapper or noMatch
  • {{eventData.slotId}}The slot
  • {{eventData.requestId}}The request
Impressionplugin:mp4e:ad-slots:impressionA filled slot counted: on screen 1 s (image) or 2 s of playing (video). Its impression trackers fired.
  • {{eventData.kind}}image or video
  • {{eventData.sent}}The viewer context the ad server received: 'country', 'viewerId'
  • {{eventData.slotId}}The slot
  • {{eventData.seconds}}Seconds on screen when it counted
  • {{eventData.requestId}}The request
  • {{eventData.creativeId}}The creative
Ad Requestedplugin:mp4e:ad-slots:adRequestedA request went to the ad server (on load, and on every country change).
  • {{eventData.sent}}The viewer context sent: 'country', 'viewerId'
  • {{eventData.slots}}The slot ids this request fills
  • {{eventData.server}}The ad server's origin
  • {{eventData.country}}The country sent ('' when none)
  • {{eventData.requestId}}Counts up from 1 for this viewing

Actions a rule or the host can call

ActionWhat it doesIts settings
Slot VisibleslotVisibleTell Ad slots a slot's overlay was shown (visible true) or hidden (visible false). Run it from the slot overlay's On Show and On Hide.
  • slotIdText
  • visibleOn or off

Variables it provides

VariableWhat it holdsType and default
Ad creatives{{mp4e:ad-slots:creatives}}The filled slots: { slotId: { src, fit, kind, creativeId, durationSeconds? } }. A slot that is not filled is absent. Written by Ad slots only.jsonRead only

What it can reach

  • Can contact: mp4e.com, api.mp4e.comAdwave, the demo ad server: its VAST answers (mp4e.com) and tracking pixels (api.mp4e.com). A host's own ad server goes through the host's network rules.

Versions

  1. v1.0.1November 28, 2026Current
    What changed

    1.0.1: variables say readOnly instead of the older editable flag. 1.0.0: First release: a VAST 4 client for in-video ad slots — one request per tag on load and on every country change, linear to the video slot and companions by nearest aspect ratio (contain when it differs), 2 s timeout to house creatives, viewability (image 1 s, video 2 s) with Impression, creativeView and quartile trackers, and a viewer id only with the viewer's consent.

  2. v1.0.0October 18, 2026
    What changed

    First release: a VAST 4 client for in-video ad slots — one request per tag on load and on every country change, linear to the video slot and companions by nearest aspect ratio (contain when it differs), 2 s timeout to house creatives, viewability (image 1 s, video 2 s) with Impression, creativeView and quartile trackers, and a viewer id only with the viewer's consent.

Ad slots · MP4E Marketplace