How does IMA SDK HTML handle the errors in VAST responses containing multiple wrappers?

1,573 views
Skip to first unread message

Puneet Narsapur

unread,
Dec 21, 2016, 6:29:38 AM12/21/16
to Interactive Media Ads SDK
Hi, 

I am using IMA SDK HTML5 version for playing ads in the solution developed for our organisation and have come across one issue as explained below:

  • The VAST response contains around 4 wrappers. 
  • As expected SDK takes in the first one to process and makes the request through VASTAdTagURI. 
  • The response contains a valid final Inline Ad with two media files (1. VPAID SWF and 2. VPAID JS). 
  • SDK takes in VPAID JS and loads it successfully. Debugging through this JS file it does load but at some point of time it fails for some reason. 
  • SDK now triggers the Error URL specified in the <Error> tag of the first wrapper successfully. 
  • However post this failure is triggered, SDK doesn't try to load other Wrappers. Effectively the SDK fails with trying only first wrapper and the remaining wrappers are ignored. 
  • SDK doesn't trigger any AD_ERROR events either. It just goes from AD_LOADED -> ContentResumeRequested -> ALL_ADS_COMPLETED. 
Because of the above behaviour no ads are played even though there is a possibility of ads getting played from the remaining wrappers. 
Ideally I believe that after encountering error in the first wrapper it should trigger the error event and then proceed to next wrapper. If only after all the wrappers fail then it can trigger an AD_ERROR event. 

Can you please let me know if this is a bug? If anything can be done from my end to fix it? Or how exactly the is sequencing of handling the errors in case of response with multiple wrappers in it?

Would appreciate any help in this regards. 
Thanks
Puneet

Chris Feldman (IMA SDK Team)

unread,
Dec 21, 2016, 12:17:41 PM12/21/16
to Interactive Media Ads SDK
Hi Puneet,

It sounds like the SDK is working as intended. The wrapper element is simply for linking to another ad server, it isn't meant for your desired use case. You can read more about the wrapper element on page 18 of the VAST standards document from iab. The SDK is not looking for another ad after the first fails because it would be a detriment to the user experience to wait for another ad to load, especially given the possibility that a second ad could also fail.

For your AdError, can you check your log? Errors that are considered non-fatal are shown in the log output instead of firing an AdError and destroying the AdsManager. If you'd like, you can share with me your ad tag so that I can confirm that the SDK is behaving normally.

Regards,
Chris Feldman
IMA SDK Team

Puneet Narsapur

unread,
Dec 22, 2016, 6:32:13 AM12/22/16
to Interactive Media Ads SDK
Hi Chris, 

Thanks for the quick reply. I raised this question because I see difference in behaviour of both the HTML and Flash Video Suite inspector of Google IMA SDK. 
In case of HTML version on encountering the error for this particular ad wrapper it is just stopping the process and returning that all_ads_completed event. 
However in case of Flash version on encountering the same error for this particular ad wrapper it proceeds ahead with other wrappers and in some cases those wrapper end up delivering the ads. 

I am using the HTML version because the solution we are developing isn't using Flash and encountering this error. 
it does seem logical that processing other warppers could be detrimental to the user experience however its causing no ads to be delivered in our case. 
I will try to talk with the ad server to understand why this particular ad may be failing but it would be helpful from IMA SDK as well if anything can be done. 

Also I am not sure if i can share the ad tag url, but let me check with my customer and see if they are okay to share the VAST response with you. 

As for the errors there is nothing printed on the console at all. Its all clean :) 

Regards,
Puneet

Chris Feldman (IMA SDK Team)

unread,
Dec 22, 2016, 11:23:45 AM12/22/16
to Interactive Media Ads SDK
Hi Puneet,

Please share the VAST response if possible (you can do so in a private message if it makes you more comfortable). I'd like to investigate the divergent behavior that you're seeing between the HTML5 and Flash Versions of the VSI. It's possible you've discovered a bug, but I'll need to see the tag to confirm. This will also allow me to confirm what type of behavior you'd expect to see from your tag. I'm hesitant to make too many assumptions without seeing the actual response.

