Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _includes/video/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

pbjs.requestBids({
bidsBackHandler: function(bids) {
var videoUrl = pbjs.adServers.dfp.buildVideoUrl({
var videoUrl = pbjs.adServers.gam.buildVideoUrl({
adUnit: videoAdUnit,
params: {
iu: '/19968336/prebid_cache_video_adunit',
Expand Down
2 changes: 1 addition & 1 deletion assets/js/video/pb-is-jw-01.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pbjs.que.push(function(){

pbjs.requestBids({
bidsBackHandler: function(bids) {
var videoUrl = pbjs.adServers.dfp.buildVideoUrl({
var videoUrl = pbjs.adServers.gam.buildVideoUrl({
adUnit: videoAdUnit,
params: {
iu: '/19968336/prebid_cache_video_adunit',
Expand Down
2 changes: 1 addition & 1 deletion assets/js/video/pb-ve-jwplayer-platform-h.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function loadVideoData() {

pbjs.requestBids({
bidsBackHandler: function(bids) {
var videoUrl = pbjs.adServers.dfp.buildVideoUrl({
var videoUrl = pbjs.adServers.gam.buildVideoUrl({
adUnit: videoAdUnit,
params: {
iu: '/19968336/prebid_cache_video_adunit',
Expand Down
4 changes: 2 additions & 2 deletions dev-docs/examples/instream-banner-mix.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ function initAdserver(bids) {
}
});

// Build DFP URL with targeting for videoAdUnit
var videoUrl = pbjs.adServers.dfp.buildVideoUrl({
// Build GAM URL with targeting for videoAdUnit
var videoUrl = pbjs.adServers.gam.buildVideoUrl({
adUnit: videoAdUnit,
params: {
iu: '/19968336/prebid_cache_video_adunit',
Expand Down
4 changes: 2 additions & 2 deletions dev-docs/modules/dfp_video.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ The standard options:

This module exposes the following methods:

- [`pbjs.adServers.gam.buildVideoUrl`](/dev-docs/publisher-api-reference/adServers.dfp.buildVideoUrl.html)
- [`pbjs.adServers.gam.getVastXml`](/dev-docs/publisher-api-reference/adServers.dfp.getVastXml.html)
- [`pbjs.adServers.gam.buildVideoUrl`](/dev-docs/publisher-api-reference/adServers.gam.buildVideoUrl.html)
- [`pbjs.adServers.gam.getVastXml`](/dev-docs/publisher-api-reference/adServers.gam.getVastXml.html)

# Further Reading

Expand Down
2 changes: 1 addition & 1 deletion dev-docs/modules/konduit.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pbjs.que.push(function() {
adUnitCode: videoAdUnit[0].code,
timeout: 1500,
callback: function (error, bids) {
var videoUrl = pbjs.adServers.dfp.buildVideoUrl({
var videoUrl = pbjs.adServers.gam.buildVideoUrl({
...
});
Expand Down
2 changes: 1 addition & 1 deletion dev-docs/plugins/bc/bc-prebid-plugin-prebid-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ None

Parameters used when using Google Ad Manager as the ad server.

See prebid.org documentation for [buildVideoUrl](/dev-docs/publisher-api-reference/adServers.dfp.buildVideoUrl.html)
See prebid.org documentation for [buildVideoUrl](/dev-docs/publisher-api-reference/adServers.gam.buildVideoUrl.html)

**Acceptable Values:**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ None

Parameters used when using Google Ad Manager (formerly DFP) as the ad server.

See documentation for [buildVideoUrl](/dev-docs/publisher-api-reference/adServers.dfp.buildVideoUrl.html) for more information.
See documentation for [buildVideoUrl](/dev-docs/publisher-api-reference/adServers.gam.buildVideoUrl.html) for more information.

**Acceptable Values:**

Expand Down
77 changes: 2 additions & 75 deletions dev-docs/publisher-api-reference/adServers.dfp.buildVideoUrl.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,80 +5,7 @@ description: adServers.dfp.buildVideoUrl API
sidebarType: 1
---

See [adServers.gam.buildVideoUrl](/dev-docs/publisher-api-reference/adServers.gam.buildVideoUrl.html).

{: .alert.alert-info :}
The Google Ad Manager implementation of this function requires including the `dfpAdServerVideo` module in your Prebid.js build.

This method combines publisher-provided parameters with Prebid.js targeting parameters to build a Google Ad Manager video ad tag URL that can be used by a video player.

#### Argument Reference

##### The `options` object

{: .table .table-bordered .table-striped }
| Field | Type | Description |
|----------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `adUnit` | object | *Required*. The Prebid ad unit to which the returned URL will map. |
| `params` | object | *Optional*. Querystring parameters that will be used to construct the Google Ad Manager video ad tag URL. Publisher-supplied values will override values set by Prebid.js. See below for fields. |
| `url` | string | *Optional*. The video ad server URL. When given alongside params, the parsed URL will be overwritten with any matching components of params. |
| `bid` | object | *Optional*. The Prebid bid for which targeting will be set. If this is not defined, Prebid will use the bid with the highest CPM for the adUnit. |

{: .alert.alert-warning :}
One or both of options.params and options.url is required. In other words, you may pass in one, the other, or both, but not neither.

##### The `options.params` object

{: .table .table-bordered .table-striped }
| Field | Type | Description | Example |
|-------------------+--------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------|
| `iu` | string | *Required*. Google Ad Manager ad unit ID. | `/19968336/prebid_cache_video_adunit` |
| `cust_params` | object | *Optional*. Key-value pairs merged with Prebid's targeting values and sent to Google Ad Manager on the video ad tag URL. | `{section: "blog", anotherKey: "anotherValue"}` |
| `description_url` | string | *Optional*. Describes the video. Required for Ad Exchange. Prebid.js will build this for you unless you pass it explicitly. | `https://www.example.com` |

For more information on any of these params, see [the Google Ad Manager video tag documentation](https://support.google.com/admanager/answer/1068325).

#### Examples

There are several different ways to build up your video URL, as shown in the examples below:

Using `options.params` only:

```javascript
pbjs.requestBids({
bidsBackHandler: function(bids) {
var videoUrl = pbjs.adServers.dfp.buildVideoUrl({
adUnit: videoAdUnit,
params: {
iu: '/19968336/prebid_cache_video_adunit',
cust_params: {
section: "blog",
anotherKey: "anotherValue"
},
hl: "en",
output: "xml_vast2",
url: "https://www.example.com",
}
});
invokeVideoPlayer(videoUrl);
}
});
```

Using `options.url` only:

```javascript
var adserverTag = 'https://pubads.g.doubleclick.net/gampad/ads?'
+ 'sz=640x480&iu=/19968336/prebid_cache_video_adunit&impl=s&gdfp_req=1'
+ '&env=vp&output=xml_vast2&unviewed_position_start=1&hl=en&url=https://www.example.com'
+ '&cust_params=section%3Dblog%26anotherKey%3DanotherValue';

var videoUrl = pbjs.adServers.dfp.buildVideoUrl({
adUnit: videoAdUnit,
url: adserverTag
});
```

<a name="module_pbjs.requestBids"></a>

{: .alert.alert-warning :}
In the event of collisions, querystring values passed via `options.params` take precedence over those passed via `options.url`.
In Prebid 10, the `dfpAdServerVideo` module and the `adServers.dfp.buildVideoUrl` API were renamed to `gamAdServerVideo` and `adServers.gam.buildVideoUrl` respectively.**
84 changes: 84 additions & 0 deletions dev-docs/publisher-api-reference/adServers.gam.buildVideoUrl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
layout: api_prebidjs
title: pbjs.adServers.gam.buildVideoUrl(options)
description: adServers.gam.buildVideoUrl API
sidebarType: 1
---


{: .alert.alert-info :}
The Google Ad Manager implementation of this function requires including the `gamAdServerVideo` module in your Prebid.js build.

This method combines publisher-provided parameters with Prebid.js targeting parameters to build a Google Ad Manager video ad tag URL that can be used by a video player.

## Argument Reference

### The `options` object

{: .table .table-bordered .table-striped }
| Field | Type | Description |
|----------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `adUnit` | object | *Required*. The Prebid ad unit to which the returned URL will map. |
| `params` | object | *Optional*. Querystring parameters that will be used to construct the Google Ad Manager video ad tag URL. Publisher-supplied values will override values set by Prebid.js. See below for fields. |
| `url` | string | *Optional*. The video ad server URL. When given alongside params, the parsed URL will be overwritten with any matching components of params. |
| `bid` | object | *Optional*. The Prebid bid for which targeting will be set. If this is not defined, Prebid will use the bid with the highest CPM for the adUnit. |

{: .alert.alert-warning :}
One or both of options.params and options.url is required. In other words, you may pass in one, the other, or both, but not neither.

### The `options.params` object

{: .table .table-bordered .table-striped }
| Field | Type | Description | Example |
|-------------------+--------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------|
| `iu` | string | *Required*. Google Ad Manager ad unit ID. | `/19968336/prebid_cache_video_adunit` |
| `cust_params` | object | *Optional*. Key-value pairs merged with Prebid's targeting values and sent to Google Ad Manager on the video ad tag URL. | `{section: "blog", anotherKey: "anotherValue"}` |
| `description_url` | string | *Optional*. Describes the video. Required for Ad Exchange. Prebid.js will build this for you unless you pass it explicitly. | `https://www.example.com` |

For more information on any of these params, see [the Google Ad Manager video tag documentation](https://support.google.com/admanager/answer/1068325).

## Examples

There are several different ways to build up your video URL, as shown in the examples below:

Using `options.params` only:

```javascript
pbjs.requestBids({
bidsBackHandler: function(bids) {
var videoUrl = pbjs.adServers.gam.buildVideoUrl({
adUnit: videoAdUnit,
params: {
iu: '/19968336/prebid_cache_video_adunit',
cust_params: {
section: "blog",
anotherKey: "anotherValue"
},
hl: "en",
output: "xml_vast2",
url: "https://www.example.com",
}
});
invokeVideoPlayer(videoUrl);
}
});
```

Using `options.url` only:

```javascript
var adserverTag = 'https://pubads.g.doubleclick.net/gampad/ads?'
+ 'sz=640x480&iu=/19968336/prebid_cache_video_adunit&impl=s&gdfp_req=1'
+ '&env=vp&output=xml_vast2&unviewed_position_start=1&hl=en&url=https://www.example.com'
+ '&cust_params=section%3Dblog%26anotherKey%3DanotherValue';

var videoUrl = pbjs.adServers.gam.buildVideoUrl({
adUnit: videoAdUnit,
url: adserverTag
});
```

<a name="module_pbjs.requestBids"></a>

{: .alert.alert-warning :}
In the event of collisions, querystring values passed via `options.params` take precedence over those passed via `options.url`.
2 changes: 1 addition & 1 deletion dev-docs/show-video-with-a-dfp-video-tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Next, we need to do the standard Prebid "add ad units and request bids" dance.

In the example below, our callback builds the video URL the player needs using the `buildVideoUrl` method from the Google Ad Manager ad server module that we built into our copy of Prebid.js in the **Prerequisites** section.

For more information, see the API documentation for [pbjs.adServers.gam.buildVideoUrl](/dev-docs/publisher-api-reference/adServers.dfp.buildVideoUrl.html). Understanding the arguments to this method is *especially* important if you plan to pass any custom parameters to Google Ad Manager. The `params` key in the argument to `buildVideoUrl` supports all parameters from the [Google Ad Manager API](https://support.google.com/admanager/answer/1068325).
For more information, see the API documentation for [pbjs.adServers.gam.buildVideoUrl](/dev-docs/publisher-api-reference/adServers.gam.buildVideoUrl.html). Understanding the arguments to this method is *especially* important if you plan to pass any custom parameters to Google Ad Manager. The `params` key in the argument to `buildVideoUrl` supports all parameters from the [Google Ad Manager API](https://support.google.com/admanager/answer/1068325).

```javascript
pbjs.que.push(function() {
Expand Down
2 changes: 1 addition & 1 deletion prebid-video/video-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ If you already have a Prebid integration for banner, you don’t need to do anyt
Your first step to implementing header bidding for video is to [download Prebid.js](/download.html). Before downloading, select the adapters you want to include. (You can add more adapters later.)

- Include at least one bid adapter that supports video. Find a list of eligible adapters in [the video bidders table](/dev-docs/bidders.html#bidder-video-native).
- If Google Ad Manager is your ad server, you must include the [Google Ad Manager Video module](/dev-docs/publisher-api-reference/adServers.dfp.buildVideoUrl.html).
- If Google Ad Manager is your ad server, you must include the [Google Ad Manager Video module](/dev-docs/publisher-api-reference/adServers.gam.buildVideoUrl.html).
- If you’ll be integrating with Prebid Server, be sure to include “Prebid Server” in the list of adapters.

### How to integrate
Expand Down
Loading