[IMA SDK for Android] Some ads in VMAPs are skipped/not loaded

205 views
Skip to first unread message

Ceyhun Özgöç

unread,
May 21, 2024, 4:28:39 AMMay 21
to Interactive Media Ads SDK
Hi team,

We are observing that some ads in one of our customer's VMAPs are skipped.


This is easily reproducible on the AdvancedExample if you use this ad tag. In case it helps, here is the project with that ad tag already configured: https://we.tl/t-EhtYv2xioN

Some important remarks:
  • This is consistently reproducible on Android TV (We tested on different devices, the issue doesn't seem to be device specific).
  • This is reproducible on Android mobile only when the network is throttled (to for example, 8 Mbps download speed), which brings us to the next point.
  • When an ad is skipped, the response from the ad server is not empty. The player simply waits on a black screen for 5-6 seconds before deciding to skip the ads.
  • When the issue happens, we are not seeing any useful logs or events from the IMA SDK on why the ad is skipped. However, we see a timeout exception error from the SDK before the ad is loaded, which could be related:

    { "header": { "logLevel": "ERROR", "pid": 23019, "tid": 23265, "applicationId": "com.google.ads.interactivemedia.v3.samples.videoplayerapp", "processName": "com.google.ads.interactivemedia.v3.samples.videoplayerapp", "tag": "IMASDK", "timestamp": { "seconds": 1714984596, "nanos": 106000000 } }, "message": "Error during initialization\njava.util.concurrent.ExecutionException: java.util.concurrent.TimeoutException\n\tat com.google.ads.interactivemedia.v3.internal.zzrq.zzx(com.google.ads.interactivemedia.v3:interactivemedia@@3.33.0:4)\n\tat com.google.ads.interactivemedia.v3.internal.zzrq.get(com.google.ads.interactivemedia.v3:interactivemedia@@3.33.0:3)\n\tat com.google.ads.interactivemedia.v3.internal.zzsr.zzb(com.google.ads.interactivemedia.v3:interactivemedia@@3.33.0:2)\n\tat com.google.ads.interactivemedia.v3.impl.zzu.zzr(com.google.ads.interactivemedia.v3:interactivemedia@@3.33.0:1)\n\tat com.google.ads.interactivemedia.v3.impl.zzu.zzs(com.google.ads.interactivemedia.v3:interactivemedia@@3.33.0:1)\n\tat com.google.ads.interactivemedia.v3.impl.zzu.zzc(com.google.ads.interactivemedia.v3:interactivemedia@@3.33.0:9)\n\tat com.google.ads.interactivemedia.v3.impl.zzq.call(Unknown Source:14)\n\tat com.google.ads.interactivemedia.v3.internal.zzse.zza(com.google.ads.interactivemedia.v3:interactivemedia@@3.33.0:1)\n\tat com.google.ads.interactivemedia.v3.internal.zzsy.run(com.google.ads.interactivemedia.v3:interactivemedia@@3.33.0:4)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)\n\tat java.lang.Thread.run(Thread.java:920)\nCaused by: java.util.concurrent.TimeoutException\n\tat com.google.android.gms.tasks.zzx.run(com.google.android.gms:play-services-tasks@@18.1.0:1)\n\tat android.os.Handler.handleCallback(Handler.java:938)\n\tat android.os.Handler.dispatchMessage(Handler.java:99)\n\tat android.os.Looper.loopOnce(Looper.java:201)\n\tat android.os.Looper.loop(Looper.java:288)\n\tat android.app.ActivityThread.main(ActivityThread.java:7839)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)" },
  • This is not reproducible on web when playing the same ads using the same ad tag, even while throttling the network.
  • We have investigated the issue with the ad provider and confirmed the ad tags should be set up correctly.
  • The issue is reproducible on different IMA SDK versions we tested (both 3.25.1 and 3.33.0).
Can you please share some insights on how we can further investigate if IMA SDK skips the ad due to a problem we haven't yet identified with the ad tag/media or because of an issue on the IMA SDK for Android itself?

Kind regards,
Ceyhun

IMA SDK

unread,
May 21, 2024, 10:42:50 AMMay 21
to ceyhun...@theoplayer.com, ima...@googlegroups.com

Hi,

Thank you for contacting the IMA SDK support team.

Upon executing the sample application using the provided ad tag, we observed the absence of any skippable advertisements. During our investigation using the video suite inspector, we were unable to identify any skippable advertisements.

Kindly provide us with the video recording, so that we may further examine and investigate the matter.

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, kindly provide requested information to us via reply to author option or using the steps below:

1. Navigate to
https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=IMA+SDK&entry.460850823=5004Q00002tJ2gaQAC&entry.80707362=00235836

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link. 

This message is in relation to case "ref:!00D1U01174p.!5004Q02tJ2ga:ref" (ADR-00235836)

Thanks,
 
Google Logo IMA SDK Team

 

Ceyhun Özgöç

unread,
May 22, 2024, 5:42:44 AMMay 22
to Interactive Media Ads SDK
Hi team,

I believe there has been a misunderstanding on what the described issue is. I have attached the reproduction video you requested. 

On the video, we reproduce the issue on a Redmi Note 7 throttled to 5 Mbps download speed. There should be 3 ads in the ad break as shown in the ad UI (and the ad response), however, IMA SDK plays the first 2 ads, skips the last one and afterwards the main content starts. We are expecting 3 ads to play if the VMAP includes 3 ads in its response.

This is more easily reproducible on Android TV (eg. on a Chromecast with Google TV (4K)) without any kind of throttling. We believe that some kind of an internal timeout is happening on the IMA SDK.

The ads on the VMAP we shared are indeed not skippable. The problem is the following:

1. The VMAP response includes 3 or 4 ads ads in an ad break.
2. IMA SDK for Android occasionally plays only either 2 or 3 of these ads, skipping 1-2 ads in between. For example, the ad UI shows "Ad 1 of 3" and after that one ends, suddenly switches to "Ad 3 of 3". When we check the network requests, we see that 3 ads were returned but the IMA SDK did not load the second ad.

When this happens, we are not seeing any useful logs on IMA SDK on why the ad is not played.

Please let us know if you need any other information.

Kind regards,
Ceyhun

IMA SDK

unread,
May 22, 2024, 10:44:45 AMMay 22
to ceyhun...@theoplayer.com, ima...@googlegroups.com

Hi Ceyhun,

I’ve checked your shared VAST and can see there are no ads configured inside the Vmap pre-roll bucket. You are claiming that there are 2-3 ads in which 2 ads are playing. Could you share those VAST as well? And 5-6 seconds black screen delay is expected because in the absence of valid ads, the player is retrying 3-4 times to get the correct ads. I’ve also checked in VSI allAdsCompleted event is triggering because this event specifies that all ads should run even with the error log.

Pre-roll ad URL- https://pubads.g.doubleclick.net/gampad/ads?slotname=%………

Invalid Response-

<?xml version="1.0" encoding="UTF-8"?>
<VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd" version="4.0"/>
<vmap:AdSource id="preroll-ad-1" allowMultipleAds="false" followRedirects="true">

……..

<![CDATA[ https://pubads.g.doubleclick.net/gampad/ads?slotname=/21775744923/external/vmap_ad_samples&sz=640x480&ciu_szs=300x250&cust_params=sample_ar%3Dpremidpost&url=&unviewed_position_start=1&output=xml_vast3&impl=s&env=vp&gdfp_req=1&ad_rule=0&useragent=Mozilla/5.0+(Macintosh%3B+Intel+Mac+OS+X+10_15_7)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/124.0.0.0+Safari/537.36,gzip(gfe)&vad_type=linear&vpos=preroll&pod=1&ppos=1&lip=true&min_ad_duration=0&max_ad_duration=30000&vrid=1264775&cmsid=496&video_doc_id=short_onecue&kfa=0&tfcd=0 ]]>

………

<vmap:AdSource id="midroll-1-ad-1" allowMultipleAds="false" followRedirects="true">
<vmap:AdTagURI templateType="vast3">
<![CDATA[ https://pubads.g.doubleclick.net/gampad/ads?slotname=/21775744923/external/vmap_ad_samples&sz=640x480&ciu_szs=300x250&cust_params=sample_ar%3Dpremidpost&url=&unviewed_position_start=1&output=xml_vast3&impl=s&env=vp&gdfp_req=1&ad_rule=0&cue=15000&useragent=Mozilla/5.0+(Macintosh%3B+Intel+Mac+OS+X+10_15_7)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/124.0.0.0+Safari/537.36,gzip(gfe)&vad_type=linear&vpos=midroll&pod=2&mridx=1&rmridx=1&ppos=1&lip=true&min_ad_duration=0&max_ad_duration=30000&vrid=1264775&cmsid=496&video_doc_id=short_onecue&kfa=0&tfcd=0 ]]>

………

<vmap:AdSource id="postroll-ad-1" allowMultipleAds="false" followRedirects="true">
<vmap:AdTagURI templateType="vast3">
<![CDATA[ https://pubads.g.doubleclick.net/gampad/ads?slotname=/21775744923/external/vmap_ad_samples&sz=640x480&ciu_szs=300x250&cust_params=sample_ar%3Dpremidpost&url=&unviewed_position_start=1&output=xml_vast3&impl=s&env=vp&gdfp_req=1&ad_rule=0&useragent=Mozilla/5.0+(Macintosh%3B+Intel+Mac+OS+X+10_15_7)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/124.0.0.0+Safari/537.36,gzip(gfe)&vad_type=linear&vpos=postroll&pod=3&ppos=1&lip=true&min_ad_duration=0&max_ad_duration=30000&vrid=1264775&cmsid=496&video_doc_id=short_onecue&kfa=0&tfcd=0 ]]>

……….

And try to open any ad. It will give you a response. Which is not present in your shared VMAP.

I recommend here to check your VMAP for a pre-roll ad response which is returning empty right now. And there doesn't seem to be any issue with the IMA SDK.

Ceyhun Özgöç

unread,
May 31, 2024, 6:51:37 AMMay 31
to Interactive Media Ads SDK
Hi team,

I am attaching a VAST response here with 2 ads in it. This is from a different VMAP than the one we originally shared, where we can also reproduce the issue.

We are seeing one of the following behaviors with this:
- On a fast (> 100 mbps), stable network, ads play perfectly fine.
- On slower networks (6-20 mbps), especially on Android TV:
        - First ad 'pauses' by itself after a few seconds of initial playback. We need to call play() to resume it.
        - First ad 'freezes' after a few seconds of playback. IMA SDK afterwards immediately skips to the main content. The rest of the first ad + second ad is somehow skipped.
        - First ad plays fine. Second ad doesn't load after a long black screen. It gets skipped and the main content plays.

This issue, once again, is more noticeable when the network is throttled, especially on Android TV (but also on Android). The issue is not reproducible on the VSI.

Can you let us know if you can access the ads this time? If you can reproduce the issue, do see any issues with the ad tag or ad media files?

Thank you very much for your support.

Kind regards,
Ceyhun
test-ad-tag.xml

IMA SDK

unread,
May 31, 2024, 4:26:03 PMMay 31
to ceyhun...@theoplayer.com, ima...@googlegroups.com
Hi Ceyhun,

Thanks you for sharing VAST detail.
I've checked your first query where ads were not loading and immediately skipped with shared VAST url.
Looks like VAST is not containing any valid ads. When i tried to open that URL, it was showing empty response.

Since you are utilizing VMAP response in which player might called load event for that but after that player did not get any valid response. So player might be retrying 4-5 times to get the expected result. Till that time showing black screen is expected thing from the player. Here you can increase time out value and try again.

For second issue related to xml file which shared in previous thread. I put that in VSI and observed ad1 is throwing 400 error with message: "Assertion failed" 
Error play dispatched: AdError 400: There was an error playing the video ad. Caused by: AssertionError: Assertion failed
Reporting urls for event : verificationNotExecuted 

This error generally come when player trying to load corrupted ad files.
This fatal error can be caused when a video player is unable to display the linear ad. It may occur when the MediaFile is not a valid video file of the specified format, or because the browser restricted autoplay with sound, or another unknown reason.

I removed defected ad1 manually and tried playing in VSI and it is was not showing error then.
My recommendation here is to resolve the error for ad 1 and if possible could you check by removing this ad1 from the vast and check the behavior if it still stuck then provide us excluding ad1 vast url for further investigation.

IMA SDK

unread,
Jun 5, 2024, 7:54:38 PM (11 days ago) Jun 5
to ima...@googlegroups.com, ceyhun...@theoplayer.com, jason...@google.com
Hello Ceyhun,

This is Jackson from the IMA SDK team to help you with this issue.

Looking at the 'test-ad-tag.xml' with the 2 ads, I see the first ad has 3 <MediaFile> nodes where the lowest bitrate is 2187. For the second ad there are 10+ <MediaFile> nodes, with much lower bitrates, like 299.

I think IMA is correctly handling the first ad, where it is not able to load the ad within 8 seconds in certain environments and skips it.

To solve this, you could set up your ad tags to have lower bitrate options for all creatives in the ad tag. I think this will need to be configure in Google Ad Manager or other ad provider.

Another option would be to preload the ads. On Android you can follow the preloading guide to set up preloading in your own player, or use the ExoPlayer-IMA extension (getting started guide) which has preloading enabled by default.

Please let me know if that works for you, or if you have any questions.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tJ2ga:ref" (ADR-00235836)

Thanks,
 
Google Logo
Jackson Sui
IMA SDK Team


Ceyhun Özgöç

unread,
Jun 6, 2024, 4:24:01 AM (10 days ago) Jun 6
to Interactive Media Ads SDK
Hi Jackson,

Thank you very much for your feedback.

Let's take this from the beginning. I would like to make sure you can reproduce the issue we are seeing on your side first and then take it step by step towards a solution. I will once again summarize the issue so all the information is here:

We are seeing one of the following behaviors on Android/Android TV, on an ad break:
- On a fast (> 100 mbps), stable network, ads play perfectly fine.
- On slower networks (6-20 mbps), especially on Android TV (but also on Android):
        - Sometimes ads 'pause' after a few seconds of initial playback. We need to call play() to resume it.
        - Some ads 'freeze' after a few seconds of playback. IMA SDK afterwards immediately skips to the main content. The rest of the active ad + second ad is somehow skipped.
        - First ad plays fine. Second ad doesn't load after a long black screen. It gets skipped and the main content plays.

Here is one of the ad tags we are using: Ad tag. In case you get an empty response: 






We are aware that the bitrates between ads are not very consistent. To work around it, we have tried setting the following but had no change in behavior. Setting preload also haven't helped:

      adsRenderingSettings.setEnablePreloading(true);
      adsRenderingSettings.setBitrateKbps(5000);

The test setup is with a Pixel 5 (Android 14) on a WiFi network throttled to 8 Mbps. On the VSI page, the ads are playing fine even when we throttle the browser tab using devTools with the same ad tag so the issue is only on Android/Android TV.

Now that we have summarized the issue, as the first step can you please confirm you can reproduce this on your side?

Kind regards,
Ceyhun

IMA SDK

unread,
Jun 6, 2024, 9:40:51 AM (10 days ago) Jun 6
to ceyhun...@theoplayer.com, ima...@googlegroups.com
Hello Ceyhun,

Thank you for the reply.

For the custom preloading implementation. After calling 'adsRenderingSettings.setEnablePreloading(true);', can you confirm your are also implementing the additional changes detailed in the Supporting preloading with a custom VideoAdPlayer  section of the guide? Such as indexing/tracking AdMediaInfo that are returned ahead of time. These code changes can be somewhat complex depending on how your VideoAdPlayer is set up, which is why we recommend using ExoPlayer with the IMA extension.

That said, even with preloading enabled, depending on network and device type, ads (especially pre-roll ads) may still be slow to load.

Once I hear back about your preloading setup, I can start to investigate if there are any optimizations there or in the SDK that may help you.

Please let me know if you have any questions.

Ceyhun Özgöç

unread,
Jun 6, 2024, 10:36:49 AM (10 days ago) Jun 6
to Interactive Media Ads SDK
Hi Jackson,

Am I right to understand the AdvancedExample doesn't include the logic needed to actually preload the ads after passing setEnablePreloading(true); to the IMA SDK?

Preload or not, the ads I believe should still be loaded on the scenario I explained. This is the ad IMA is skipping on the video I shared:

```
<MediaFiles>
<Mezzanine>
<![CDATA[https://redirector.gvt1.com/videoplayback/id/ccdfb90ba9e43718/itag/15/source/dclk_video_ads/requiressl/yes/acao/yes/mime/video%2Fmp4/ctier/L/ip/0.0.0.0/ipbits/0/expire/1717681531/sparams/ip,ipbits,expire,id,itag,source,requiressl,acao,mime,ctier/signature/9B943B83651D2E3F3E3FA624F5484FCCC0616109.37F629B361F95FC99106CAD922325D4E958F1E5D/key/ck2/file/file.mp4]]>
</Mezzanine>
<MediaFile id="GDFP" delivery="progressive" width="1280" height="720" type="video/mp4" bitrate="2187" scalable="true" maintainAspectRatio="true">
<![CDATA[https://redirector.gvt1.com/videoplayback/id/ccdfb90ba9e43718/itag/22/source/dclk_video_ads/requiressl/yes/acao/yes/mime/video%2Fmp4/ctier/L/ip/0.0.0.0/ipbits/0/expire/1717681531/sparams/ip,ipbits,expire,id,itag,source,requiressl,acao,mime,ctier/signature/B54548E11883A1B54480FDAF690718C552589F2D.67AA288109813090759A76A16EAEC7D5EF6A33FD/key/ck2/file/file.mp4]]>
</MediaFile>
<MediaFile id="GDFP" delivery="progressive" width="1920" height="1080" type="video/mp4" bitrate="4492" scalable="true" maintainAspectRatio="true">
<![CDATA[https://redirector.gvt1.com/videoplayback/id/ccdfb90ba9e43718/itag/37/source/dclk_video_ads/requiressl/yes/acao/yes/mime/video%2Fmp4/ctier/L/ip/0.0.0.0/ipbits/0/expire/1717681531/sparams/ip,ipbits,expire,id,itag,source,requiressl,acao,mime,ctier/signature/59A0351F8472BFE4166906B8EEAEA85077322C61.82A35079515095FB0908BB956B67A89AA70D2E93/key/ck2/file/file.mp4]]>
</MediaFile>
<MediaFile id="GDFP" delivery="progressive" width="1280" height="720" type="video/mp4" bitrate="2956" scalable="true" maintainAspectRatio="true">
<![CDATA[https://redirector.gvt1.com/videoplayback/id/ccdfb90ba9e43718/itag/106/source/dclk_video_ads/requiressl/yes/acao/yes/mime/video%2Fmp4/ctier/L/ip/0.0.0.0/ipbits/0/expire/1717681531/sparams/ip,ipbits,expire,id,itag,source,requiressl,acao,mime,ctier/signature/AB998121D953C431CA0BCF04463625FEE650D6F1.5CBD1864C6AEE7C3620B7EA8AA39FDE8486D175B/key/ck2/file/file.mp4]]>
</MediaFile>
</MediaFiles>
```


The file is only 11,3 MB. And according to ffprobe:  Duration: 00:00:20.06, start: 0.000000, bitrate: 4507 kb/s, so the bitrate is also accurate.

Does IMA SDK wait for the full media file to be downloaded (instead of downloading it progressively) before it attempts to load and play it back? And if it takes longer than 8 seconds just skips the ad?

Kind regards,
Ceyhun

IMA SDK

unread,
Jun 6, 2024, 11:40:52 AM (10 days ago) Jun 6
to ceyhun...@theoplayer.com, ima...@googlegroups.com
Hello Ceyhun,

That is correct, the Advanced Example is not set up to preload ads out of the box, the changes detailed in the preloading guide must be made to support preloading.

IMA usually does not fully load the creative when ad playback begins. You can also try setting AdsRenderingSettings.setLoadVideoTimeout to update the time IMA will wait to load ads.

IMA SDK

unread,
Jun 7, 2024, 9:04:01 AM (9 days ago) Jun 7
to ima...@googlegroups.com, ceyhun...@theoplayer.com, bart.ve...@adsanddata.be, daniel...@theoplayer.com, david....@vrt.be, dimitri...@adsanddata.be, guy.l...@vrt.be, jason...@google.com, kva...@google.com, matthias....@vrt.be, peter.v...@vrt.be, ruben....@vrt.be, tdu...@google.com, thomas....@theoplayer.com
Hello all,

This is Jackson from the IMA SDK team, following up from our meeting earlier today (VRT / IMA / THEOplayer Issue ). I've added everyone to this thread. I will follow up with all updates I have on this issue as I investigate.

Ceyhun Özgöç

unread,
Jun 11, 2024, 4:36:38 AM (5 days ago) Jun 11
to Interactive Media Ads SDK
Hi Jackson,

I have just seen your mail about having trouble reproducing this issue and requestin resources. We have already shared everything necessary when we first reached out on 21 May (and alter on shared a recording of the reproduction via Google Forms).

I had also aggregated all the resources (IMA sample, ad tags, reproduction video) once again a few replies back here last week: https://groups.google.com/g/ima-sdk/c/MKrNJ-uqIRk/m/f8iWLPQnEwAJ

Can you let me know what kind of an issue are you having with reproduction?

To summarize:
1. The issue on on Android TV (mainly) and Android: We see this on different devices, such as Chromecast with Google TV (4K), Mi Box 3, Nvidia Shield ...
2. Please use the original ad tag link we shared (here is another one just in case), the links inside the static ones I shared may have expired already.
3. Make sure that you are seeing ads in Dutch (from Belgium), if that's not the case, try using VPN to Belgium as I'm not sure if there is a region specific setting on the ad server side.

You don't have to throttle the network, it just makes it more noticeable. It looks like IMA SDK is not fast enough to fetch the ad media files (especially if they are about 6000-20000 kbps in bitrate, even on the 100-120 Mbps network we are testing on), causing a timeout or long 'pauses' during ad playback as it runs out of buffer. We are seeing that limiting bitrate to around 2500 kbps helps but we don't understand how/why the media files are not fetched fast enough.

Kind regards,
Ceyhun

IMA SDK

unread,
Jun 11, 2024, 10:20:39 AM (5 days ago) Jun 11
to ceyhun...@theoplayer.com, ima...@googlegroups.com
Hello Ceyhun,

Thanks for clarifying the testing conditions. I think I was able to reproduce the behavior, where ads would take about 4 seconds to load. I tested with the attached VAST xml.

When testing, I saw that by adding 'adsRenderingSettings.setBitrateKbps(100);', ads loaded much quicker, but were lower quality.

Also, when testing in the ExoPlayer sample app, I see ads load quicker, which suggests that enabling preloading (or using the exoplayer IMA extension) could also be a solution.

I see that this reply was sent directly to the IMA forum, without the other cc-ed. Please let me know if you would like me to add the rest in cc moving forward.
vrt-test-vast.xml
Reply all
Reply to author
Forward
0 new messages