So here's a problem I'm busting my head around for the past few days:
I have a nodeJS app that does the following:
var VAST = require('vast-xml');
var vast = new VAST();
vast.version = "2.0";
var ad=vast.attachAd({
id : 1
, structure : 'wrapper'
, sequence : 99
, Error: 'http://error.err'
, VASTAdTagURI : 'http://demo.tremormedia.com/proddev/vast/vast_inline_linear.xml'
, AdTitle : 'Common name of the ad'
, AdSystem : { name: 'Test Ad Server', version : '1.0' }
});
response.setHeader('Content-Length', Buffer.byteLength(vast.xml()));
response.setHeader('Connection', 'close');
response.writeHead( 200, {'content-type': 'text/xml; charset=UTF-8'} );
response.end(vast.xml());
Here's the URL that invoke the above code: http://tag.sprtad.com/?ttj=4 The returned XML is:
<VAST version="2.0">
<Ad id="1" sequence="99">
<Wrapper>
<AdSystem version="1.0">Test Ad Server</AdSystem>
<VASTAdTagURI>
<![CDATA[http://demo.tremormedia.com/proddev/vast/vast_inline_linear.xml ]]>
</VASTAdTagURI>
<Error>
<![CDATA[http://error.err ]]>
</Error>
<Creatives />
</Wrapper>
</Ad>
</VAST>
Now, here's a file that returns the exact same XML: http://serve.sprtad.com/test.xml
Here's the problem:
I'm using this VAST-Validator to ensure that the XML is valid: https://developers.google.com/interactive-media-ads/docs/vastinspector_dual
Just paste the first URL or the second URL in the VAST tag textbox, and click on 'test ad' button.
Below the video player, there's a log console. In the log you'll be able to see that for the first link, it returns an error and for the second link, it works fine!
I cannot pinpoint what's the difference between serving the XML dynamically vs. serving the XML file.