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

DFP Prebid integration (sync tags) #126

Closed veeba closed 8 years ago

veeba commented 8 years ago

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

ialex commented 8 years ago

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.

veeba commented 8 years ago

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

mkendall07 commented 8 years ago

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?

veeba commented 8 years ago

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

veeba commented 8 years ago

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

prebid commented 8 years ago

@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?

veeba commented 8 years ago

Yes, its the same.

jch1001 commented 8 years ago

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

prebid commented 8 years ago

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!