prebid / Prebid.js

Setup and manage header bidding advertising partners without writing code or confusing line items. Prebid.js is open source and free.
https://docs.prebid.org
Apache License 2.0
1.28k stars 2.05k forks source link

Header Bidding Video #3185

Closed lucamago closed 5 years ago

lucamago commented 5 years ago

Type of issue

question

Description

Hi, we're trying to do some header bidding video's tests, following your guide http://prebid.org/dev-docs/show-video-with-a-dfp-video-tag.html and we have some questions:

-when we create all the line items in DFP (each one with their SSP's cache url), how can we know in the prebid bidsBackHandler function which is the line item to use for the bid? Maybe passing it by some key/value?

-if we have 2 video players in one page, how can we get which one to use in the bidsBackHandler function (and what dfp ad unit associate with the bid)?

Steps to reproduce

Test page

Expected results

Actual results

Platform details

Other information

bretg commented 5 years ago

-when we create all the line items in DFP (each one with their SSP's cache url), how can we know in the prebid bidsBackHandler function which is the line item to use for the bid? Maybe passing it by some key/value?

It's really the other way around -- bidsBackHandler needs to create a bunch of ad server key-value pairs like hb_pb, hb_bidder, etc. They get passed to the ad server where line items are targeted to key-values. So you might have line items targeted to hb_pb=1.0 and hb_bidder=rubicon

-if we have 2 video players in one page, how can we get which one to use in the bidsBackHandler function (and what dfp ad unit associate with the bid)?

The example on the page you referenced is just an example -- you'll need to figure out how to call the right video player... i.e. override invokeVideoPlayer(videoUrl) with whatever code you need to get the URL to the right player.

Does this help?

lucamago commented 5 years ago

Thanks bretg for the help!

The example on the page you referenced is just an example -- you'll need to figure out how to call the right video player... i.e. override invokeVideoPlayer(videoUrl) with whatever code you need to get the URL to the right player.

Let's make an example:

pbjs.requestBids({ bidsBackHandler: function(bids) { var videoUrl = pbjs.adServers.dfp.buildVideoUrl({ adUnit: videoAdUnit, params: { iu: '/12345/unitVideo1', cust_params: { section: "blog", anotherKey: "anotherValue", bidder: bids.bidderCode }, output: "vast" } }); invokeVideoPlayer(videoUrl); } });

with this code we can relate the DFP ad unit '/12345/unitVideo1' with the hb; how can we relate a second DFP ad unit like for example '/12345/unitVideo2' to the video hb? Does the params 'iu' take an array of DFP ad units name?

bretg commented 5 years ago

Sorry, the dfpAdServerVideo module supports only one video ad unit per auction. You have two choices:

1) if you're trying to get different ads into two different players, then run each player as a separate auction. This will mean you'll have different bidsBackHandler sections so you can pass in different DFP ad units

2) if instead you have a player that can handle two different adunits in the same video stream, then you'll have to write your own interface to it, creating your own DFP URLs and sending them to the player as required. You'd be welcome to submit an enhancement to the dfpAdServerVideo module.