Regards,
Chris Feldman
IMA SDK Team

Message has been deleted

Puneet Narsapur

unread,
Dec 22, 2016, 11:40:54 AM12/22/16
to Interactive Media Ads SDK
Hi Chris, 

I can share you the Ad Tag URL. Use this AdTagURL
You might have to change "correlator" and "scor" query param values for it to work for you. Also I am not sure if it would yield the same response as it does for me here in India. 

I tested out the differences in FLASH and HTML Video Suite Inspector using VAST response XML instead of Ad Tag URL, and I would suggest you to do the same as well. 
Attaching few files:
1. AdInitialResponse.txt contains the VAST response from the above AdTagURL. It contains two different ads each with their own wrappers. 
2. AdWrapperResponse.txt contains the VAST response from the first ad wrapper. This one actually doesn't play any ad and just fails. 

As said before in case of HTML the second ad is not picked up, while in case of FLASH the second ad gets picked up. 
Please note that in the above response the second ad (SPOTX) might not play an ad as well but its the attempt not being made in HTML is what causing few issues at our end. 

Please let me know if you need any more details and I can help share them. 

Thanks and Regards,
Puneet
AdInitialResponse.txt
AdWrapperResponse.txt

Puneet Narsapur

unread,
Dec 22, 2016, 11:43:19 AM12/22/16
to Interactive Media Ads SDK
I forgot to mention that you may have to change the AdTagURL in the wrappers from http to https for testing out on the VSI :)

Chris Feldman (IMA SDK Team)

unread,
Dec 22, 2016, 3:36:26 PM12/22/16
to Interactive Media Ads SDK
Hi Puneet,

Thank you for sending the additional information. I see the problem now. You cannot have more than one wrapper in your VAST response. In your original message, I thought you were describing redirecting through multiple ad tags that each include one wrapper, but what you have is one ad tag that includes multiple wrappers.

For this reason, the response you sent me isn't currently supported. It's only by chance that you get any sort of response out of the Flash VSI, and we can't guarantee that the multi-wrapper tags will behave predictably. I would suggest refactoring your VAST response.

Let me know if you continue to have issues.

Regards,
Chris Feldman
IMA SDK Team

Puneet Narsapur

unread,
Dec 23, 2016, 1:08:39 AM12/23/16
to Interactive Media Ads SDK
Hi Chris, 

Thanks for the reply. Could you please point me to the specification document which mentions about the how a VAST response cannot have more than one wrapper? 
I am assuming it could be section 2.2.2 from the IAB VAST PDF, but want to know if there are any other supporting documents. 
This would help me in communicating it with the Ad Server team to get the VAST responses corrected. 

Thanks, 
Puneet

Puneet Narsapur

unread,
Dec 26, 2016, 1:30:44 AM12/26/16
to Interactive Media Ads SDK
Hi Chris, 

I just wanted to have some doubts cleared. 
As you said that a VAST response cannot contain more than one ad with each of those ads containing individual wrappers. 
Also that IMA SDK doesn't try processing the next wrapper. 

I had this one AdTagURL which does return response with two ads and first ad deliberately fails and fallsback onto the next ad. 
Following is the link:

Assuming that this feature was added in VAST v3.0 i used the response from the above url, modified the XML to change the version from 3.0 to 2.0 and removed the attribute fallbackOnNoAd="true" from the first ad. This was the response is almost similar to the one attached by me in last week. However in this new modified XML the SDK successfully fallsback to the next ad and plays while in case of my older response it just stopped working at the first failure. 

Can you please let me know what exactly could be wrong in my ad server response? 

Thanks, 
Puneet

Vu Chau (IMA SDK Team)

unread,
Dec 27, 2016, 10:08:14 AM12/27/16
to Interactive Media Ads SDK
Hi Puneet,

Chris is out of office today, and the team is back from the holidays, so I will be assisting you with this case going forward.

