VAST macros / Identity and privacy
[PAGEURL] VAST macro
Short answer: The full URL of the page where the ad is displayed, percent-encoded. Introduced in VAST 4.1.
What it means
Resolves to the page URL on which the player is embedded. The player percent-encodes it, because the value is itself a URL placed inside another URL.
Example value
After the player substitutes the macro, [PAGEURL] becomes something like:
https%3A%2F%2Fnews.example.com%2Fstory%3Fid%3D42Before and after the player substitutes it
The first line is the URL in the tag. The second line is the request the player sends once it has a value.
https://t.example.com/i?page=[PAGEURL]&cb=[CACHEBUSTING]
https://t.example.com/i?page=https%3A%2F%2Fnews.example.com%2Fstory%3Fid%3D42&cb=847291The full document address, encoded
[PAGEURL] resolves to the URL of the page the player is embedded in, percent-encoded, because that value is itself a URL sitting inside another URL. VAST 4.1 added the macro. A question mark, ampersand, or slash in the page address has to become %3F, %26, and %2F. If the log shows a raw :// or a second ? the player inserted the address without encoding, and every parameter after it parsed as part of the page value or as a new parameter.
[DOMAIN] is only the host. Use that when the pixel needs a site. Use [PAGEURL] when the log has to point at the article, including path and query. They are not interchangeable, and a report that says the page was example.com has thrown away the path.
Players that have no page
A browser can supply a document URL. An in-app player and a connected-TV player usually cannot. The macro is then empty, or the token is left as written, depending on the player. Neither result is a page. The identifier for those environments is [APPBUNDLE]: a package name, a store id, or a channel id.
Putting [PAGEURL] on a CTV impression and treating an empty parameter as unknown web inventory mis-files the device. If the same tag runs on web and on CTV, branch the pixel or accept that the parameter is web-only. [APPBUNDLE] on a web page is the mirror problem: there is no bundle.
A value that breaks the query string
This is what an unencoded substitution does to a URL that also carries a cache buster. The page query eats the rest of the string.
The player was supposed to send page=https%3A%2F%2Fnews.example.com%2Fstory%3Fid%3D42 and cb as its own parameter.
https://t.example.com/i?page=https://news.example.com/story?id=42&cb=847291Where it is valid
Impression, tracking, and click URLs in a browser. In-app and connected TV players often have no page URL, and then the macro is empty.
Macros are case-sensitive and substituted only inside URL fields. A macro written in the wrong case, or placed where it has no defined value, is sent to the server as literal text instead of a value.
Using it in a tag
<Impression><![CDATA[https://t.example.com/i?page=[PAGEURL]]]></Impression>VAST XML fragment only. This excerpt belongs inside a complete VAST document, so standalone validation will fail until it is wrapped in a full <VAST>response.
Related vastlint rules
- VAST-2.0-macro-unknown: URL contains a [MACRO] that is not a recognised IAB VAST macro
- VAST-2.0-macro-lowercase: Recognised macro is not uppercase — players match macro names case-sensitively
- VAST-2.0-macro-uri-unencoded: Macro-bearing URL contains characters that must be percent-encoded per RFC 3986
Related macros
- [DOMAIN]: The domain of the site or app where the ad is served.
- [APPBUNDLE]: The app bundle or package identifier in app environments.
Validate your macros
vastlint flags unknown, mis-cased, deprecated, out-of-context, and unencoded macros in any tracking, click, error, impression, or media URL:
# CLI: exits non-zero on errors, ideal for pipelines
vastlint check creative.xmlUse the right tool for this failure
If you already have the resolved XML, run a pure spec check. If you only have a live tag URL, test that endpoint first. If the failure happens in the wrapper chain, inspect each hop.