VAST tag not working? The common causes and how to fix each one

On this page 13 sections

Short answer: when a VAST ad doesn’t show, one step of the tag’s chain is failing. Most of the time an ad server in the chain doesn’t send CORS headers, an address is on http://, the last ad server had no ad for this request (error 303), or none of the media files is one the player can play. To find out which, paste the tag into our free VAST Tag Tester: it follows every wrapper, names the step that fails and explains why.

Below, each cause in the order it usually shows up, with the VAST error code a player reports for it and how to fix it.

First, find the step that fails

A VAST tag is rarely one document. The address you paste into the player often returns a wrapper: a small VAST that points to another ad server, which may point to another, until one returns the inline ad with its video files. Each step is a separate request to a separate server, so “the tag doesn’t work” can mean six different things on six different servers.

The browser’s developer tools show the requests, but not which one matters or why it failed. A tester that follows the chain does: the VAST Tag Tester lists every step with its server, status and time, checks each document, and says where the chain breaks. Start there, then read the matching section below.

1. CORS: the ad server doesn’t allow your site

What you see: no ad, and a line in the console saying the request was “blocked by CORS policy”. Players report error 301 for a wrapper that fails this way.

A web player requests VAST with JavaScript. The browser only hands over the answer if the ad server says your site may read it, with the Access-Control-Allow-Origin header. Every server of the chain needs it: the first ad server can be fine and the third one can break everything.

Fix it on the ad server, on its VAST answers:

TEXT
Access-Control-Allow-Origin: https://www.example.com
Access-Control-Allow-Credentials: true
Vary: Origin

Many players, Fluid Player included, send cookies with VAST requests so ad servers can apply frequency caps. With cookies, browsers refuse Access-Control-Allow-Origin: *: the server must repeat the page’s exact origin (taken from the request’s Origin header) and allow credentials. Vary: Origin keeps a CDN from serving one site’s answer to another. The VAST Tag Tester sends no cookies, so for this case check the header itself: curl -sI -H "Origin: https://www.example.com" "<tag address>" must show your origin, not *.

Media files don’t need CORS to play in a <video> element, so a missing header there usually doesn’t stop the ad. VAST answers always need it.

2. An http:// address on an https page

What you see: the request never leaves the browser, with a “Mixed Content” warning in the console.

Browsers block http:// requests from https:// pages. One http:// wrapper address in the chain is enough to break it (error 301), and an http:// media file can’t play (error 401 or 405). Tracking addresses on http:// are blocked or upgraded, so their counts go missing.

Fix it: use https:// everywhere: the tag, every VASTAdTagURI, media files, tracking and click addresses. Every major ad server and CDN supports it.

3. No ad: the answer is empty (error 303)

What you see: the chain works, but the last answer is an empty <VAST> with no <Ad> inside. After one or more wrappers, players report error 303. Google’s IMA SDK reports it as error 1009, “The VAST response document is empty.”

This isn’t a bug in the tag: the ad server had nothing to show for this request. Usually:

  • No campaign matched: wrong country, device or browser, the time of day, or a frequency cap already reached.
  • The floor price is too high for the demand at that moment.
  • Information is missing from the request: the page address, the consent string or the player size. Ad servers often need them as macros in the tag address ([PAGEURL], [GDPRCONSENT], [PLAYERSIZE]), filled in by the player or your page.
  • You’re testing from a place the campaign doesn’t target, such as an office in another country.

Fix it: look at the fill rate over many requests, not one test. Try again, test from a place the campaign targets, and check with the ad network which parameters its tag expects.

4. Too many wrappers, or a slow answer (errors 301 and 302)

What you see: the chain stops after a few steps (error 302, wrapper limit reached) or one step takes several seconds (error 301, timeout).

Every player stops following wrappers at some point. Fluid Player follows 3 by default and waits 5 seconds per request; IAB recommends that players follow at least 5. A chain of resellers can go past that, and a loop (a wrapper pointing back to an earlier step) never ends.

Fix it: shorten the chain where you can, by buying closer to the source. If a long chain is expected, raise the player’s limits; in Fluid Player:

JavaScript
var myFP = fluidPlayer('video-id', {
    vastOptions: {
        adList: [
            { roll: 'preRoll', vastTag: 'https://ads.example.com/vast?id=123' }
        ],
        maxAllowedVastTagRedirects: 5,
        vastTimeout: 8000
    }
});

5. No media file the player can play (error 403)

What you see: the chain ends in an inline ad, but nothing plays. Players report error 403 (“Couldn’t find MediaFile that is supported by this video player”), or 401 and 405 when the chosen file fails.

An inline ad lists one or more <MediaFile> entries, and the player picks one by its type. Common problems:

  • No MP4. WebM, HEVC or 10-bit files don’t play everywhere. An H.264/AAC MP4 is the one format every browser plays.
  • A missing or wrong type, such as type="mp4" instead of type="video/mp4". Without a type the player can’t tell whether it can play the file.
  • Only a VPAID file (JavaScript), for a player that doesn’t run VPAID (see section 8).
  • A stream instead of a file, an HLS or DASH address in delivery="streaming", for a player that only plays progressive files.
  • A dead or expired address, such as a signed URL that has expired by the time the ad plays.

