Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

DFP Prebid integration (sync tags)

Open veeba opened this issue 11 years ago • 9 comments

Can somebody help me with integration Prebid.js to existing DFP. I have DFP and Units are live. I created Order-Line-items with price-priority (from 0.2 to 1.5). I also did key-values hb_pb and hb_bidder (in hb_bidder I add just "rubicon").

I also dowloaded prebid.js. My question is what else I need to do to get it live? Where I need to add setup for ex. "rubicon id", "site id", zone and unit-id? Do I need to modify code of prebid.js script, or modify DFP code from header of my site, or I can do all from DFP?

BR

veeba avatar Dec 03 '15 15:12 veeba

Here you have the complete example with inline comments https://github.com/prebid/Prebid.js/blob/master/integrationExamples/gpt/pbjs_example_gpt.html you need to include Prebid and add your configuration below then trigger the request for bids, make sure you only include gpt.js just once if you already have it you may need to remove and let the wrapped function in the example load it.

ialex avatar Dec 03 '15 15:12 ialex

My problem is that we use sync DFP tags. What can we do about that?

veeba avatar Dec 03 '15 15:12 veeba

Hi @veeba

Unfortunately we don't have an out of the box solution for supporting synchronous tags. Any reason your not using the asynchronous version?

mkendall07 avatar Dec 03 '15 19:12 mkendall07

We use it because of 1x1 floating ads... Cannot use it with async tags.

veeba avatar Dec 03 '15 19:12 veeba

@mkendall07 @ialex How can I setup prebid.js without DFP?

veeba avatar Dec 03 '15 20:12 veeba

@veeba is your setup identical to the standard Sync tag documented by DFP as in: https://support.google.com/dfp_sb/answer/1651549?hl=en#sync ?

@mkendall07 what're some of the main blockers of Prebid.js working with sync ad server tags?

ghost avatar Dec 05 '15 00:12 ghost

Yes, its the same.

veeba avatar Dec 05 '15 07:12 veeba

I am having the same issue and wondering if there is a solution to that.

jch1001 avatar Dec 07 '15 19:12 jch1001

Header bidding requires GPT to wait for a few hundred milliseconds, so that header bidding partners have enough time to respond with bids. If you’re loading GPT synchronously, there is no simple way of delaying GPT library loading (setTimeout() cannot be used) to wait for bidders’ bids.

It therefore requires Prebid.js to run in a blocking/synchronous fashion. This will require all header bidding partners’ code to be blocking/synchronous, which we’re not sure if it’s even possible. We therefore do not have a great out of the box solution for turning prebid.js blocking at the moment.

A couple alternative workarounds:

Option 1: Load a blocking script that has a load time of 300-500ms. This script does nothing but keeps the page waiting, while in the mean time Prebid.js can run asynchronously and return the bids. After the blocking script finishes loading, GPT can start synchronously and at this point there will be header bidding bids available.

For the best user experience, you probably want to insert this blocking script after the above the fold page content has loaded. Or if you're okay with additional 500ms latency added to your page load time, this can be easily done.

Important note: The above technique only works if you load a script file synchronously on the page. An infinite loop in JS for any amount of time will not work.

Option 2: Use post bid. The downsides are post-bid no longer allows your header bidding partners to compete with DFP/AdX, but they can compete with each other. Documentation here: http://prebid.org/overview/what-is-post-bid.html

Let us know which option you choose and any questions you may have!

ghost avatar Dec 08 '15 00:12 ghost