The last ad tag you provided (https://pubads.g.doubleclick.net/gampad/ads?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%3Dredirecterror&correlator=3456) is working fine in the HTML5 VSI. The first ad errors out, which leads the SDK to fall back to the next <Ad> in the original VAST response.

Is there another behavior that you expected?

Vu Chau
IMA SDK Team

Puneet Narsapur

unread,
Dec 27, 2016, 12:11:10 PM12/27/16
to Interactive Media Ads SDK
Hi Vu Chau, 

The behavior in the last ad tag I provided is exactly what I am expecting. However this behavior is not what I am seeing when I use my Ad Tag URL. 
Attaching again the two responses. 
ImaResponse.txt contains the response received from the last Ad tag i shared. 
MyResponse.txt contains the response received from my ad server. 

Both have relatively same response structure, but in MyResponse.txt the IMA HTML5 VSI doesn't fallback to the next <Ad>. It just stops processing without giving out any error. 

I am expecting the same behavior for both the responses. Can you please explain me what could be possible reason for different behavior? 

I tried replacing the first ad in ImaResponse.txt with ssp.lkqd.net wrapper url from MyResponse.txt and the behavior is the one I am getting. it doesn't fallback to the "Fallback Redirect" ad from the ImaResponse.txt. I would like the fallback to happen even with ssp.lkqd.net

Thanks and Regards,
Puneet
ImaResponse.txt
MyResponse.txt

Vu Chau (IMA SDK Team)

unread,
Dec 27, 2016, 2:45:29 PM12/27/16
to Interactive Media Ads SDK
Hi Puneet,

It looks like the culprit of this is due to VPAID ads. The IMA SDK has dedicated adManagers for VPAID ads, so in this case, since the VPAID ad errors out, we trash the adsManager as well. We therefore don't fall back on the next ad in the VAST response.

We do fall back to the next ad for like ad type (where all the ads are of the same type). Mixed ad pod (regular MP4s with VPAIDs) is something we will be working on supporting.

I'll reach out should we have more updates,

Vu Chau
IMA SDK Team

Puneet Narsapur

unread,
Jan 6, 2017, 2:48:46 AM1/6/17
to Interactive Media Ads SDK
Hi Vu Chau, 

Thanks for the reply. It does give a little hope. Any guesstimates by when this could be supported? 
Also is there a way we can get events whenever IMA sdk is trying to fallback internally? What i mean is do we get events when the first ad in the multi-ad response fails before IMA tries to play then next ad in it? 
In this particular issue i don't see any ad error being triggered at all and neither the fallback happening. I just get "All_Ads_Completed" event. 
Please let me know if we can tap into or set a event listener which can give us more details about the fallback action happening. 

Thanks and Reagards,
Puneet

Vu Chau (IMA SDK Team)

unread,
Jan 6, 2017, 10:09:04 AM1/6/17
to Interactive Media Ads SDK
Hi Puneet,

Currently we don't have a timeline for when mixed ad pod creative fallback will be supported. When support becomes official, it will be announced in the release notes and/or on our blog. Definitely keep an eye out!

There isn't an event to tell that creative fallback is taking place. The reason is that fallback happens naturally (i.e. IMA will play all ads in the pod regardless). The only event you will get back is if an individual ad has thrown an error, and that would be a creative-specific error. For example, if you play your VPAID response in the Video Suite Inspector, you will get an "AdError 901: An unexpected error occurred within the VPAID creative. Refer to the inner error for more info." for the first VPAID ad (the adsManager is no longer around for the second VPAID ad, so no additional ad error event here).

Vu Chau
IMA SDK Team

Puneet Narsapur

unread,
Jan 6, 2017, 11:24:09 AM1/6/17
to Interactive Media Ads SDK
Hi Vu, 

Thanks. I guess it makes sense. 
I am not sure if this i have raise a separate thread or not but I sometimes don't get the desired events. Instead I just get "All_Ads_Completed". 
For example with the ad response in the attached SunTrustResponse.txt and throttling the chrome developer tools network tab to GPRS for simulating ad load timeout I never get AdError with 402 error. I get "All_Ads_Completed" event in this case instead of expected adError. 

However if i use the following URL: 

which results in almost similar VAST response with MP4 linear ads, I always get AdError with 402 timeout vast error code.  

Can you please let me know what could be going wrong here? 
Appreciate all the help from you till now :) 

