GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

GAM VAST macros

VAST macros add dynamic parameters to your VAST ad tag so the Experiences player can pass language, consent, device, and placement data with each ad request.

Macros let you tailor ad requests to the viewer and playback context without creating a separate tag for every scenario. That supports more relevant ad selection, accurate measurement, and compliance signals (for example, GDPR consent) that buyers and ad servers often require. Parameters such as device identifiers and placement type also help meet programmatic video requirements and can improve fill for in-app inventory.

Sample tag

A sample VAST ad tag URL with parameters might look like this:

https://securepubads.g.doubleclick.net/gampad/ads?env=vp&gdfp_req=1&output=vast&iu=/1234/video-demo&sz=400x300&unviewed_position_start=1&ciu_szs=728x90,300x250

For the full list of supported parameters, see Google Ad Manager VAST tag parameters.

Recommended parameters

WSC Sports recommends the parameters in the table below.

ParameterDescription
hl
(Language)

The language parameter accepts a constant value which is used to request ads in that language, and for language of ad selection and video ad rendering in dynamic allocation to Ad Exchange or AdSense Video.

The parameter value can be any ISO 639-1 (two-letter) or ISO 639-2 (three-letter) code. See a list of valid codes.

If omitted, the value defaults to any language with ad targeting by language in Ad Exchange.

Usage example:
hl=it

gdpr

The GDPR parameter accepts constant values and is used by publishers who wish to integrate with the IAB TCF v2.0. Direct VAST requests don't automatically read the values, but they're accepted when added to ad tags.

Only 0 and 1 are valid values for this parameter, where 0 means GDPR does not apply and 1 means GDPR applies. If GDPR applies, you must also provide a valid TC string using the gdpr_consent parameter.

You can read more about the values passed to this parameter in the general guidance for implementing the framework, or in the TC string section of the IAB TCF v2.0 specification.

Usage example:
GDPR applies:
gdpr=1

GDPR does not apply:
gdpr=0

gdpr_consent

The GDPR Consent parameter accepts variable values and is used by publishers who wish to integrate with the IAB TCF v2.0. Direct VAST requests don't automatically read the values, but they're accepted when added to ad tags.

You can read more about the values passed to this parameter in the general guidance for implementing the framework, or in the TC string section of the IAB TCF v2.0 specification.

Usage example:
gdpr_consent=GDPR_CONSENT_123

msid

While the app name should be a human-readable name, on iOS and tvOS, it's not possible for the SDK to access the app ID. In these cases, the msid parameter is not sent, and the SDK sends the app bundle via the an parameter.

Usage example:
msid=com.package.publisher&an=sample%20app

App IDs are named and formatted differently across different app stores. See the IAB guidelines for app identification, or examples of common unique identifiers.

plcmt
(Placement)

The placement parameter accepts a constant value which is used to indicate whether or not the in-stream inventory is declared as in-stream or accompanying per the guidance in the IAB specifications.

For non-in-stream requests, this field is populated for buyers automatically based on the declared inventory format, and will override any in-stream or accompanying content declaration.

Usage example:
In-stream request:
plcmt=1

rdid
idtype
is_lat
(Resettable device identifiers)

The resettable device identifiers accept variable values.

With built-in applications (not on web or mobile web), the SDK passes resettable device identifiers for user targeting into your stream requests with the parameters for rdid, idtype, and is_lat. On SSB streams, you must pass these as explicit parameters, just as you would on a client-side ad request. Learn more about device identifiers.

Nearly all programmatic video ads require the presence of these values.

Starting with iOS 14.5, Apple has deprecated the LAT signal. Google instead relies on the presence of a non-zero IDFA to indicate that the user has consented to tracking on versions of iOS that support App Tracking Transparency. As such, a valid UserAgent indicating the correct OS version is required.

These device identifiers are used for ad targeting only. They aren't the viewer ID, and the Experiences SDK doesn't use them to identify viewers for personalization or analytics. Don't derive the viewer ID or doNotTrack from the ATT status. See Viewer ID.

Usage example:
See detailed examples of resettable device identifiers.

Requirement: Required for app

sid
(Session ID)

The session ID parameter accepts a variable value which is a privacy-preserving advertising identifier that is used for frequency capping purposes only.

Session ID is supported for in-stream video requests from connected TVs and on in-stream video inventory from mobile app devices. It is not currently supported for web.

Per the IAB's IFA guidelines, this parameter must be populated in UUID format. Learn more about resettable device identifiers for user targeting.

You can opt out of passing the session ID by setting sid=0.

Usage example:
123e4567-e89b-12d3-a456-426614174000

url
(URL)

The URL parameter accepts a variable value which should be set to the full URL from which the request is sent. This value is needed to help buyers identify and understand the context of where this request is coming from. To the extent possible, this value should be dynamically populated on the ad request.

On a web page, this is the URL of the page that displays the video player. If you use the IMA SDK, the URL value is set automatically. If your player sets this value, the IMA SDK will respect the value being set.

In an app (mobile or CTV), set this value to a URL that most accurately represents the video or audio inventory being monetized. For example, when a viewer watches a video in a mobile app that also has a desktop URL equivalent.

Encode this parameter value.

Usage example:
url=https%3A%2F%2Fwww.videoad.com%2Fgolf.html
  • For apps, when you cannot set a variable URL, use this pattern: url=https%3A%2F%2F<app-bundle-id>.adsenseformobileapps.com
vpa
(Video play automatic)

The video play automatic parameter accepts a constant value which indicates whether video content in an ad starts through autoplay or click.

Possible values are click if the page waits for a user action or auto if the video plays automatically.

This parameter should be left unset if it is unknown.

Usage example:
Autoplay:
vpa=auto

Click to play:
vpa=click

vpos
(Video position)

The Experiences SDK sends vpos=midroll on every ad request, including Stories pre-rolls and Videos pre-roll and post-roll ads. Per-placement values (preroll, midroll, postroll) are planned. Don't use vpos to target or report by placement.

Usage example:
vpos=midroll

vpmute
(Video play mute)

The muted video parameter accepts a constant value which indicates whether the ad playback starts while the video player is muted.

Usage example:
Muted:
vpmute=1

Unmuted:
vpmute=0


Did this page help you?