Google IMA View (Deprecated)

You can use the following code sample to work with Google IMA ad manager.

Important: Ooyala Player V3 is deprecated and is scheduled to be disabled on 2018-01-31. After that date, Player V3 will no longer play your video or audio content. Customers still using Player V3 need to migrate to Player V4 (see Migrating from Player V3 and Player Migration FAQ).

The code sample includes multiple client web pages or views illustrating each feature and a seventh code sample that shows all the features working in combination. To implement each client page, you will need all the standard elements that you normally use such as your API Key, pcode, and so forth.

Where to Find the Code

To explore this code sample view in GitHub, go to https://github.com/ooyala/code-samples/blob/master/application/views/Secure_XDR_GoogleIMA/google_ima.php.

The following section describes the implementation of each of the Google IMA client-side view.

How the Google IMA Sample Works

To examine how Google IMA works in this code sample, you need to look at the following files:
  • application/config/ooyala_config (default_embed_code, default_player_id, google_ima_ad_tag)
  • application/views('google_ima')
In this Google IMA sample, we use the following Player V3 APIs and parameters.
  • OO.Player.create() - In the sample, you should note that OO.Player.create is used with the google ad tag.
  • google-ima-ads-manager - The google-ima-ads manager parameter is set in the hash of the OO.Player.create function. It takes an adTagUrl as part of a key value pair. In this sample, we pass the response from the PHP server containing the ad server URL.
  • mb.subscribe - This function is used to subscribe to events and pass them to the console log.

Before you start working with the Ooyala Google IMA sample:

  1. You need to know what Google IMA does and how it works. For more information, see “Ads Embedded Parameters.”
  2. If you have an asset and want Google IMA, you must remember that Google IMA must be set on a per player basis.
  3. Associate your Google IMA ads with your video assets in Ooyala Backlot.  For more information, see “Working with Your Own Ad Assets, Ad Sets, and Ad Sources.”
  4. Set up the Google IMA ad tags. You can also do this within Backlot. For more information, see “Working with Your Own Ad Assets, Ad Sets, and Ad Sources,”Creating Ad Sets for Integration with Ad Sources,” and “Ad Set Fields for Google.

Was this article helpful?