How Do Video Ad Macros Work: VAST Macros Explained
Explore the world of VAST macros in video advertising. Learn how they work, their importance, and best practices for effective ad delivery.
A Comprehensive Guide to VAST Macros in Video Advertising

How Do Video Ad Macros Work: VAST Macros Explained
In the dynamic world of online advertising, video ads play a pivotal role in engaging audiences and driving marketing success. At the core of video ad delivery is the Video Ad Serving Template (VAST), which acts as a standard for serving video ads across different platforms. Integral to the effectiveness of VAST are VAST macros, which serve as placeholders for dynamic data that can be inserted into ad responses. This article will delve into the intricacies of VAST macros, their importance, common use cases, and offer insights into best practices and future trends.
Understanding VAST and Its Role in Video Advertising
VAST, developed by the Interactive Advertising Bureau (IAB), is a protocol that standardizes the communication between video ad servers and video players. This ensures that video ads can be delivered, played, and tracked consistently regardless of the technology platform. The role of VAST is crucial as it simplifies the video ad supply chain, making it easier for advertisers to reach their audience with less concern for technical compatibility issues.
What Are VAST Macros?
Macros, in general, are placeholders within a code or template that get replaced with specific values at runtime. In the context of VAST, macros are used within ad tags to pass information about the ad request or the user environment to the ad server. This dynamic insertion of data allows for more tailored ad delivery and precise tracking.
The Importance of VAST Macros
VAST macros are essential for several reasons:
- Enhanced Ad Targeting: Macros allow advertisers to deliver personalized ads based on user context, such as geographic location or device type.
- Improved Tracking: By using macros to collect data like user interaction or ad playback details, advertisers gain valuable insights into ad performance.
- Efficiency and Scalability: Macros automate the process of data insertion, making ad operations more efficient and scalable.
How Macros are translated in VAST
When a video player requests an ad, the VAST response may contain macros that need to be replaced with actual values. The video player or ad server processes these macros, substituting them with relevant data before the ad is served. For example, a macro like [CACHEBUSTING] might be replaced with a random number to prevent caching of the ad creative.
An example of a VAST macro in an ad tag could look like this:
<VAST version="4.2"> <Ad id="12345"> <InLine> <Creatives> <Creative> <Linear> <MediaFiles> <MediaFile><![CDATA[https://adserver.com/serve?device=%%DEVICE_ID%%&ts=%%CACHEBUSTER%%]]></MediaFile> </MediaFiles> </Linear> </Creative> </Creatives> </InLine> </Ad> </VAST>
Responsibility for Translation
- Ad Servers (DSP/SSP/Ad Network): Define which macros they support (e.g., Google Ad Manager, FreeWheel, SpringServe).
- Video Player (Publisher side): Responsible for substituting the macros with actual values at runtime. For example, if a player is on iOS, it might fill %%DEVICE_ID%% with ABC123XYZ.
Macros Get Resolved
- At the time of the ad request, the video player or ad server processes the VAST response, replacing macros with actual values based on the user's context and environment. Example:
https://adserver.com/serve?device=ABC123XYZ&ts=1617181920
Common VAST Macros and Their Use Cases
Here are some commonly used VAST macros:
[CACHEBUSTING]: Prevents caching of ad creatives by inserting a random number.[TIMESTAMP]: Inserts the current timestamp, useful for logging and tracking.[ASSETURI]: The URL of the ad creative asset.[CONTENTPLAYHEAD]: The current playback position in the video content.
Use cases for each macro include:
[CACHEBUSTING]: Ensuring that the most recent version of an ad is served.[TIMESTAMP]: Tracking when an ad was served for reporting purposes.[ASSETURI]: Serving the appropriate creative based on the user's environment.[CONTENTPLAYHEAD]: Triggering mid-roll ads at the correct point in the video content.
Example XML Code Snippets with VAST Macros
Below are example XML snippets that demonstrate how VAST macros are used:
<VAST version="3.0"> <Ad id="12345"> <InLine> <Creatives> <Creative> <Linear> <MediaFiles> <MediaFile delivery="progressive" type="video/mp4" bitrate="800" width="640" height="360"> <![CDATA[ http://example.com/ads?cb=[CACHEBUSTING]&time=[TIMESTAMP] ]]> </MediaFile> </MediaFiles> </Linear> </Creative> </Creatives> </InLine> </Ad> </VAST>
In the above code, the [CACHEBUSTING] and [TIMESTAMP] macros will be replaced with actual values when the ad is requested, ensuring unique requests and accurate tracking.
Best Practices for Using VAST Macros
To effectively use VAST macros, consider the following best practices:
- Validate Macro Replacement: Ensure that the ad server correctly replaces macros with actual values.
- Use Secure Macros: For HTTPS environments, use secure macros to prevent mixed content issues.
- Test Across Environments: Verify that macros work correctly across various devices and platforms.
Real-World Applications of VAST Macros
VAST macros are widely used in various real-world scenarios, such as:
- Programmatic Advertising: Macros enable real-time bidding and ad personalization based on user data.
- Cross-Device Campaigns: Macros help track user interactions across multiple devices, ensuring a cohesive ad experience.
- Performance Analytics: Macros facilitate detailed reporting on ad performance, allowing advertisers to optimize their campaigns.
A Real-World Example
Macros are set on the VAST URL and then feed through to the VAST XML.
http://example.com/example-vast-ad.xml?geo=[LATLONG]&device_ua=[DEVICEUA]
Consider a scenario where an advertiser wants to serve a video ad that is personalized based on the user's location and device type. The VAST ad tag might include macros like [LATLONG] and [DEVICEUA]. When the ad request is made, these macros are replaced with the user's actual geographic location and device information, allowing the ad server to deliver a tailored ad experience.
<VAST version="4.2"> <Ad id="67890"> <InLine> <Creatives> <Creative> <Linear> <MediaFiles> <MediaFile delivery="progressive" type="video/mp4" bitrate="800" width="640" height="360"> <![CDATA[ http://example.com/ads?geo=[LATLONG]&device=[DEVICEUA] ]]> </MediaFile> </MediaFiles> </Linear> </Creative> </Creatives> </InLine> </Ad> </VAST>
When a user from New York on an iPhone requests the ad, the macros could be resolved as follows: (Values are illustrative and usually URL encoded or tokenized)
http://example.com/example-vast-ad.xml?geo=40.7128,74.0060&device_ua=Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1
Future Outlook on VAST Macros and Video Advertising Technology
As video advertising technology evolves, we can expect VAST macros to become more sophisticated, potentially incorporating AI-driven dynamic content insertion. The rise of connected TV and advancements in programmatic advertising may also lead to new macro use cases and standards.
Conclusion
VAST macros are a powerful tool in the video advertising ecosystem, enabling personalized ad experiences and granified tracking. By understanding and implementing VAST macros correctly, advertisers and publishers can enhance the effectiveness of their video ad campaigns. As the ad tech landscape continues to evolve, staying abreast of best practices and emerging trends will be essential for success.
IAB Macros Reference
For a comprehensive list of VAST macros and their definitions, refer to the IAB VAST Macros Specification This resource provides the most up-to-date collection of officially recognized macros as established by the IAB Tech Lab's Digital Video Technical Working Group. This list is the latest as of June 2024 and may be updated in the future.
How can I test my VAST Tag?
Use our VAST Tag Tester to check your tag version, preview ads, and troubleshoot playback issues across devices.
Visit the VAST Tag Tester to get started.