Ad Offer Plugin
mp4e:ad-offer lets a viewer order, take an offer or be reminded later from inside a video ad, without leaving the video.
Overview
Ad offer (mp4e:ad-offer, an official plugin) turns a video ad into one the viewer can answer. It is drawn over a shoppable ad by Linear ads, above the Ad controls, with the offer the ad's VAST carries. The ad brings data; the code is this signed, official plugin.
What the viewer sees
- During the ad, from a few seconds in: a slim bar in the right third — the product, Order, the offer and Remind me. A tap pauses the ad and opens the card; Back to the ad plays it again.
- When the ad ends it holds on its last frame and the card opens by itself: the product and price, the answers, and Continue to video with the seconds left (“Continue to video · 0:24”); the video comes back by itself at zero. The first time the viewer taps or presses a key on the bar or the card, the countdown goes: from then on nothing returns the video except the viewer's Continue (or your page ending the break).
- Order: pick a colour from one row of round dots (the chosen name sits beside the heading, “Colour · Midnight”), enter an email, Place order. Once the site allows it, the order goes to the advertiser and the card shows the order number.
- The offer: an email, then the code on the card.
- Remind me: the card confirms that the ad comes back at the end of the video, and the viewer returns to the video after about two seconds, or at once with Continue to video. After an order or the offer the same button returns to the video.
- Only the bar and the card take clicks; the Ad controls under them keep working.
Making an ad shoppable
In the ad server, put the offer in the Linear's <AdParameters> as JSON naming the shoppable template. Endpoints may be relative to the VAST address. Any other AdParameters leave the ad an ordinary one.
<Linear skipoffset="00:00:05">
<Duration>00:00:15</Duration>
<AdParameters xmlEncoded="false"><![CDATA[{
"mp4e": 1,
"template": "shoppable",
"offer": {
"product": { "id": "lumen-aria", "name": "Lumen Aria", "price": 129, "currency": "USD" },
"variants": [
{ "id": "midnight", "label": "Midnight", "swatch": "#1d2230" },
{ "id": "sand", "label": "Sand", "swatch": "#d8c7a8" },
{ "id": "sage", "label": "Sage", "swatch": "#9caf88" }
],
"order": { "endpoint": "https://ads.example.com/order", "label": "Order" },
"subscribe": { "endpoint": "https://ads.example.com/subscribe", "formId": "aria10", "label": "10% off" },
"remind": { "label": "Remind me" },
"appearAt": 4
}
}]]></AdParameters>
<!-- TrackingEvents, MediaFiles … as in any VAST 4 Linear -->
</Linear>Settings
Linear ads fills them from the ad's offer; a site naming Ad offer in its own break's template sets them in that entry's config.
| Prop | Type | Default | Description |
|---|---|---|---|
product | { id, name, price, currency, image? } | {} | What the ad sells. id: letters, digits, - and _ (up to 64). price: a number. currency: three letters, e.g. USD. image: an https address. |
variants | { id, label, swatch }[] | [] | Up to six colours or options to order. swatch is a #rrggbb colour. |
order | { endpoint, label?, successText? } | {} | Where Place order sends { productId, variant, email }, the button label (Order), and the text shown after, with {orderId} (Order {orderId} placed). Without an endpoint, a product id, price, currency and one variant there is no Order. |
subscribe | { endpoint, formId, label?, successText? } | {} | An email offer: where { formId, email } goes, its label (Get the offer) and the text shown after, with {code} (Your code: {code}). Without endpoint and formId there is no offer. |
remind | { label?, successText? } | false | false | Remind me. With Linear ads the ad comes back at the end of the video, opening on its card; the viewer is returned to the video after about two seconds. |
appearAt | number | 4 | Seconds into the ad when the offer bar appears. |
theme, accent, size, … | family settings | theme 'studio' | The plugin family's look settings. |
With a remote
- With
remoteNavigation: 'on', the card on the ad's last frame takes focus by itself. Up or Down reach the offer during the ad. - An email field is a stop like any control. The on-screen keyboard opens when the viewer presses OK.
- On the last frame, Back steps out of a form and then is Continue to video. Play does not start the finished ad again.
- Over a playing ad the card keeps the arrows, and Back gives the ad back.
What the site does
- Install Ad offer with Linear ads and Ad controls (in the video, or through overrides with each plugin's published signature — ads run only MP4E-signed plugins unless the site allows otherwise).
- Answer the network gate: Ad offer names no domains, so every order and offer goes to
onNetworkGatefirst, marked with the break it comes from. Ask the viewer, or allow the advertisers you work with. - Receive the answers as outcomes — with your own attribution, never the viewer's email.
<MP4EPlayer
src="/video.mp4"
config={{
interstitials: { allowPlugins: ['mp4e:linear-ads'] },
networkGateTimeoutMs: 60000, // time for the viewer to answer your question
}}
onNetworkGate={(request, respond) => {
// From inside an ad break, request.interstitial = { breakId, advertiser, placement }.
// request.pluginId names the plugin's frame, not the plugin: decide on the break and the URL.
if (request.interstitial && request.method === 'POST' && isTheAdvertisersOrderEndpoint(request.url)) {
askTheViewer(`Send your order to ${request.interstitial.advertiser ?? 'the advertiser'}?`).then(respond);
return;
}
respond(isMyAdServer(request.url));
}}
/>Outcomes
Each answer reaches the site and rules as interstitial:outcome (see Ads in Video), and Linear ads repeats it as adOutcome:
| Prop | Type | Default | Description |
|---|---|---|---|
orderPlaced | { orderId, value, currency, productId, variant } | - | The advertiser's endpoint answered an order with its orderId. |
formSubmitted | { formId } | - | The advertiser's endpoint answered the email offer. |
remindLater | {} | - | The viewer asked to be reminded. |