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 Community Manager ‎09-25-2013 11:56 AM - edited ‎11-02-2016 08:18 AM (1,527 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.

ENVIRONMENT

Device Compatibility

Flash, iOS

Operative System

Windows, Mac OSX, iOS, Android

Browser

All

Troubleshooting tools

n/a

Other

n/a

 

CAUSE

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.

 

HOW TO RESOLVE

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

<script src="//www.googletagservices.com/tag/js/gpt.js"></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],

'cad');

adSlot1.addService(googletag.companionAds());

googletag.enableServices();

googletag.display('cad');

});

 

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.

 

 

REFERENCES

http://help.ooyala.com/video-platform/api/player_v3_api_events.html

https://support.google.com/dfp_premium/answer/1650154?expand=googletag_details#defineSlot