The VAST protocol
An introduction to the IAB VAST protocol
VAST (Video Ad Serving Template) is a widely adopted XML-based protocol developed by the Interactive Avertising Bureau (IAB) to standardize the delivery and tracking of video ads across different platforms and devices. VAST allows video players (and/or platforms such as server-side ad insertion engines) to communicate with ad servers and receive information about which ads to display, along with instructions on how to handle them.
The primary objective of VAST is to simplify the integration process between publishers and advertisers by providing a common language for ad delivery.
VAST Structure
At its core, a VAST response is a structured XML document, that includes both mandatory and optional elements that define the ad content, its delivery, and tracking mechanisms.
Here’s an example of a simplified VAST response:
<VAST version="4.0">
<Ad id="12345">
<InLine>
<AdSystem version="4.0">ExampleAdSystem</AdSystem>
<AdTitle>Sample Video Ad</AdTitle>
<Impression>
http://example.com/impression
</Impression>
<Creatives>
<Creative AdID="abc123">
<Linear>
<Duration>00:00:30</Duration>
<MediaFiles>
<MediaFile delivery="progressive" type="video/mp4" width="640" height="360">
<![CDATA[http://example.com/creative.mp4]]>
</MediaFile>
<MediaFile delivery="streaming" type="application/vnd.apple.mpegurl" width="640" height="360">
<![CDATA[http://example.com/creative.m3u8]]>
</MediaFile>
</MediaFiles>
</Linear>
<NonLinearAds>
<NonLinear width="300" height="50">
<StaticResource creativeType="image/png">
<![CDATA[http://example.com/overlay.png]]>
</StaticResource>
</NonLinear>
</NonLinearAds>
</Creative>
</Creatives>
</InLine>
</Ad>
</VAST>
VAST (Video Ad Serving Template) is designed to be flexible enough to accommodate various types of video ads. To understand its structure more thoroughly, it’s important to know its building blocks:
Inline Ads
An InLine ad refers to the simplest type of VAST ad where the full ad content (creative, media files, and tracking URLs) is directly included in the VAST response. The video player or platforms handles the inline ads directly without needing to make further requests to external ad servers. This differentiates them from Wrapper Ads (described later in this page)
Creatives
The Creatives element contains the actual ads that can be presented to the viewer. It can hold one or multiple Creative elements, each describing a different type of ad (such as video ads, companion banners, etc.). The two most common types of creatives are Linear and Non-linear.
Linear Creatives
A Linear creative refers to ads that interrupt content (pre-roll, mid-roll, post-roll ads) and play as a standalone video. The main elements that you'll find associated with a linear creative are usually:
- A Duration that specifies the length of the video ad.
- MediaFiles: Contains one or more MediaFile elements that specify the actual video files to be played. Different media files can be provided to support various formats, resolutions, or bitrates, which are specified through the attributes
- delivery: Can be “progressive” (direct file link for a downloadable file) or “streaming” (for adaptive bitrate formats).
- type: MIME type (e.g.,
video/mp4
,application/dash+xml
for DASH,application/vnd.apple.mpegurl
for HLS). - width/height/bitrate
Non-Linear Creatives
A Non-linear creative is an ad that typically overlays or comes alongside the video content without interrupting it. It could be an image or text-based ad, often seen as an overlay during content playback.
CDATA
Notice how some elements in the example contain a
CDATA
. This is a standard way in an XML document to mark sections where the content is to be interpreted literally, without being parsed as XML. It is particularly useful to include special characters such as&
,<
and>
which are reserved in the XML syntax.The first one (ampersand) is pretty common in URLs, and this explains why most URLs will be wrapped in a CDATA section.
CDATA sections are not compulsory, but they make life easier and the document more readable.
Ad Pods
Ad Pods were introduced in VAST 3.0 as a way to deliver multiple ads in a single ad break, similar to traditional TV-style ad breaks. Instead of delivering a single video ad, an ad pod allows the video consumer to display a series of ads back-to-back within the same ad break. Each ad within the pod can have its own VAST response, including different creatives, tracking events, and durations.
The sequence
attribute in the <Ad>
element is used to define the order in which the ads should be played.
<VAST version="4.0">
<!-- First Ad in Pod -->
<Ad id="1" sequence="1">
<InLine>
<AdSystem version="4.0">ExampleAdSystem</AdSystem>
<AdTitle>First Ad in Pod</AdTitle>
<Impression>
<![CDATA[http://example.com/impression1]]>
</Impression>
<Creatives>
<Creative AdID="ad1">
<Linear>
<Duration>00:00:15</Duration>
<!-- ... MediaFiles and TrackingEvents --->
</Linear>
</Creative>
</Creatives>
</InLine>
</Ad>
<!-- Second Ad in Pod -->
<Ad id="2" sequence="2">
<InLine>
<AdSystem version="4.0">ExampleAdSystem</AdSystem>
<AdTitle>Second Ad in Pod</AdTitle>
<Impression>
<![CDATA[http://example.com/impression2]]>
</Impression>
<Creatives>
<Creative AdID="ad2">
<Linear>
<!-- ... MediaFiles and TrackingEvents --->
</Linear>
</Creative>
</Creatives>
</InLine>
</Ad>
<!-- Third Ad in Pod -->
<Ad id="3" sequence="3">
<InLine>
<AdSystem version="4.0">ExampleAdSystem</AdSystem>
<AdTitle>Third Ad in Pod</AdTitle>
<Impression>
<![CDATA[http://example.com/impression3]]>
</Impression>
<Creatives>
<Creative AdID="ad3">
<!-- ... MediaFiles and TrackingEvents --->
</Creative>
</Creatives>
</InLine>
</Ad>
</VAST>
If the VAST response contains Ads without a sequence number, those are considered to be part of an Ad Buffet, from which a video consumer application can freely select one or multiple ads to show, in any order.
Identifiers
In the VAST ecosystem, Ad IDs and Creative IDs are critical identifiers that help track and manage video ads and their components. These IDs ensure that both publishers and advertisers can keep a precise record of which ads are being served, monitored, and interacted with across different platforms and campaigns.
- The Ad ID (short for Advertisement Identifier) is a unique identifier assigned to each ad within a VAST response. It appears as an
id
attribute on the<Ad>
element. - A Creative ID (or Ad Creative ID) is a unique identifier assigned to a specific creative within the ad. An ad can contain multiple creatives—such as video ads, companion ads (e.g., banners), or non-linear ads (e.g., overlays)—and each creative will have its own Creative ID. It appears as an
id
attribute on the<Creative>
element. It is often accompanied by anAdID
attribute that is normally (but not always) used to indicate the registry, ie. the entity of system responsible for generating the identifier - As of version 4 of VAST, a new Universal Ad ID element
<UniversalAdId>
has been introduced that optionally enables a standardized method for tracking and identifying ads across various platforms and systems. For example: -
<Creative sequence="1" AdID="abc123"> <UniversalAdId idRegistry="Ad-ID" idValue="12345678"> <![CDATA[12345678]]> </UniversalAdId> <Linear> <!-- MediaFile and TrackingEvents ... --> </Linear> </Creative>
Impressions and Trackers
Tracking is one of the most essential components of VAST, as it enables advertisers to gather analytics on ad performance. Tracking URLs (often referred to as trackers) are embedded within the VAST document and triggered at different points during the ad’s lifecycle. These are typically HTTP URLs that are “pinged” to register specific events.
There are different types of linear ad tracking are enabled by VAST.
- Impressions: These URLs are triggered when an ad is successfully delivered to the consumer (typically a player). In client-side ad insertion scenarios, it is typically a confirmation that the ad has been displayed.
- Progress Events: They are used for tracking when specific parts of the ad are viewed. This applies in particular to playback progress for linear video ads: start, first quartile, midpoint, third quartile, and complete.
- Interaction Events: They monitor other particular user interactions with the linear video ads, such as muting, pausing, resuming, and switching to fullscreen.
- Error Events: Those allow the video consumer to indicate to the ad server when an issue arises in delivering or displaying an ad to the viewer.
Impressions apply to the whole ad (regardless of the number and types of creatives that they contain) and are contained in one or more <Impression>
tags.
All others are contained in <Tracking>
elements within each relevant <Creative>
elements.
The following example shows trackers in action
<VAST version="4.0">
<Ad id="12345">
<InLine>
<AdSystem version="4.0">ExampleAdSystem</AdSystem>
<AdTitle>Sample Video Ad</AdTitle>
<!-- Impression Tracking -->
<Impression>
<![CDATA[http://example.com/impression]]>
</Impression>
<!-- Tracking Events for Linear Ad -->
<Creatives>
<Creative sequence="1" AdID="abc123">
<Linear>
<Duration>00:00:30</Duration>
<!-- Tracking Events -->
<TrackingEvents>
<Tracking event="start"><![CDATA[http://example.com/start]]></Tracking>
<Tracking event="firstQuartile"><![CDATA[http://example.com/firstQuartile]]></Tracking>
<Tracking event="midpoint"><![CDATA[http://example.com/midpoint]]></Tracking>
<Tracking event="thirdQuartile"><![CDATA[http://example.com/thirdQuartile]]></Tracking>
<Tracking event="complete"><![CDATA[http://example.com/complete]]></Tracking>
<Tracking event="mute"><![CDATA[http://example.com/mute]]></Tracking>
<Tracking event="unmute"><![CDATA[http://example.com/unmute]]></Tracking>
<Tracking event="pause"><![CDATA[http://example.com/pause]]></Tracking>
<Tracking event="resume"><![CDATA[http://example.com/resume]]></Tracking>
<Tracking event="fullscreen"><![CDATA[http://example.com/fullscreen]]></Tracking>
<Tracking event="skip"><![CDATA[http://example.com/skip]]></Tracking>
</TrackingEvents>
<!-- Media Files -->
<MediaFiles>
<MediaFile delivery="progressive" type="video/mp4" width="640" height="360">
<![CDATA[http://example.com/creative.mp4]]>
</MediaFile>
<MediaFile delivery="streaming" type="application/vnd.apple.mpegurl" width="640" height="360">
<![CDATA[http://example.com/creative.m3u8]]>
</MediaFile>
</MediaFiles>
</Linear>
<!-- Non-Linear Ads (e.g., Overlay Ads) -->
<NonLinearAds>
<NonLinear width="300" height="50">
<StaticResource creativeType="image/png">
<![CDATA[http://example.com/overlay.png]]>
</StaticResource>
<!-- Tracking for Non-linear Ad -->
<TrackingEvents>
<Tracking event="creativeView"><![CDATA[http://example.com/creativeView]]></Tracking>
</TrackingEvents>
</NonLinear>
</NonLinearAds>
</Creative>
</Creatives>
</InLine>
</Ad>
</VAST>
VAST Wrappers
A VAST Wrapper is a mechanism to refer one VAST document from another. The VAST Wrapper does not contain the actual ad creative but references another VAST document via a URL. Wrappers are often used in programmatic advertising, where an ad might be served by a third-party ad server, which could also have its own tracking requirements.
<VAST version="4.0">
<Ad id="wrapper123">
<Wrapper>
<VASTAdTagURI><![CDATA[http://thirdparty.com/vast.xml]]></VASTAdTagURI>
<Impression><![CDATA[http://example.com/impression]]></Impression>
<TrackingEvents>
<Tracking event="start">
<![CDATA[http://example.com/start]]>
</Tracking>
</TrackingEvents>
</Wrapper>
</Ad>
</VAST>
In this case,
- VASTAdTagURI points to another VAST document.
- Additional Impression and Tracking events are added in the wrapper to be registered alongside the final VAST ad.
One of the key advantages of VAST Wrappers is that multiple tracking URLs can be added at various stages, enabling both the original publisher and third-party networks to track the same ad events. Wrappers can also refer to other wrappers, adding more flexibility. However, they need to be used sparingly, as long chains of wrappers can introduce significant delays in ad loading, leading to poor user experience.
Extensions
The VAST protocol enables additional metadata to be added in various places within the VAST document, for the purpose of surfacing custom information. This may happen at the level of the the Ads, or the Creatives.
Namespace
Although it's an XML document, a VAST document rarely, if ever, uses a namespace of its own.
Extensions however should use their own namespace to avoid conflict with the VAST document.
Protocol Versions
VAST is an evolving standard, and several versions have been released since its inception in 2008. Although they differ in a number of places, the base structure remains the same.
- VAST 1.0 (2008): Introduced basic linear ad delivery and impression tracking.
- VAST 2.0 (2012): Added support for non-linear ads, companion ads, and VAST wrappers, along with more detailed tracking.
- VAST 3.0 (2012): Introduced skippable ads, ad pods, and improved error tracking.
- VAST 4.0 (2016): Constituted a major overhaul with new functionality such as the UniversalAdId, ad verification, enhanced SSAI support, and mezzanine files.
- VAST 4.1 (2018), 4.2 (2019) and 4.3 (20220: Added a few minor refinements to improve implementation and support for interactive and server-side ads.
The most common in the streaming industry are VAST 3 and 4.
References
The information above is a very quick introduction to VAST.
For more, the best source of information is the spec itself:
Updated 3 months ago