Processing multiple NonLinear ads inside a VAST XML Document and problem on iframe not hiding when a non-linear video ad ends playback.

1,420 views
Skip to first unread message

Giovanni

unread,
Jul 12, 2017, 6:55:34 AM7/12/17
to Interactive Media Ads SDK
Hi,

I'm a bit in trouble and i've two questions for you

I'm using your sample which i found on github (https://github.com/googleads/googleads-ima-html5/tree/master/simple)

Is there any way to process multiple nonLinear ads within the same VAST xml file (under the <NonLinearsAds> tag name) and show them both in two different parts of the video player overlaying?

Second, i was wondering why when the Google IMA SDK reproduces a nonLInear Ad, when an ad finishes, it DOES NOT hide by default the iframe where it is displayed (or better, the iframe which src is an HTML view-source:https://imasdk.googleapis.com/js/core/bridge3.173.4_en.html that generates the iframe where the ad is displayed). You can check what through your Video Suite Inspector giving the following input:


<VAST version="2.0" >
<Ad id="22175">
<InLine>
<AdSystem version="v0.2.225"><![CDATA[Acudeo Compatible]]></AdSystem>
   
<AdTitle> <![CDATA[Vast test]]></AdTitle>
   
<Impression>
   <![CDATA[ about:blank ]]>
   
</Impression>
   
<Creatives>
   
<Creative sequence="1">
<NonLinearAds>
<NonLinear height="100" width="150" maintainAspectRatio="true" scalable="true" >
<StaticResource creativeType="video/mp4">
<![CDATA[https://stormapp.herokuapp.com/resource/video/360/venezia_square_360.mp4]]>
</StaticResource>
<NonLinearClickThrough><![CDATA[http://www.jwplayer.com]]></NonLinearClickThrough>
</NonLinear>
   

</NonLinearAds>
</Creative>
   
</Creatives>
</InLine>
</Ad>
</VAST>

Inserisci qui il codice...


Giovanni

unread,
Jul 12, 2017, 11:03:29 AM7/12/17
to Interactive Media Ads SDK
Should i use VMAP to solve the first issue?

Chris Feldman (IMA SDK Team)

unread,
Jul 12, 2017, 11:53:39 AM7/12/17
to Interactive Media Ads SDK
Hi,

Thank you for reaching out to support. To address your questions:

Is there any way to process multiple nonLinear ads within the same VAST xml file (under the <NonLinearsAds> tag name) and show them both in two different parts of the video player overlaying?
I am not aware of a way to show two non linear ads at one time. If this is something you're interested in, I would suggest first reading through our ad serving guidelines. If you want to show two different ads, one after another then I would suggest using VMAP.
Second, i was wondering why when the Google IMA SDK reproduces a nonLInear Ad, when an ad finishes, it DOES NOT hide by default the iframe where it is displayed (or better, the iframe which src is an HTML view-source:https://imasdk.googleapis.com/js/core/bridge3.173.4_en.html that generates the iframe where the ad is displayed). You can check what through your Video Suite Inspector giving the following input:
The non linear ad that you included in your post is not associated with a duration, which means the SDK will show the ad from content start to content finish. Did you want the ad hidden when the ad's video ended? If so, that isn't possible. The SDK doesn't know the duration of the video ad that's being played.

Regards,
Chris Feldman
IMA SDK Team

Giovanni

unread,
Jul 25, 2017, 10:54:51 AM7/25/17
to Interactive Media Ads SDK
Hi i'm still having trouble on how letting the SDK know about the video ad's duration. Like explained in the VAST 3.0 xsd (https://github.com/chrisdinn/vast/blob/master/lib/vast3_draft.xsd) the minSuggestedDuration parameter of the complexType "NonLinear_Type" at line 797 "
Suggested duration to display non-linear ad, typically for animation to complete. Expressed in standard time format hh:mm:ss" and I tried it with this code, but it doesn't work at all:

<VAST version="3.0" >

<Ad id="22175">
<InLine>
<AdSystem version="v0.2.225"><![CDATA[Acudeo Compatible]]></AdSystem>
   
<AdTitle> <![CDATA[Vast test]]></AdTitle>
   
<Impression>
   <![CDATA[ about:blank ]]>
   
</Impression>
   
<Creatives>
   
<Creative sequence="1">
<NonLinearAds>
<NonLinear height="100" width="150" maintainAspectRatio="true" scalable="true" minSuggestedDuration="00:00:35">

<StaticResource creativeType="video/mp4">
<![CDATA[https://stormapp.herokuapp.com/resource/video/360/venezia_square_360.mp4]]>
</StaticResource>
<NonLinearClickThrough><![CDATA[http://www.jwplayer.com]]></NonLinearClickThrough>
</NonLinear>
   
</NonLinearAds>
</Creative>
   
</Creatives>
</InLine>
</Ad>
</VAST>

Furthermore, I've not understood yet whether that's only a problem of letting the SDK know the duration of the video somehow (How?) or it's not possible at all.

Chris Feldman (IMA SDK Team)

unread,
Jul 25, 2017, 2:55:34 PM7/25/17
to Interactive Media Ads SDK
Hi Giovanni,

I've been doing some testing and I'm only able to get the minSuggestDuration to work if the ad tag is wrapped in a VMAP tag. For example, the ad disappears after 35 seconds when I embed your tag and redirect to it inside of this response:

<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">
   <vmap:AdBreak timeOffset="start" breakType="linear" breakId="preroll-1">
      <vmap:AdSource id="preroll-ad-1" allowMultipleAds="false" followRedirects="true">
         <vmap:AdTagURI templateType="vast3">
            <![CDATA[
            **LINK TO YOUR AD TAG HERE**
            ]]>
      </vmap:AdSource>
   </vmap:AdBreak>
</vmap:VMAP>

If you want to use your ad tag with the single ad then another option would be to destroy your adsManager when you want the ad to stop.

Let me know if you continue to have issues.

Regards,
Chris Feldman
IMA SDK Team

Giovanni

unread,
Jul 26, 2017, 6:59:34 AM7/26/17
to Interactive Media Ads SDK
Hi, thanks for the reply

I'm wondering now how to put this vmap code request inside a adsRequest.adTagUrl instruction with no errors. Can you explain how to do that please, or better give me an example? Thank you

Chris Feldman (IMA SDK Team)

unread,
Jul 26, 2017, 1:19:45 PM7/26/17
to Interactive Media Ads SDK
Hi Giovanni,

A VMAP tag can be used in the same way as a VAST tag. The XML document needs to be hosted online so you can direct the SDK to it with a URL. In this case, you would need a URL for the VMAP tag and another for the original non linear VAST tag.

So you can see what I mean, I went ahead and put the tags on GitHub. Here is a link to the original non linear ad. And here is a link to the VMAP response with the non linear ad embedded. In this case, you would just need to use adsRequest.adTagUrl = 'https://chris-feldman.github.io/ima-samples/vmap-for-nonlinear.xml'You should host the ad yourself, or use an ad service when you implement this on your own site, but this should be useful as a proof of concept.

Please let me know if you have any further questions.

Regards,
Chris Feldman
IMA SDK Team

Giovanni

unread,
Jul 31, 2017, 10:44:43 AM7/31/17
to Interactive Media Ads SDK
Hi thanks again for your reply,

I have 2 more questions:

It isn't a way to pause even the video overlay when i pause the playback of the overlayed video, is it? In other words, I want the overlaying and overlayed videoes to play synchronously.

Is there a way to choose the exact (x,y) position that the imported document' iframe (the one where the ad displays) must have inside the iframe that Google IMA uses to import the document, aka the one whose HTML whose external HTML is like this:
<iframe src="http://imasdk.googleapis.com/js/core/bridge3.174.0_en.html#goog_332014209" allowfullscreen="" style="border: 0px none; opacity: 1; margin: 0px; padding: 0px; position: relative; pointer-events: none;" width="xxx" height="yyy"></iframe>



Chris Feldman (IMA SDK Team)

unread,
Jul 31, 2017, 1:41:47 PM7/31/17
to Interactive Media Ads SDK
Hi,

It is possible to manually set the placement for a non-linear ad. You can do so with the autoAlign property of your AdsRenderingSettings object. Setting autoAlign to false will allow you fine grained control of your AdDisplayContainer's placement.

As far as pausing ad playback on your overlay - this is not possible. I should have mentioned from the start that we don't currently support using an mp4 as a <StaticResource>. Although it currently seems to be functioning, there's no guarantee that this will continue to work in the future. 

Please let me know if you have any further questions.

Regards,
Chris Feldman
IMA SDK Team

Giovanni

unread,
Aug 1, 2017, 9:07:24 AM8/1/17
to Interactive Media Ads SDK
Thanks Chris,

I was not able to understand how to set the (x,y) position inside the adContainer for an Ad (nonLinear Ad with a StaticResource) after I set the autoAlign to false. Have I to do that with VAST or with IMA APIs?

Chris Feldman (IMA SDK Team)

unread,
Aug 1, 2017, 11:36:38 AM8/1/17
to Interactive Media Ads SDK
Hi,

So by default, the SDK will position non-linear ads in the bottom center of the adDisplayContainer. However, if you set autoAlign = false, the SDK will instead position the non-linear ad at the top left corner (0, 0) of the adDisplayContainer. When using autoAlign = false, it is up to you to use CSS/HTML5 to set the size and position of your adDisplayContainer to whatever works best for you. For more information, you can take a look at this page in our documentation. That specific guide is a part of our Flash docs, but the concepts also apply to HTML5.

Please let me know if you have any further questions.

Regards,
Chris Feldman
IMA SDK Team

Giovanni

unread,
Aug 28, 2017, 2:39:21 PM8/28/17
to Interactive Media Ads SDK
Hi Chris,

Thanks again for your reply,
Doing some tests here https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis with input https://raw.githubusercontent.com/FraMog/hello-world/master/opacity/VmapTest.xml i noticed that your api after about 40-50 seconds since the media ad has started to be displayed changes the value of opacity showing the ad more opaque. Specifically it changes the value at line "
<div class="ima-container autoalign" style="transition: opacity 0.4s ease 0s;">...</div>"

to

<div class="ima-container autoalign" style="transition: opacity 0.4s ease 0s; opacity: 0.3;">...</div>

making a CSS3 transition, and the value of opacity remains until i hover the ad with the cursor and the opacity turns back to 1. I don't want this, I'd like to have the add displayed with full opacity till its end, is possible to achieve this in any way?

Chris Feldman (IMA SDK Team)

unread,
Aug 28, 2017, 3:07:03 PM8/28/17
to Interactive Media Ads SDK
Hi Giovanni,

At this time, there is no way to change this behavior. I'm going to confer with the rest of our team about whether or not this is something we may be able to support in the future. I will let you know as soon as I have an update.

Regards,
Chris Feldman
IMA SDK Team

Message has been deleted

Giovanni

unread,
Aug 29, 2017, 1:45:20 PM8/29/17
to Interactive Media Ads SDK
Thanks Chris,

I've got another question for you; some of the ad events seem not working as expected with nonlinear ads.
For example the google.ima.AdEvent.Type.
COMPLETE event isn't fired when a non linear ad has been shown completely (of course for the ad "duration" I mean the minSuggestedDuration property) but it is fired only with linear ads. Is there another way to detech the end of a single nonLinear ad?

Chris Feldman (IMA SDK Team)

unread,
Aug 29, 2017, 2:58:01 PM8/29/17
to Interactive Media Ads SDK
Hi Giovanni,

Our team is currently reviewing whether or not we will be able to support the COMPLETE event for non-linear ads. I'm going to make a note that this is something you're interested in and I will let you know as soon as we have an update.

Regards,
Chris Feldman
IMA SDK Team

Giovanni

unread,
Aug 30, 2017, 1:58:48 PM8/30/17
to Interactive Media Ads SDK
Thanks Chris,

I'm now trying to show also a companion ad accompanying a non-linear's one, but I wasn't able to make it work, can you help me again please

Here's my code:
<VAST version="3.0" >
<Ad id="22175">
<InLine>
<AdSystem version="v0.2.225"><![CDATA[Acudeo Compatible]]></AdSystem>
   <AdTitle> <![CDATA[Vast test]]></AdTitle>
   <Impression>
   <![CDATA[ about:blank ]]>
   </Impression>
   <Creatives>
   <Creative sequence="1">
<NonLinearAds>

<NonLinear height="180" width="320" maintainAspectRatio="true" scalable="true" minSuggestedDuration="00:01:20">

<StaticResource creativeType="video/mp4">
<![CDATA[https://stormapp.herokuapp.com/resource/video/360/venezia_square_360.mp4]]>

</StaticResource>
<NonLinearClickThrough><![CDATA[http://www.jwplayer.com]]></NonLinearClickThrough>
</NonLinear>
  
</NonLinearAds>
</Creative>



<Creative sequence = "2">

<CompanionAds>

<Companion width="302" height="252" adSlotId="mediumRectangle">
<StaticResource creativeType="image/png">
<![CDATA[https://pbs.twimg.com/media/C-RgNIEWAAE5UWL.png]]>
<!-- <![CDATA[http://www.napolidavivere.it/wp-content/uploads/2017/01/Incontri-di-Archeologia-gratuiti-al-MANN-il-Museo-Archeologico-Nazionale-di-Napoli-640x360-640x360.jpg]]>  -->
</StaticResource>
</Companion>
</CompanionAds>

Chris Feldman (IMA SDK Team)

unread,
Aug 30, 2017, 3:03:05 PM8/30/17
to Interactive Media Ads SDK
Hi Giovanni,

I don't think there's anything wrong with your VAST response, technically. But you need to make sure that you have a companion div that matches the size of your ad. I wasn't able to show your companion in the VSI with the size set at 302x252, but it shows without issue when I change the height and width to 300x250.

Let me know if you continue to have issues.

Regards,
Chris Feldman
IMA SDK Team

Message has been deleted
Message has been deleted

Giovanni

unread,
Sep 5, 2017, 8:40:56 AM9/5/17
to Interactive Media Ads SDK
Hi Chris,

Thanks again for your reply,

I'm now having issues with companion ads, with interface google.ima.CompanionAd which seeems not to be working as described in the documentation. Here's my code which is part of google.ima.AdEvent.Type.
STARTED event handler:
var ad = adEvent.getAd();
           
var selectionCriteria = new google.ima.CompanionAdSelectionSettings();
            selectionCriteria
.resourceType = google.ima.CompanionAdSelectionSettings.ResourceType.STATIC;
            selectionCriteria
.creativeType = google.ima.CompanionAdSelectionSettings.CreativeType.ALL;
            selectionCriteria
.sizeCriteria = google.ima.CompanionAdSelectionSettings.SizeCriteria.IGNORE;
           
var companionAds = ad.getCompanionAds(320, 180, selectionCriteria);
           
var q;
           
for (q=0; q <companionAds.length; q++){
               
var companionAd = companionAds[q];
                alert(companionAd.getContentType());
                alert(companionAd.getAdSlotId());
            }

The output for companionAd.getContentType() is always "Other" disregarding what is set in the creativeType attribute of a StaticResource.
companionAd.getAdSlotId() instead is not recognized as a function as you can see in the following image

This is the VAST XML Response I used for testing:
 
<VAST version="3.0">
   
<Ad id="22175">
       
<InLine>
           
<AdSystem version="v0.2.225"><![CDATA[Acudeo Compatible]]></AdSystem>
           
<AdTitle> <![CDATA[Vast test]]></AdTitle>
           
<Impression>
   <![CDATA[ about:blank ]]>
           
</Impression>
           
<Creatives>
               
<Creative>

                   
<NonLinearAds>

                       
<NonLinear height="180" width="320" maintainAspectRatio="true"
                           
scalable="true" minSuggestedDuration="00:01:20">
                           
<StaticResource creativeType="video/mp4">
<![CDATA[https://stormapp.herokuapp.com/resource/video/360/venezia_square_360.mp4]]>
                               
<!-- <![CDATA[http://www.napolidavivere.it/wp-content/uploads/2017/01/Incontri-di-Archeologia-gratuiti-al-MANN-il-Museo-Archeologico-Nazionale-di-Napoli-640x360-640x360.jpg]]> -->
                           
</StaticResource>
                           
<NonLinearClickThrough><![CDATA[http://www.jwplayer.com]]></NonLinearClickThrough>
                       
</NonLinear>

                   
</NonLinearAds>
               
</Creative>



               
<Creative>

                   
<CompanionAds required="all">

                       
<Companion width="400" height="200" adSlotId ="companion-ad1">
                           
<StaticResource creativeType="video/mp4">
<![CDATA[https://i.giphy.com/media/641arBi22PAty/giphy.mp4]]>
                           
                             
</StaticResource>
                       
</Companion>
   
                       
<Companion width="320" height="180"   adSlotId ="companion-ad2">
                           
<StaticResource creativeType="video/mp4">
<![CDATA[https://stormapp.herokuapp.com/resource/video/360/venezia_square_360.mp4]]>
                           
</StaticResource>
                       
</Companion>
                       
                           
<Companion width="100" height="100"   adSlotId ="companion-ad3">
                           
<StaticResource creativeType="audio/mp3">
<![CDATA[https://www.sample-videos.com/audio/mp3/crowd-cheering.mp3]]>
                           
</StaticResource>

Chris Feldman (IMA SDK Team)

unread,
Sep 5, 2017, 3:07:35 PM9/5/17
to Interactive Media Ads SDK
Hi Giovanni,

Thank you for reaching out. The creative types that you're using for these companion ads are not specified in the VAST standard for companions (page 38), and therefore are not supported by our SDK. I've included the relevant section below:

StaticResource: Describes non-html creative where an attribute for creativeType is used to identify the creative resource platform. The video player uses the creativeType information to
determine how to display the resource:
  • Image/gif, image/jpeg, image/png: displayed using the HTML tag <img> and the resource URI as the src attribute.
  • Application/x-javascript: displayed using the HTML tag <script> and the resource URI as the src attribute.
Also, as this thread now contains multiple issues, I ask that if you have more questions in the future that you please open a new thread.

Thank you,
Chris Feldman
IMA SDK Team 
Reply all
Reply to author
Forward
0 new messages