Fix it: always include a progressive H.264 MP4 with type="video/mp4" and its width, height and bitrate, and list it first. Offer a version around 720p under 2,500 kbps for slow connections. The tester shows each file’s type, real size and length, whether this browser can play it, and which one Fluid Player will choose.

6. Macros left unfilled

What you see: the tag address or the tracking addresses still contain %%CACHEBUSTER%%, ${AUCTION_PRICE} or [PAGEURL] when they reach the ad server, which then answers with no ad or doesn’t count the event.

There are two kinds of macros. Ad-server macros (%%…%%, ${…}) must be replaced by the ad server that wrote the tag, before it reaches the player: if they’re still there, the tag was copied from the wrong place or the platform that should fill them in didn’t. VAST macros in square brackets ([CACHEBUSTING], [TIMESTAMP], [ERRORCODE]…) are filled in by the player, but each player supports its own list.

Fix it: take the tag from the ad server’s “third-party” or “VAST” export, not from a preview. For VAST macros, check which ones your player fills in, and replace the rest in your page before passing the address to the player. The tester lists every macro of the chain and flags the ones that should already be gone.

7. Broken XML (errors 100 and 101)

What you see: the ad server answers, but the player can’t read the answer.

100 means the answer isn’t valid XML: an error page or login page in HTML, JSON, a cut-off answer, or a & in a URL outside a <![CDATA[ ]]> block. 101 means the XML is fine but doesn’t follow VAST: a missing <Impression>, <Duration> or <MediaFiles>, a duration written 30 instead of 00:00:30, an element name in the wrong case.

Fix it: wrap every URL in <![CDATA[ ]]>, write times as HH:MM:SS or HH:MM:SS.mmm, and check the required elements of your VAST version. The tester shows the line and column of the first XML error, then each missing or malformed element, with its VAST version.

8. A VPAID ad in a player that doesn’t run VPAID (error 901)

What you see: the ad’s only <MediaFile> has apiFramework="VPAID" and a .js address, and nothing plays.

VPAID ads are JavaScript programs that run inside the player. IAB Tech Lab replaced VPAID with SIMID (for interactive ads) and Open Measurement (for verification), and many players, apps and TV devices no longer run it. Fluid Player only runs VPAID when you set vastOptions.allowVPAID: true.

Fix it: ask for a plain video version of the creative next to the VPAID file, or turn VPAID on in your player if you accept running the advertiser’s code on your page.

9. Autoplay blocked

What you see: the tag is fine and loads, but nothing starts until the visitor clicks.

Browsers block video that starts with sound before the visitor has interacted with the page. Muted video can start on its own. A pre-roll is subject to the same rule as the video it comes before.

Fix it: start the player muted if you need autoplay, or let the visitor click play: the ad then starts with sound. In Fluid Player, layoutControls.autoPlay and layoutControls.mute set both.

Checklist

  • Every ad server in the chain sends Access-Control-Allow-Origin with your site’s origin, and Access-Control-Allow-Credentials: true.
  • Everything is on https://: the tag, every wrapper, media files, tracking and clicks.
  • The inline ad has a progressive H.264 MP4 with type="video/mp4", listed first.
  • The chain has no more wrappers than your player follows, and every step answers in under a few seconds.
  • Ad-server macros are filled in before the tag reaches the player.
  • The XML is valid, with <Impression>, <Duration> and <MediaFiles>.
  • Empty answers (303) are a matter of fill rate, not of the tag.

Questions

Why does my tag work in Google’s IMA inspector but not on my site?

The two differ in more than the player. One of the ad servers may send CORS headers to Google’s domains and not to yours. The IMA SDK runs VPAID ads that your player may not run. Players also follow different numbers of wrappers, wait different times, and choose differently among media files. Test the tag in the VAST Tag Tester, which plays it the way Fluid Player does, and compare.

Why does the ad show only sometimes?

Usually fill: the ad server has an ad for some requests and not others, depending on the visitor, the campaign’s budget and pacing, and frequency caps. Less often, one server in the chain is slow and times out some of the time. Run the test several times and look at which step returns an empty answer or takes long.

What’s the difference between a VAST tag and VAST XML?

The tag is the address the player requests; the XML is what the ad server answers. You can test either: paste the address to test the whole chain as a player would, or paste the XML to check one document on its own.

What do the VAST error codes mean?

They’re three-digit codes the player sends to the tag’s <Error> address when something fails: 1xx for the XML, 2xx for an ad that doesn’t fit the player, 3xx for wrappers and requests, 4xx for the video ad, 5xx for overlays, 6xx for companions and 9xx for the rest. Our VAST error codes page explains each one, with its causes and fixes.

Should I use VAST or VMAP?

VAST describes one ad (or one pod of ads). VMAP is a playlist that says when ad breaks happen in a video and which VAST tag fills each one. Many players, Fluid Player included, schedule breaks in their own settings instead, with one VAST tag per break. The tester reads both, and for a VMAP shows the equivalent Fluid Player settings.

Test your tag

Paste your tag or its XML into the VAST Tag Tester. It’s free, needs no account, and runs in your browser: your tag is only sent to the ad servers in it, and tracking is never sent. When the ad plays, copy the code under the tester to play it on your site with Fluid Player.

What else it checks, and why we built it: see our launch post.