Contents
1. What is VAST
VAST(Video Ad Serving Template) — IAB standard for passing video ad metadata from ad server to player. Version 4.0 is current.
Works like this:
- Before the main content video the player fetches the VAST URL
- Receives XML with ad description: where the mp4 is hosted, duration, how many seconds until skip is allowed, where to send on click
- Plays an ad (pre-roll)
- Sends an impression-tracking pixel to confirm the view was counted
- Includes main video
Advantage over our JS widget:works in your existing player. No need to change anything in the UI.
2. Where to get a VAST URL
VAST format availableonly for blocks of formatvideo(in-stream 16:9). On the widget page/pub/zones/{id}you will see a pink banner "🎬 VAST URL - for your video player":
https://sladu.net/vast/{subid}.xml
Example:https://sladu.net/vast/tvid9234f7.xml
3. VAST Response Structure
<?xml version="1.0" encoding="UTF-8"?>
<VAST version="4.0" xmlns="http://www.iab.com/VAST">
<Ad id="impression-uuid-here">
<InLine>
<AdSystem version="1.0">Sladu Network</AdSystem>
<AdTitle><![CDATA[Заголовок креатива]]></AdTitle>
<Impression><![CDATA[https://sladu.net/openrtb/imptracker/impression-uuid]]></Impression>
<Creatives>
<Creative id="creative-id" sequence="1">
<Linear skipoffset="00:00:05">
<Duration>00:00:30</Duration>
<MediaFiles>
<MediaFile delivery="progressive" type="video/mp4" width="640" height="360">
<![CDATA[https://cdn.advertiser.com/video.mp4]]>
</MediaFile>
</MediaFiles>
<VideoClicks>
<ClickThrough><![CDATA[https://sladu.net/c/impression-uuid/tracking-token]]></ClickThrough>
</VideoClicks>
</Linear>
</Creative>
</Creatives>
</InLine>
</Ad>
</VAST>
4. VAST fields
- creative title- impression pixel URL. The player fires it when the ad is actually shown.— MP4 video URL, dimensions (always 16:9), MIME type- video duration in HH:MM:SS formatskipoffset="00:00:05"- after 5 sec you can show the Skip button- URL to send the user to on click. Already contains our redirect to the advertiser + click tracking.
5. Empty VAST (no_match)
If no suitable creative is found (no active campaigns for your geo, anti-fraud filter) — we return a valid empty VAST:
<?xml version="1.0" encoding="UTF-8"?> <VAST version="4.0"></VAST>
The player should treat this as "no ad" and immediately start the main content. All normal players do this.
6. JW Player 8+
jwplayer("player").setup({
file: "your-content.mp4",
advertising: {
client: "vast",
tag: "https://sladu.net/vast/abc12345.xml"
}
});
For midroll / postroll:
advertising: {
client: "vast",
schedule: {
preroll: { offset: "pre", tag: "https://sladu.net/vast/abc12345.xml" },
mid: { offset: "50%", tag: "https://sladu.net/vast/abc12345.xml" },
postroll:{ offset: "post", tag: "https://sladu.net/vast/abc12345.xml" }
}
}
7. video.js + videojs-ima
8. Google IMA SDK (universal)
9. HLS.js + Google IMA
HLS.js has no built-in VAST support. Use a combination of HLS.js (for content) + IMA SDK (for ads):
if (Hls.isSupported()) {
const hls = new Hls();
hls.loadSource('your-stream.m3u8');
hls.attachMedia(videoElement);
}
// VAST через IMA SDK как в примере выше
const adsRequest = new google.ima.AdsRequest();
adsRequest.adTagUrl = "https://sladu.net/vast/abc12345.xml";
adsLoader.requestAds(adsRequest);
10. Plyr / Flowplayer / Bitmovin / Brightcove
- Plyr- no built-in VAST, you needplyr-adsplugin with Google IMA support
- Flowplayer- VAST is supported out of the box in the Commercial version, plugin
flowplayer-ima - Bitmovin Player- built-in AdsModule, config:
{ ads: [{ tag: { url: "https://sladu.net/vast/...", type: "vast" }, position: "pre" }] } - Brightcove- via plugin
bc-vast-ads-plugin - Shaka Player -
shaka-player-imaadds Google IMA
11. Testing
Just open the VAST URL in your browser
Should show XML. If empty () - means there is no suitable creative for your geo.
Google IMA Sample Player
googleads.github.io/googleads-ima-html5/vsi— paste a VAST URL, hit Play — see how IMA SDK processes our VAST.
IAB VAST Inspector
vasttester.iabtechlab.com- official IAB inspector. Validates XML against the specification.
curl
curl -v "https://sladu.net/vast/abc12345.xml" \
-H "Referer: https://yoursite.com/page" \
-H "User-Agent: Mozilla/5.0 (X11; Linux) Chrome/120"
12. Event tracking
Currently in the VAST response we send a minimal set of trackers:
- impression counted- URL with our click tracking
We can add upon requestfor:
start— video started playingfirstQuartile,midpoint,thirdQuartile- 25/50/75% viewedcomplete- video watched to the endskip- user clicked skipmute,unmute,pause,resume,fullscreen
By default they are not required for billing — we count the impression itself. If the advertiser pays CPV (cost per view, 100% completion) — enable via a support ticket.
Integration not working?Open the VAST URL in your browser — it should return XML. If empty — no creatives for the geo. If error — contact@sladu_support with a sample URL and player.