Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Prebid Video docs: cache is now toggle-able #462

Merged
merged 1 commit into from
Dec 18, 2017
Merged
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
16 changes: 10 additions & 6 deletions dev-docs/show-video-with-a-dfp-video-tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,10 @@ In the example below, our callback builds the video URL the player needs using t

For more information, see the API documentation for [pbjs.adServers.dfp.buildVideoUrl]({{site.baseurl}}/dev-docs/publisher-api-reference.html#module_pbjs.adServers.dfp.buildVideoUrl). Understanding the arguments to this method is *especially* important if you plan to pass any custom parameters to DFP. The `params` key in the argument to `buildVideoUrl` supports all parameters from the [DFP API](https://support.google.com/dfp_premium/answer/1068325?hl=en).

{: .alert.alert-warning :}
**Prebid Cache must be enabled**
You must enable Prebid Cache as shown below in order for the DFP Ad Server Video module's call to `buildVideoUrl` to work.

```javascript
pbjs.que.push(function() {
pbjs.addAdUnits(videoAdUnit);

/* Required for the DFP video URL to be built correctly in the
`bidsBackHandler` */
pbjs.setConfig({
usePrebidCache: true
});
Expand All @@ -120,6 +114,16 @@ pbjs.que.push(function() {
});
```

#### Notes on Prebid Cache

You can show video ads even if Prebid Cache is disabled. However, there are some conditions:

+ In general, video-enabled bidders must supply either `bid.vastUrl` or `bid.vastXml` on their responses, and they may supply both.
+ If you have Prebid Cache disabled, and the bidder supplies only `bid.vastXml` in its bid response, [`pbjs.adServers.dfp.buildVideoUrl`]({{site.baseurl}}/dev-docs/publisher-api-reference.html#module_pbjs.adServers.dfp.buildVideoUrl) will not be able to generate a video ad tag URL from that response, and it will be dropped from the auction.
+ If `options.url` is passed as an argument to [`pbjs.adServers.dfp.buildVideoUrl`]({{site.baseurl}}/dev-docs/publisher-api-reference.html#module_pbjs.adServers.dfp.buildVideoUrl):
+ If Prebid Cache is enabled, Prebid does not set the `description_url` field to the bid response's `bid.vastUrl`. It just attaches the bid's ad server targeting and builds the URL based on user input.
+ If Prebid Cache is disabled, Prebid sets the `description_url` field to the bid response's `bid.vastUrl`.

### 4. Invoke video player on Prebid video URL

In the body of the page, the following HTML and JS will show the ad:
Expand Down