The Field59 video platform supports third-party ad tags. This article details how to dynamically generate tags when using Google Ad Manager.

The player by default has a few pieces of ‘metadata’ provided to it that is available for use in ad tags for dynamically switching targeting. Primarily the most useful ones are category and keywords, although title, summary and a few other details are also available. Other data desired to be passed from the page into the ad tag requires JavaScript to be added to the page that will allow the player to know about that data.

The basic JavaScript is:

<script>

   var field59 = field59 || {};

   field59.ipo = {

       “global” : {

           “clip”: {

           }

       }

   };

</script>

Within the clip object, there is already information defined from the Field59 platform:

       “clip”: {

           “url”: “http://cdn.field59.com/WJFW/1530630305-a9bd26dfc463f059f4e5203920cdf68eb77f033f_fl9.mp4″,

           “adaptive”: false,

           “scaling”: “fit”,

           “pageUrl”: escape(document.URL),

           “id”: “5b3b8d9d4a0ba95d50927e0e”,

           “ccsidecar”: “http://cdn.field59.com/WJFW/1530630304-a9bd26dfc463f059f4e5203920cdf68eb77f033f_cc.vtt”,

           “owner”: “WJFW”,

           “dockey”: “a9bd26dfc463f059f4e5203920cdf68eb77f033f”,

           “title”: “Sawmill Brewing Company B 07-03-18”,

           “description”: “Sawmill Brewing Company B 07-03-18”,

           “duration”: 166,

           “keywords”: “nw12today,mobile”,

           “categories”: “news”

       },

Most of these can be passed into a Google Ad Manager tag. You can also define totally new parameters that do not exist in Field59 and pass them through the player using name:value pairs. All the parameters for the clip are available for dynamic insertion into the Google Ad Manager tag.

For example, if your tag provided by Google Ad Manager is:

http://pubads.g.doubleclick.net/gampad/ads?sz=330x186&iu=/123456789
http://pubads.g.doubleclick.net/gampad/ads?sz=330x186&iu=/123456789/news/local&ciu_szs=300x250
&impl=s&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&url=[referrer_url]
&correlator=[timestamp]&customparam=skyscrapers

http://pubads.g.doubleclick.net/gampad/ads?sz=330x186&iu=/123456789/news/local&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&url=[referrer_url]&correlator=[timestamp]&customparam=skyscrapers …and you know you want to use the current section path of the page instead of “news/local” and you have a custom categorization on each page that has to get passed into the customparam value, that data is not available to the player by default, so you have to pass it in from the page. You’ll change the above JavaScript to be:

<script>

   var field59 = field59 || {};

   field59.ipo = {

       “global” : {

           “clip”: {

           }

       }

   };

</script>

The tag would be converted to a template using the names that you’ve decided on in your JavaScript so that the player will drop in the right value in the right place on the tag:

http://pubads.g.doubleclick.net/gampad/ads?sz=330x186&iu=/123456789/{sectionpath}&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&url=[referrer_url]&correlator=[timestamp]&customparam={customcategory}

This template will need to be added to your account by our staff. Then when the player loads on the page where the above javascript is included, the player will call out to this tag:

http://pubads.g.doubleclick.net/gampad/ads?sz=330x186&iu=/123456789/weather/storms&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&url=[referrer_url]&correlator=[timestamp]&customparam=hurricanes

(The referrer_url and correlator parameters are automatically provided by the Google Ad Manager code — that’s not needed to be specified.)

Alternatively, if you find that your tags vary substantially from page to page, you may pass an entire pre-formatted tag to the player by overriding the default pre-roll or post-roll template parameters. This value is NOT a part of the clip object, so the structure of the JavaScript is slightly different, but the overall process is essentially the same. If there are no {} sections in the string that is passed as one of the templates, the player will use the tag template as is.

<script>

   var field59 = field59 || {};

   field59.ipo = {

       “global” : {

           “dfpConfig“: {

“prerollTemplate”:”http://pubads.g.doubleclick.net/gampad/ads?sz=330x186&iu=/123456789/weather/storms&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&url=[referrer_url]&correlator=[timestamp]&customparam=hurricanes

           }

       }

   };

</script>

In addition to prerollTemplate, you may also pass a tag for postrollTemplate.  However, if you have configured your ads with post-rolls using ad rules in Google Ad Manager, then the separate templates for post-rolls would not be needed.

Please note when passing a tag in this fashion, you must URL encode the string or else the player will not be able to load. 

Companion Banners

Our plugin is expecting that your Google Ad Manager account and Ad Campaigns are configured using GPT companion banners. (https://developers.google.com/interactive-media-ads/docs/sdks/flash/v3/guides/companions) If this is not the case you will need to contact us for more assistance.

With the GPT companion banners, the tag for the companion must be passed to the player separately. Google Ad Manager will probably provide you with a snippet of JavaScript as the companion tag. The player is expecting only the first parameter passed into the “googletag.defineUnit” portion. That would be the string shown as “/YOUR_NETWORK/YOUR_UNIT_PATH” below

googletag.defineUnit(
 '/YOUR_NETWORK/YOUR_UNIT_PATH',
 [728, 90],
 'companionDiv1');

You may modify the line in a similar manner as mentioned above for the full pre-roll tag, marking sections with {“parameter name”} that will be swapped out dynamically with the information that the player has. If your companion structure does not change from page to page, this tag can be loaded into Field59 by our staff and it will be used network wide.

You may also pass the tag to the player at time of page load, in a similar fashion as above using prerollCompanionTemplate or postrollCompanionTemplate.

Example:

<script>

   var field59 = field59 || {};

   field59.ipo = {

       “global” : {

           “dfpConfig“: {

“prerollTemplate”:”http://pubads.g.doubleclick.net/gampad/ads?sz=330x186&iu=/123456789/weather/storms&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&url=[referrer_url]&correlator=[timestamp]&customparam=hurricanes“,

“prerollCompanionTemplate”:”/123456789/weather/storms”

           }

       }

   };

</script>

In both of the cases just illustrated, markup will be added at the time of player generation just below the video player and covering the content right below the player. The companion will display during the ad break and then will remove itself automatically when the ad completes.

An alternate method for adding companions to the page would be to not provide the companion tag to the player either in the account configuration or through JavaScript on the page. In this case you would take the entire snippet of JavaScript provided by DFP and place it on your pages where ever you would like the companion to display.

Individual player behavior

All of the examples so far have been in a JavaScript object field59.ipo.global. The “global” in this case indicates the overrides will be applied to all players on any given page. If it’s strongly desired to have one player on the page behave differently from another player that’s displayed on the same page, you can target an individual player by changing the “global” to be the Field59 key id instead:

<script>

   var field59 = field59 || {};

   field59.ipo = {

       “b0d3966ceefefef41955a05d7720a1788baa99f8” : {

           “clip”: {

“sectionpath”:”weather/storms”,

“customcategory”:”hurricanes”,

           }

       }

   };

</script>

All other players on the page will ignore these overrides.  Combinations of both global and player specific parameters are permitted.

Share This