The Field59 video platform supports third-party ad tags. This article details how to dynamically generate tags when using Doubleclick for Publishers (DFP).

(Note: Code examples in this article reference “Bimvid”, which was the former name of our video platform. Some aspects of the Field59 Video Platform continue to reference Bimvid in the code.)

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:

var bimvid = bimvid || {};
bimvid.parameters = {
 "clip": {}
};

Within the clip object, using name:value pairs, you can pass a list of the different items you want to become available to the ad tag for dynamic path switching. These parameters will become available to all video players on the page, but you can define this custom metadata only once per page.

For example, if your tag provided by DFP is:

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 that 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:

var bimvid = bimvid || {};
bimvid.parameters = {
 "clip": {
 "sectionpath":"weather/storms",
 "customcategory":"hurricanes" 
 }
};

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 DFP 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 preformatted tag to the player in a similar fashion as above, by instead by overriding the default preroll or postroll template parameters. 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. The javascript for that would look like:

var bimvid = bimvid || {};
bimvid.parameters = {
 "clip": {
 "prerollTemplate":"http%3A%2F%2Fpubads.g.doubleclick.net%2Fgampad%2Fads%3Fsz%3D330x186%26iu%3D%2F123456789%2Fweather%2Fstorms%26ciu_szs%3D300x250%26impl%3Ds%26gdfp_req%3D1%26env%3Dvp%26output%3Dxml_vast2%26unviewed_position_start%3D1%26url%3D%5Breferrer_url%5D%26correlator%3D%5Btimestamp%5D%26customparam%3Dhurricanes"
 }
};

In addition to prerollTemplate, you may also pass a tag for postrollTemplate and midrollTemplate.  However, if you have configured your ads with midrolls and postrolls using ad rules in DFP, then the separate templates for midroll and postrolls 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. Please also note that the midrollTemplate is only available for on-demand videos at this time.

Companion Banners

Our plugin is expecting that your DFP 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. DFP 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 preroll 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 Bimvid 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, midrollCompanionTemplate, or postrollCompanionTemplate.

Example:

"clip": {
"prerollTemplate":"http%3A%2F%2Fpubads.g.doubleclick.net%2Fgampad%2Fads%3Fsz%3D330x186%26iu%3D%2F123456789%2Fweather%2Fstorms%26ciu_szs%3D300x250%26impl%3Ds%26gdfp_req%3D1%26env%3Dvp%26output%3Dxml_vast2%26unviewed_position_start%3D1%26url%3D%5Breferrer_url%5D%26correlator%3D%5Btimestamp%5D%26customparam%3Dhurricanes",
“prerollCompanionTemplate”:”/123456789/{sectionpath}”
}
};

A quirk of how the player works is that this parameter does not require that it be URL encoded, because it is never passed into the flash player itself, but is handled with javascript.

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.

Share This