How to add macros to your VAST Booster and Adserving

Introduction

This document details the use of macros within Viously's VAST Booster and VAST Adserving environments. These macros are designed to enhance your ad serving capabilities by allowing for dynamic content insertion.

Macro List

Below is a comprehensive list of available macros, along with their descriptions and example values:

MacrosDescriptionValues
%%URL%%Inserts the URL of the page where the VAST is called.
%%REFERRER_URL%%Inserts the URL of the previous page.
%%TIMESTAMP%%Inserts a timestamp indicating the date of the request.
%%CACHEBUSTER%%Inserts a cache buster for refreshing cached resources.
%%GDPR_APPLIES%%A flag indicating if the GDPR applies to the user (1 for true, 0 for false).Example: 1
%%GDPR_CONSENT%%Inserts the consent string from the CMP.
%%GDPR_NPA%%A flag indicating if the CCPA applies to the user (1 for true, 0 for false).Example: 1
%%PLAYLIST_INDEX%%The index of the video in the playlist.Example: 1
%%MUTE%%Indicates if the player is muted (true) or not (false).Example: true
%%BRAND_SAFE%%Indicates the brand safety of the web page. Possible values are : safe, unsafe and unknownExample: safe
%%CATEGORY%%Indicates the category of the article. Possible values are :

- news
- animals
- motors
- food
- culture
- family
- unusual
- entertainment
- home-garden
- fashion-beauty
- celebs
- planet
- health
- science
- sports
- reality-show
- travel
Example: science
%%AUDIENCE_SOURCE%%Indicates the source of the audience. Possible values are :

- DEFAULT
- GOOGLE
- AMP
- FACEBOOK
- INSTAGRAM
- SNAPCHAT
- TWITTER
- PINTEREST
- YOUTUBE
- NEWS REPUBLIC
- UPDAY
- GOOGLE DISCOVER
Example: GOOGLE
%%TOP_OF_PAGE%%Indicates if the player is placed at the top of the page (true) or not (false).Example: true
%%ABOVE_THE_FOLD%%Indicates if the player is above the fold on page load (true) or not (false).Example: false
%%IAB_CATEGORIES%%Indicates IAB categories of the article. (See IAB specs)Example: IAB-1
%%ORTB_PLCMT%%Indicates OpenRTB placement. (See IAB specs)Example: 1
%%PLAYBACK_METHOD%%Indicates the playback method of the video. (See IAB specs)Example: 3
%%PLAYER_WIDTH%%Indicates the width of the player.Example: 640
%%PLAYER_HEIGHT%%Indicates the height of the player.Example: 360
%%SONAR%%Inserts the VTR, MRC and CTR predictions from Viously. To enable this feature please contact your account manager. (https://developers.viously.com/docs/how-to-set-up-sonar-macro)

Integrating Macros in Your VAST

Incorporating macros into your VAST setup is straightforward:

  1. Access your Viously platform settings here.
  2. Add the desired macros directly to the VAST URL, for example:
https://pubads.g.doubleclick.net/gampad/ads?iu=/1234567890/external/single_ad_samples&sz=640x480&output=vast&unviewed_position_start=1&env=vp&gdpr=%%GDPR_APPLIES%%&gdpr_consent=%%GDPR_CONSENT%%&description_url=%%URL%%&correlator=%%CACHEBUSTER%%

For Google VAST, pass values using the cust_params feature for targeted Google Ad Manager integrations:

https://pubads.g.doubleclick.net/gampad/ads?iu=/1234567890/external/single_ad_samples&sz=640x480&output=vast&unviewed_position_start=1&env=vp&cust_params=player_width%3D%%PLAYER_WIDTH%%%26player_height%3D%%PLAYER_HEIGHT%%

Ensure URL encoding for the key values (= as %3D and & as %26).

Add first party data from your website to your VAST

For instructions on how to add first-party data to your VAST tags, please refer to "How to Add First Party Data to VASTs".