Showing results for 
Search instead for 
Do you mean 
If you don't find an answer, please click here to post your question.

Displaying Companion Ads for Google IMA V3

0 Kudos
Started ‎09-25-2013 by
Modified ‎11-02-2016 by

Displaying Companion Ads for Google IMA V3

by Ooyalan ‎09-25-2013 11:56 AM - edited ‎11-02-2016 08:18 AM (1,695 Views)

TS-00225 Player

Displaying Companion Ads for Google IMA V3 


Directions on how to display Companion Ads for assets that have a Google IMA V3 Ad Tag containing Companion Ads.


Device Compatibility

Flash, iOS

Operative System

Windows, Mac OSX, iOS, Android



Troubleshooting tools






Using a DoubleClick VAST Tag, the Ooyala Player V3 listens to the WILL_SHOW_COMPANION_ADS event before displaying companion Ads, it is through this event, that users can read the content of the Ad Tag and display on their site as necessary.


For Google IMA V3, a different set up is needed.



You need to lod the following JS code from Google, ideally inside the <head> element of your tag:

<script src="//"></script>



In the body of your web page, create the Ooyala Player, create the necessary divs to display the companion ads, and set the following script from Google’s Publisher Tag API:


googletag.cmd.push(function() {

var adSlot1 = googletag.defineSlot(

'Ad Unit Name',

[300, 250],







The Companion Ad data is set in the defineSlot method, which requires 3 parameters:

    Ad Unit Name - This information is provided directly to the Google IMA Customer.

    Size of the companion ad - This is specified as an array [width, height]

    ID of the Div Container - The actual ID of the div element in which you want to load the companion Ad.



Now that we have all the necessary for the companion data to load, we can add and enable the Google Companion Ad services. Then choose to display the Ad by triggering the .display() method, with the id of the div element where we want to display our companion Ads.