The VAST response document is empty with HTML IMA SDK but not Android IMA SDK

1,342 views
Skip to first unread message

ada...@gmail.com

unread,
Apr 26, 2019, 7:59:51 PM4/26/19
to Interactive Media Ads SDK
Hello,

With the HTML5 SDK or the web inspector my ad tag always responds with The VAST response document is empty while if I use the same ad tag with android sdk it works fine. The sample ad tag works fine as well with the html SDK. Its just when I used the live tag.

// Copyright 2013 Google Inc. All Rights Reserved.
// You may study, modify, and use this example for any purpose.
// Note that this example is provided "as is", WITHOUT WARRANTY
// of any kind either expressed or implied.

var adsManager;
var adsLoader;
var adDisplayContainer;
var intervalTimer;
var playButton;
var videoContent;

function init() {
videoContent = document.getElementById('contentElement');
playButton = document.getElementById('playButton');
playButton.addEventListener('click', playAds);
setUpIMA();
}

function setUpIMA() {
// Create the ad display container.
createAdDisplayContainer();
// Create ads loader.
adsLoader = new google.ima.AdsLoader(adDisplayContainer);
// Listen and respond to ads loaded and error events.
adsLoader.addEventListener(
google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
onAdsManagerLoaded,
false);
adsLoader.addEventListener(
google.ima.AdErrorEvent.Type.AD_ERROR,
onAdError,
false);

// An event listener to tell the SDK that our content video
// is completed so the SDK can play any post-roll ads.
var contentEndedListener = function () { adsLoader.contentComplete(); };
videoContent.onended = contentEndedListener;

var date = Date.now();

// Request video ads.
var adsRequest = new google.ima.AdsRequest();

'ad_unit_fc1&description_url=http%3A%2F%2Fwww.marketcast.co&env=vp&impl=s&correlator=' + date +
'&tfcd=0&npa=0&gdfp_req=1&output=vast&sz=400x300|640x480&unviewed_position_start=1';

'sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&' +
'impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&' +
'cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=';

adsRequest.adTagUrl = liveAd;

// Specify the linear and nonlinear slot sizes. This helps the SDK to
// select the correct creative if multiple are returned.
adsRequest.linearAdSlotWidth = 640;
adsRequest.linearAdSlotHeight = 480;

adsRequest.nonLinearAdSlotWidth = 640;
adsRequest.nonLinearAdSlotHeight = 480;

adsLoader.requestAds(adsRequest);
}


function createAdDisplayContainer() {
// We assume the adContainer is the DOM id of the element that will house
// the ads.
adDisplayContainer = new google.ima.AdDisplayContainer(
document.getElementById('adContainer'), videoContent);
}

function playAds() {
// Initialize the container. Must be done via a user action on mobile devices.
videoContent.load();
adDisplayContainer.initialize();

try {
// Initialize the ads manager. Ad rules playlist will start at this time.
adsManager.init(640, 360, google.ima.ViewMode.NORMAL);
// Call play to start showing the ad. Single video and overlay ads will
// start at this time; the call will be ignored for ad rules.
adsManager.start();
} catch (adError) {
// An error may be thrown if there was a problem with the VAST response.
videoContent.play();
}
}

function onAdsManagerLoaded(adsManagerLoadedEvent) {
// Get the ads manager.
var adsRenderingSettings = new google.ima.AdsRenderingSettings();
adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete = true;
// videoContent should be set to the content video element.
adsManager = adsManagerLoadedEvent.getAdsManager(
videoContent, adsRenderingSettings);

// Add listeners to the required events.
adsManager.addEventListener(
google.ima.AdErrorEvent.Type.AD_ERROR,
onAdError);
adsManager.addEventListener(
google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,
onContentPauseRequested);
adsManager.addEventListener(
google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,
onContentResumeRequested);
adsManager.addEventListener(
google.ima.AdEvent.Type.ALL_ADS_COMPLETED,
onAdEvent);

// Listen to any additional events, if necessary.
adsManager.addEventListener(
google.ima.AdEvent.Type.LOADED,
onAdEvent);
adsManager.addEventListener(
google.ima.AdEvent.Type.STARTED,
onAdEvent);
adsManager.addEventListener(
google.ima.AdEvent.Type.COMPLETE,
onAdEvent);
}

function onAdEvent(adEvent) {
// Retrieve the ad from the event. Some events (e.g. ALL_ADS_COMPLETED)
// don't have ad object associated.
var ad = adEvent.getAd();
switch (adEvent.type) {
case google.ima.AdEvent.Type.LOADED:
// This is the first event sent for an ad - it is possible to
// determine whether the ad is a video ad or an overlay.
if (!ad.isLinear()) {
// Position AdDisplayContainer correctly for overlay.
// Use ad.width and ad.height.
videoContent.play();
}
break;
case google.ima.AdEvent.Type.STARTED:
// This event indicates the ad has started - the video player
// can adjust the UI, for example display a pause button and
// remaining time.
if (ad.isLinear()) {
// For a linear ad, a timer can be started to poll for
// the remaining time.
intervalTimer = setInterval(
function () {
var remainingTime = adsManager.getRemainingTime();
},
300); // every 300ms
}
break;
case google.ima.AdEvent.Type.COMPLETE:
// This event indicates the ad has finished - the video player
// can perform appropriate UI actions, such as removing the timer for
// remaining time detection.
if (ad.isLinear()) {
clearInterval(intervalTimer);
}
break;
}
}

function onAdError(adErrorEvent) {
// Handle the error logging.
console.log(adErrorEvent.getError());
adsManager.destroy();
}

