Companion Ads Pre-Loading

149 views
Skip to first unread message

Andrey Shmigelsky

unread,
Jul 7, 2020, 10:46:31 AM7/7/20
to Interactive Media Ads SDK
I'm using IMA client side SDK, everything is working except the creative of HtmlResource is loaded even before I choosing the correct companion ad to show. Also for some reason it fires the beacons of first HtmlResource type companion banner.

I think it's related to the fact that companion ads can be accessed only on "STARTED" event and by that time it seems like SDK already trying to pre-load all companion ads. Though I don't really understand why it tries to preload only HtmlResource (I have static an iframe as well there).

Is there a way to disable this behavior and not send any beacons before I run ad.getCompanionAds(320, 50, selectionCriteria); method?



Here is a wrapper tag: https://dumpz.org/bCsmmE2RAy6N
And the final tag: https://dumpz.org/bBdd7MnxmGmt


And here is a test page that you can see what happens https://andrey-lander-audience.ngrok.io/test.html

IMA SDK

unread,
Jul 7, 2020, 4:33:53 PM7/7/20
to andrey....@gmail.com, ima...@googlegroups.com
Hi Andrey,

Thank you for reaching out to us. Can you be more specific about the behavior you want to disable? The Ad data being available only during the STARTED event is an expected behavior and cannot be disabled. The CompanionAd data is part of the Ad Data and can only be accessed during the STARTED event. I'm curious to see how the beacons of first HtmlResource type companion banner is fired. Can you share a video recording showing the beacon being fired before you can call the ad.getCompanionAds(320, 50, selectionCriteria)?

Regards,
Arnaud Casame
IMA SDK Team


ref:_00D1U1174p._5004Q21jl58:ref

Andrey Shmigelsky

unread,
Jul 8, 2020, 2:46:52 AM7/8/20
to Interactive Media Ads SDK

Here is the JS code I have:

var videoDomElement;
var adDomElement;
var adDisplayContainer;
var adsLoader;
var adsManager;

window.addEventListener('load', function(event) {
   
videoDomElement = document.getElementById('video-dom-element');
   
videoDomElement.setAttribute("currentTime", 0);
   
videoDomElement.addEventListener('click', Initialize);

   
adDomElement = document.getElementById('ad-dom-element');
});

function Initialize(event) {
   
adDisplayContainer = new google.ima.AdDisplayContainer(adDomElement, videoDomElement);
   
adDisplayContainer.initialize();

   
adsLoader = new google.ima.AdsLoader(adDisplayContainer);
   
adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
       
onAdsManagerLoaded, false);
   
adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, onAdError, false);

   
var adsRequest = new google.ima.AdsRequest();
   
adsRequest.adTagUrl = 'https://x3.instreamatic.com/v3/vast/1218';
   
adsRequest.linearAdSlotWidth = 320;
   
adsRequest.linearAdSlotHeight = 50;
   
adsRequest.nonLinearAdSlotWidth = 320;
   
adsRequest.nonLinearAdSlotHeight = 50;

   
adsLoader.requestAds(adsRequest);
}

function onAdsManagerLoaded(adsManagerLoadedEvent) {
   
adsManager = adsManagerLoadedEvent.getAdsManager(videoDomElement);
   
adsManager.init(320, 50, google.ima.ViewMode.NORMAL);
   
adsManager.start();

   
// adsManager.addEventListener(google.ima.AdEvent.Type.STARTED, onAdStarted);
}

function onAdError(adErrorEvent) {
   
console.log(adErrorEvent.getError());
}


You can see that I even commented onAdStarted event and never call getCompanionAds, in network activity I see that companion HtmlSrouces still loaded.

Here is a full example with Html and CSS. Just click on the image to start the ad

IMA SDK

unread,
Jul 8, 2020, 8:19:58 AM7/8/20
to andrey....@gmail.com, ima...@googlegroups.com

Hi Andrey,

Thank you for your response and for sharing this example. As per our documentation, by default companion ads are enabled for each ad request, explaining why the HTML resources for companions are being requested even without using the getCompanionAds method.

Regards,
Sherwin Diesta
IMA SDK Team



ref:_00D1U1174p._5004Q21jl58:ref

Andrey Shmigelsky

unread,
Jul 8, 2020, 9:07:58 AM7/8/20
to Interactive Media Ads SDK
Hi Sherwin,

Thanks for reply. 

Is there a plan to make this behavior configurable? Looks like it's something Google specific and never an expected behavior when running other network's companions ads. 

IMA SDK

unread,
Jul 8, 2020, 2:10:44 PM7/8/20
to andrey....@gmail.com, ima...@googlegroups.com
Hi Andrey,

Allow me to create this feature request and pass it over to the rest of our team. However, I cannot guarantee if and when this would be made available.
In the meantime, you may continue to follow our release history and our blog for updates regarding this feature.

Regards,
Arnaud Casame
IMA SDK Team


ref:_00D1U1174p._5004Q21jl58:ref

Andrey Shmigelsky

unread,
Jul 9, 2020, 1:11:52 AM7/9/20
to Interactive Media Ads SDK
Thanks Arnaud, 

I hope this change will go to release one day. 
Reply all
Reply to author
Forward
0 new messages