Google IMA Ads Embedded Parameters in Player V3

You can pass Google IMA ad-service-related tags to the Player with the embedded parameters.
Note: To use Ooyala’s Google IMA ad manager, log into the Support Center and submit a ticket requesting that this ad source be added to your account. Once it’s enabled, you’ll be able create adsets for your player.
Ads positions behave somewhat differently on desktop and mobile devices. See Ads Integration for a comprehensive list of ad postion support by platform.

Google IMA Parameter

Use the google-ima-ads-manager parameter to pass Google IMA ad server or network tags to the Ooyala player. The parameter is a container that takes a key value pair representing the ad server or network URL along with the other parameters described below.

Set the adTagUrl Parameter to Override the Backlot URL

One of the parameters for the google-ima-ads-manager is a key value pair in the form adTagUrl: "some url".

Valid Values: Any URL.

For example:
var videoPlayer = OO.Player.create("playerwrapper", "embed_code", {
  height: "100%",
  width: "100%",
  "google-ima-ads-manager": {
    adTagUrl: "some url",
    ...
  },
});
You need to change the key value "some url" to the actual google-ima ad tag containing the response. This URL value for the adTag key value pair represents the ad server or network URL. This adTag URL overrides the one in Backlot. For example:
adTagUrl: "http://myAdServer.com/myGoogle-ima-ads-manager"
You can have additional adTag parameters appended to the end of the URL that you get from Backlot.

Set the useStyledNonLinearAds Parameter to Hide the Close Button for Non-Linear Ads on Flash Players

Note: This parameter is for Flash only.
Another parameter you can set is useStyledNonLinearAds, which shows a close button for non-linear ads when set to true. This parameter is optional - by default the button to close an ad is shown for non-linear ads.

Valid Values: yes | true | no | false

Default: true

Set this parameter to false to hide the close ad button, as shown in the following example:
var videoPlayer = OO.Player.create("playerwrapper", "embed_code", {
  height: "100%",
  width: "100%",
  "google-ima-ads-manager": {
    adTagUrl: "some url",
    useStyledNonLinearAds: false,
    ...
  },
});

Use showInAdControlBar to Show or Hide the Player Controls Bar During Ad Playback

You can use showInAdControlBar to show/hide player controls bar during ad playback.

Valid Values: yes | true | no | false

Default: no

Note: There is a general player parameter also called 'showInAdControlBar'. You should not use both showInAdControlBar parameters simultaneously. The preferred method is to use the general player showInAdControlBar parameter outside of the 'google-ima-ads-manager' hash.
For example:
var videoPlayer = OO.Player.create("playerwrapper", "embed_code", { 
    height: "100%", 
    width: "100%",
    "google-ima-ads-manager": { 
        showInAdControlBar: true,
        ... } 
    }
);
              

Use showAdMarquee to Show or Hide the Ad Marquee During Ad Playback

Use showAdMarquee to show or hide the ad marquee during ad playback. When set to false or no, the adMarquee of an add will be hidden. If set to true, yes, or omitted the adMarquee will be displayed during ad playback.

Valid Values: true | false

Default: true

For example:
var videoPlayer = OO.Player.create("playerwrapper", "embed_code", { 
    height: "100%", 
    width: "100%",
    "google-ima-ads-manager": { 
        showAdMarquee: true ,
        ... } 
    }
);
              

Use playWhenAdClick to Set Ad Playback Behavior After Ad is Clicked

If playWhenAdClick is set to yes, ad playback will continue regardless of click.

Valid Values: yes | true | no | false

Default: no

Note: For Flash, if playWhenAdClick is set to false with no ad controls, after the user clicks on the ad and is redirected, ad playback will continue when the user clicks on the ad the second time. We are aware that this causes some undesired behavior where the ad url opens for both ad pause and ad play events. We are working with the Google IMA team to fix this behavior. Otherwise, ad playback will pause.
For example:
var videoPlayer = OO.Player.create("playerwrapper", "embed_code", { 
    height: "100%", 
    width: "100%",
    "google-ima-ads-manager": { 
        playWhenAdClick: true ,
        ... } 
    }
);
              

Set the additionalAdTagParameters to Append More Parameters