Thanks and Regards,
Puneet
SunTrustResponse.txt

Vu Chau (IMA SDK Team)

unread,
Jan 6, 2017, 12:01:32 PM1/6/17
to Interactive Media Ads SDK
Hi Puneet,

Have you confirmed the behavior in the Video Suite Inspector? I tested your ad response with a custom throttling profile (10 kb/s up and down, plus 1000 ms latency), and saw the SDK throwing an ad error 402 for the media load timeout. 

Vu

Puneet Narsapur

unread,
Jan 6, 2017, 1:41:56 PM1/6/17
to Interactive Media Ads SDK
Hi Vu, 

Yes I had confirmed the behavior on Video Suite Inspector (HTML version). However I am now surprised that it is now giving me that event in the event log. I will test out more on this and get back to you. I will try to start a separate thread with more details if I find anything. 

Vu Chau (IMA SDK Team)

unread,
Jan 6, 2017, 1:45:31 PM1/6/17
to Interactive Media Ads SDK
Hey Puneet,

Thanks for getting back to me. The team doesn't provide assistance via chats or calls, so the next step would be to let me see your pages where the errors aren't being thrown. 

Make sure your adsManager instance is still around for it to dispatch ad error events. We have seen some implementations where the ad error listener is blocked by some other logic on the page.

Vu

Puneet Narsapur

unread,
Jan 6, 2017, 1:48:47 PM1/6/17
to Interactive Media Ads SDK, rpid...@inform.com
Hi Vu, 

Ad Fallback logic makes sense and I am okay for now with it. I just have one additional concern over this. 

As you said that I should get a Ad Error 901 event for my VPAID ad (ssp.lkqd.net). However on HTML IMA SDK I don't get this error. Instead I get "All_Ads_Completed" event. 
Can you please let me know why this could be happening? 
lkqd.net vpaid.js is not with me for debugging so i am not sure if it is triggering correct events. I believe you can know in your code which event it is triggering and why I am not getting that event as AdError. 
It would be really helpful. 

Please let me know if we can have a direct chat session sometime next week so that we can debug this better. 

Thanks and Regards,
Puneet

Vu Chau (IMA SDK Team)

unread,
Jan 6, 2017, 2:39:54 PM1/6/17
to Interactive Media Ads SDK, rpid...@inform.com
Hi Puneet,

You don't need to know the VPAID's code in this case, because it is the SDK (not the ad) that has the error listener. Regardless of the ad type you are serving, the adsManager will thrown an error if one occurs. 

As I previously suggested, make sure you register your ad error listener with the adsManager. Then, check that you are handling the error. In the process, make sure your adsManager is still active (do a null check on it if necessary). If your ad is in a VMAP, then no fatal ad error will be thrown. The SDK will simply log the error silently, and move on to the next ad in the list. Check to make sure your VPAID ad isn't in a VMAP response.

Vu

Puneet Narsapur

unread,
Jan 9, 2017, 11:57:22 PM1/9/17
to Interactive Media Ads SDK, rpid...@inform.com
Hi Vu, 

I have registered to the ad error listener and handling the errors correctly. I even receive errors when they are fired and have tested it a lot with IMA sample tags and other Ad Tags. 
I am just not getting the ad error event for this particular ad, i.e. the ad with wrapper pointing to ssp.lkqd.net loading its own VPAID ad. 
When this particular ad is loaded instead of getting AdError event on failure IMA SDK just gives "All_Ads_Completed" event and I was hoping if you could help me in any way in identifying why its happening only for this ad. 

Thanks and Regards,
Puneet

Vu Chau (IMA SDK Team)

unread,
Jan 10, 2017, 10:09:07 AM1/10/17
to Interactive Media Ads SDK, rpid...@inform.com
Hi Puneet,

Thanks for getting back. I see that you have opened a separate thread to track the issue, and my teammate Chris is going to assist you with that.

Let me know if you need anything else,

Vu
Reply all
Reply to author
Forward
0 new messages