function onContentPauseRequested() {
videoContent.pause();
// This function is where you should setup UI for showing ads (e.g.
// display ad timer countdown, disable seeking etc.)
// setupUIForAds();
}

function onContentResumeRequested() {
videoContent.play();
// This function is where you should ensure that your UI is ready
// to play content. It is the responsibility of the Publisher to
// implement this function when necessary.
// setupUIForContent();

}

// Wire UI element references and UI event listeners.
init();

ima-sdk-fo...@google.com

unread,
Apr 29, 2019, 2:34:41 AM4/29/19
to ima...@googlegroups.com
Hi there,

Thank you for reaching out to us.
I've tested the ad tag you've provided using the Video Suite Inspector and was not able to reproduce the issue, could you share other ad tags for us to test further?

I would also suggest to get in touch with your ad provider to check the configuration on why it is responding with empty VAST on HTML.


Regards,
Sherwin Diesta
IMA SDK Team

ada...@gmail.com

unread,
Apr 30, 2019, 7:51:14 PM4/30/19
to Interactive Media Ads SDK
Hi Sherwin,

You are correct the VAST tag does work in the web inspector. I was able to reproduce it working once I removed the correlator parameter I was using in the code example from the sdk. 

However, if I use the exact same ad tag in the HTML SDK I still get "The VAST response document is empty.". Is it possible your team could test this with HTML simple sample to see if you have the same behavior?

Here is another tag from a completely different provider that also has the same issue (works in web inspector but not HTML SDK simple sample). 

Thanks,

Adam

ima-sdk-fo...@google.com

unread,
May 1, 2019, 3:10:50 PM5/1/19
to ima...@googlegroups.com
Hi there,

I was able to reproduce the behavior you are seeing with the SDK returning an Empty VAST when the ad tag is run against your test page. However, the issue seems to be with the ad serving since it is working fine with our VSI. I would recommend you to reach out to the Ad Manager support team so they can help you solve the ad serving issue.

Regards,
Arnaud Casame
IMA SDK Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Adam Tentis

unread,
Jun 7, 2019, 12:18:07 AM6/7/19
to Interactive Media Ads SDK
Hi Arnaud, 

As directed I reached out the the Ad Manager support team. However, they believe the issue is not with ad serving and redirected me back to you. I tend to agree with them since the ad server is serving ads just fine to the VSI and is only not working with the SDK.

If you have any other ideas to troubleshoot this I would appreciate it. 

Thanks,

Adam

IMA SDK

unread,
Jun 7, 2019, 3:01:36 AM6/7/19
to ada...@gmail.com, ima...@googlegroups.com

Hi Adam,

Thank you for your response.

Upon testing the latest ad tag you have provided with Video Suite Inspector and the IMA SDK simple sample app, both are throwing same error "the VAST response document empty" (Please see attached screenshots: vsiTest and sampleAppTest).

I've also noticed that when you check the ad tag in a browser, the VAST version is different compared with the response from the sample app (Screenshots: browserResponse and sampleAppResponse).

With this, I would suggest reaching out to your ad provider or to Ad Manager support team as this seemed to be an ad serving issue.



Regards,
Sherwin Diesta
IMA SDK Team



ref:_00D1U1174p._5001UBlycw:ref
sampleAppResponse.png
vsiTest.png
sampleAppTest.png
browserResponse.png

Adam Tentis

unread,
Jun 7, 2019, 6:39:31 PM6/7/19
to Interactive Media Ads SDK
Hi Sherwin,

The original vast tag uses nothing in the correlator parameter and fails which was mentioned earlier in this thread. 

Please use this tag and you will see it works perfectly fine in the VSI but not the Sample App.

Adam

IMA SDK

unread,
Jun 10, 2019, 1:32:29 AM6/10/19
to ada...@gmail.com, ima...@googlegroups.com

Hi Adam,

Thank you for your response and sharing this information.

Upon using the ad tag with the Video Suite Inspector, same issue occurred (Please see attached screenshot: testVSI).

As I've checked the XML response from the ad tag, I saw this element "<enable_companion_banner bool="true"/>". Kindly confirm if this is for companion backfill, which is not supported in HTML5.

Setting this element to FALSE will make the ad tag to load and work as intended (Attached screenshot: testSDK).
Let me know if this will work on your end.




Regards,
Sherwin Diesta
IMA SDK Team



ref:_00D1U1174p._5001UBlycw:ref
testVSI.png
testSDK.png

Adam Tentis

unread,
Jun 10, 2019, 11:18:14 PM6/10/19
to Interactive Media Ads SDK
Hi Sherwin,

Nice find! I don't intentionally have enable_companion_banner turned on. Do you know where/how this can be turned off? Maybe in ad server?

Thanks!

Adam

IMA SDK

unread,
Jun 11, 2019, 2:19:19 AM6/11/19
to ada...@gmail.com, ima...@googlegroups.com

Hi Adam,

Thank you for your response.

With regard to this, I would suggest get in touch with your ad provider, or you can ask assistance from the Ad Manager support team on how to setup your ad tag response.




Regards,
Sherwin Diesta
IMA SDK Team



ref:_00D1U1174p._5001UBlycw:ref

Adam Tentis

unread,
Jun 18, 2019, 8:56:33 PM6/18/19
to Interactive Media Ads SDK
There was no issue with the ad manager setup. All i needed to do was deploy to production and it worked fine. Ad exchange was filtering out ads requested in a local environment. 

Issue can be closed.

Thanks,

Adam
Reply all
Reply to author
Forward
0 new messages