You can use additionalAdTagParameters to add functionality to your ad handling such as adding demographic targeting for ads. These added ad tag parameters have a dependency on how the ad tag is set up in Backlot. Also, the additional adTagUrl parameter key-value pairs are part of the adTagUrl parameter and need to be in the form of a dictionary with key-value pairs. You can use any of the internal key/value pairs that google-ima supports. Google IMA documentation lists these parameters at this site: https://support.google.com/dfp_premium/answer/1068325?hl=en. When you use these parameters, we append them to the end of the ad tag. Appended parameters do not override anything in the URL from Backlot.
Note: The ad tag Url overrides the Url in Backlot.
To start using these parameters, you can specify something like the following:
additionalAdTagParameters: {
  "parameter1": "value1",
  "parameter2": "value2"
}       

In Backlot, if you specify the ad tag URL as:http://www.example.com/example?param1=test, the resulting request made with the following parameters would be: "www.example.com/example?param1=test&cust_params=env%3Dmobilevcmshost%26siteview%3D1%26pth%3Djsbin.com&vid=code&pod=2"

This request would look something like the following example:

"google-ima-ads-manager": {
  additionalAdTagParameters: {
    cust_params: "env%3Dmobilevcmshost%26siteview%3D1%26pth%3Djsbin.com",
    vid: "code",
    pod: "2"
  }
}

adTagUrl Parameters from Google IMA Documentation

You use the key value pairs from the google-ima-ads-manager to append to the adTagUrl parameter. You can find lists of these parameters in the Google IMA documentation. The following examples show how to use some of these parameters as key-value pairs of the google-ima-ads-manager parameter:

cust_params

This value pair enables you to pass custom targeting parameters to the Ooyala player. You can put any kind of key values for the cust_params. For example:

cust_params: "partner%3Dpartner_1%26gender%3Dfemale%26anotherKey%3Dvalue1%2Cvalue2"
vid
This parameter is a unique identifier for the video assets and should take the value of your Ooyala video asset ID (embed code). You can get your video embed code from Backlot.
Note: This value is required for using DFP to target against content metadata.
For example:
vid: "1234Fakeoi5Xv3Dav6uuEIeVJto9Ju7R"
vpos

You can use this value to specify the position of the ad in the video stream.

vpos: "preroll"

The following example demonstrates the use of the google-ima adTagUrl parameter on a client-side web page.

<!doctype html>
<html>

<head>
  <style rel="stylesheet" type="text/css">
    html,
    body {
      margin: 0;
      padding: 0;
    }
    #container {
      width: 800px;
      height: 500px;
      margin: 0 auto;
    }
  </style>
  <script src="http://player.ooyala.com/v3/123fake9ddb1446ea9bb7cad08711d36?platform=html5-priority"></script>-->
  <script>
    OO.ready(function () {
      OO.Player.create("container", "123fakeZpXSpOwupKby1s74Q8FQbRwPn", {
        "google-ima-ads-manager": {
          "showInAdControlBar": true,
          "adTagUrl": "http://1fake4ads.g.doubleclick.net/gampad/ads?sz=640x480&iu=%2F6376%2Fbr.
      College_Football%2Fvideo&ciu_szs=300x250%2C728x90&impl=s
      &gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1
      &url=[referrer_url]&correlator=[timestamp]",
          "additionalAdTagParameters": {
            "cust_params": "env%3Dmobilevcmshost%26siteview%3D1%26pth%3Djsbin.com",
            "vid": "code",
            "vpos": "preroll"
          }
        }
      });
    });
  </script>
</head>

<body>
  <div id="container"></div>
</body>

</html>

In this example, we set the adTagUrl with several key value pairs such as ciu_szs, unviewed_position, url, correlator and others.

adRequestTimeout Parameter

Set the adRequestTimeout to set the timeout before continuing video playback. This parameter is for Flash and HTML5.

Use the key value pair in the form adRequestTimeout: "some integer" to customize the time taken, in milliseconds, to make a timeout for the ad request and continue the video playback. We recommend using whole milliseconds (e.g. 2001 milliseconds instead of 2000.5 milliseconds).

Valid Values: any integer greater than or equal to 1000.

Default: 3000

For example:
var videoPlayer = OO.Player.create("playerwrapper", "embed_code", { 
    height: "100%", 
    width: "100%",
    adRequestTimeout: 1000
    "google-ima-ads-manager": { 
        adTagUrl: "some url",
        ... }, 
    }
);
              

Google IMA for Mobile Devices

Ooyala supports Google IMA for both desktop and mobile. For information about working with Google IMA for mobile devices, see the following mobile SDK Android and iOS topics.

Was this article helpful?