Advertising Guides & Insights

VAST XML Examples & Fundamentals: Events, Video Clicks, and Media Files

Explore the anatomy of a VAST tag, learn how event tracking and Video clicks work, and see how media files differ across web, mobile apps, and CTV with real VAST XML examples.

VASTVAST XMLVideoClicksMedia FilesEvent TrackingAdvertising Guides
Read more articles
VAST XML
By Ad Me In
July 26, 2025

A practical guide to VAST XML structure, event tracking, click handling, and media file best practices for web, mobile, and CTV.

VAST XML Examples & Fundamentals: Events, Video Clicks, and Media Files

VAST XML Fundamentals

A VAST (Video Ad Serving Template) tag is an XML document that provides a standardized way for ad servers to communicate with video players about how to display video ads, track user interactions, and report events. VAST is widely used in digital video advertising to ensure compatibility between ad creatives and video players.

VAST Structure

A VAST XML document is structured hierarchically:

  • The root <VAST> element contains one or more <Ad> elements.
  • Each <Ad> can be either <InLine> (the ad is fully described in the tag) or <Wrapper> (the tag points to another VAST tag).
  • Inside <InLine>, you’ll find metadata and creative details, such as <AdSystem>, <AdTitle>, <Impression>, and <Creatives>.

VAST Versions

VAST has evolved over time, with each version adding new features and improving compatibility:

  • VAST 2.0 introduced support for multiple creatives and tracking events.
  • VAST 3.0 added error reporting and better support for wrappers.
  • VAST 4.x (including 4.2) improved support for server-side ad insertion, verification, and mezzanine files for high-quality video. Most modern players support VAST 3.0 and above, but always check compatibility with your player.

InLine vs. Linear

  • InLine: The ad’s full details (media files, tracking, etc.) are included directly in the VAST tag. This is the most common format for direct ad serving.
  • Wrapper: The VAST tag points to another VAST tag, allowing for ad chaining, third-party tracking, or fallback logic.
  • Linear: Refers to video ads that play in sequence with content (pre-roll, mid-roll, post-roll). In VAST, <Linear> is a creative type indicating the ad is a video (as opposed to non-linear overlays or companions).

Key Elements

  • Ad ID (<Ad id="...">): A unique identifier for the ad, used for reporting and tracking across systems.
  • AdSystem (<AdSystem>): Identifies the ad server or technology platform serving the ad. This helps with analytics and troubleshooting.
  • AdTitle (<AdTitle>): A human-readable title for the ad, useful for reporting and debugging.
  • Impression (<Impression>): A URL that is "pinged" (requested) when the ad starts playing, indicating that the impression has been served. This is a key metric for advertisers. Here’s a basic VAST 4.2 example:
<VAST version="4.2"> <Ad id="12345"> <InLine> <AdSystem>ExampleAdServer</AdSystem> <AdTitle>Sample Video Ad</AdTitle> <Impression><![CDATA[[https://example.com/impression](https://example.com/impression)]]></Impression> <Creatives> <Creative> <Linear> <Duration>00:00:30</Duration> <MediaFiles> <MediaFile delivery="progressive" type="video/mp4" width="1280" height="720"> <![CDATA[[https://cdn.example.com/ad.mp4](https://cdn.example.com/ad.mp4)]]> </MediaFile> </MediaFiles> <VideoClicks> <ClickThrough><![CDATA[[https://example.com/landing-page](https://example.com/landing-page)]]></ClickThrough> <ClickTracking><![CDATA[[https://example.com/clicktrack](https://example.com/clicktrack)]]></ClickTracking> </VideoClicks> <TrackingEvents> <Tracking event="start"><![CDATA[[https://example.com/start](https://example.com/start)]]></Tracking> <Tracking event="firstQuartile"><![CDATA[[https://example.com/firstQuartile](https://example.com/firstQuartile)]]></Tracking> <Tracking event="midpoint"><![CDATA[[https://example.com/midpoint](https://example.com/midpoint)]]></Tracking> <Tracking event="thirdQuartile"><![CDATA[[https://example.com/thirdQuartile](https://example.com/thirdQuartile)]]></Tracking> <Tracking event="complete"><![CDATA[[https://example.com/complete](https://example.com/complete)]]></Tracking> </TrackingEvents> </Linear> </Creative> </Creatives> </InLine> </Ad> </VAST>

Key Elements Explained

  • Impression: Fires when the ad starts.
  • TrackingEvents: URLs for ad progress (start, quartiles, complete).
  • VideoClicks: Handles user clicks (ClickThrough for landing page, ClickTracking for analytics).
  • MediaFiles: The actual video ad files.

VAST Event Tracking

VAST tracks user engagement and ad playback using event URLs. Common events include:

  • start: Ad begins.
  • firstQuartile, midpoint, thirdQuartile: 25%, 50%, 75% progress.
  • complete: Ad finishes.
  • mute, pause, resume, fullscreen: Player actions. Each event has a corresponding <Tracking> URL. The player pings these URLs as the ad plays.

VideoClicks & Click Tracking

<VideoClicks> contains:

  • <ClickThrough>: Main landing page for the ad.
  • <ClickTracking>: Fires when the user clicks the ad (for analytics). Example:
<VideoClicks> <ClickThrough><![CDATA[[https://example.com/landing-page](https://example.com/landing-page)]]></ClickThrough> <ClickTracking><![CDATA[[https://example.com/clicktrack](https://example.com/clicktrack)]]></ClickTracking> </VideoClicks>

Media Files: Web, Mobile, and CTV

Media files must match the playback environment:

  • Web: Use MP4 (H.264), WebM. Progressive or streaming delivery.
  • Mobile Apps: MP4 preferred. Consider bitrate and resolution for mobile screens.
  • CTV (Connected TV): High bitrate MP4, larger resolutions (1920x1080+), streaming protocols (HLS, DASH). Example for multiple environments:
<MediaFiles> <MediaFile delivery="progressive" type="video/mp4" width="1280" height="720"> <![CDATA[[https://cdn.example.com/web-ad.mp4](https://cdn.example.com/web-ad.mp4)]]> </MediaFile> <MediaFile delivery="progressive" type="video/mp4" width="640" height="360"> <![CDATA[[https://cdn.example.com/mobile-ad.mp4](https://cdn.example.com/mobile-ad.mp4)]]> </MediaFile> <MediaFile delivery="streaming" type="application/vnd.apple.mpegurl" width="1920" height="1080"> <![CDATA[[https://cdn.example.com/ctv-ad.m3u8](https://cdn.example.com/ctv-ad.m3u8)]]> </MediaFile> </MediaFiles>

Tip: Try to provide multiple media files for best compatibility. The publisher video player will pick the best one for the device.

Summary

  • VAST XML defines how video ads are served, tracked, and interacted with.
  • Event tracking and click tracking are essential for analytics.
  • Media files should be tailored for web, mobile, and CTV environments.
  • Use multiple media files and tracking URLs for robust ad delivery and measurement.

Need to test your VAST tags?

Try our VAST Tag Tester for instant validation and preview. Test your VAST Now