VAST macros / Ad and pod
[ADCOUNT] VAST macro
Short answer: The position of this ad within an ad pod. Introduced in VAST 4.1.
What it means
Resolves to the sequential index of the ad inside a pod, used for pod-level reporting and pacing.
Example value
After the player substitutes the macro, [ADCOUNT] becomes something like:
2Where it is valid
Impression and tracking URLs in ad pods.
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?val=[ADCOUNT]&cb=[CACHEBUSTING]]]></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
Related macros
- [PODSEQUENCE]: The sequence number of the ad within its pod.
- [BREAKPOSITION]: The position of the ad break: pre-roll, mid-roll, or post-roll.
- [ADTYPE]: The type of ad: video, audio, or hybrid.
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.