I'm tasked with implementing "prebid" advertising on one of our client sites.
I can do this completely separate of the DFP module but thought this might be something that could be beneficial to others. I was curious if anyone had thoughts as to whether this was something that even belonged in the DFP module or if it should be a sub-module or an entirely new module.
I feel this functionality belongs in the DFP module since prebid is dependent on googletag.
If you read the documentation, or talk to someone from OAO, you'll find that the data needed by each bidder can vary drastically. I feel there should be some standardization...but this is for a different conversation. Because of this, I wanted to implement a group of settings that allows the administrator the ability to add multiple bidders. Take a look at any two bidders, e.g., OpenX vs Optimatic, and you'll see why I'm proposing this solution.
All this is to say - I feel like this could be a great addition to this module if others agree.
Share your thoughts!
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | prebid_programmatic_advertising-2980845-18.patch | 33.39 KB | scottalan |
| #17 | prebid_programmatic_advertising-2980845-17.patch | 23.54 KB | scottalan |
| #14 | prebid_programmatic_advertising-2980845-14.patch | 21.43 KB | scottalan |
| #13 | prebid-testing-2980845-13.patch | 38.94 KB | scottalan |
| #12 | prebid-testing-2980845-12.patch | 38.79 KB | scottalan |
Comments
Comment #2
scottalan commented@bleen, Was hoping to get your thoughts on this.
Comment #3
scottalan commentedI have to move forward with this either way so I'll probably just build it into the DFP module (7.x-2.x) and provide a patch here.
Comment #4
scottalan commentedI did come across https://github.com/heshanlk/prebidjs so maybe I'll reach out and see if this plays well with DFP, namely this branch.
Comment #5
scottalan commentedSo I went ahead and added a wrapper for prebid when the ads are rendered. It assumes if the pbjs library is installed then we should use it. I really wanted to create a module that I could contrib back but after having to deal with some of the Bidder Adapters...cough...ix - wtf?? there is apparently no standard on params. I did create a custom module to handle the logic for each of the "bidders" but it's one of those you just slap together to make it work. I decided to create a custom ctools plugin that allows a dev to create a plugin for each of the bidders that will handle setting all the params necessary for each of the slots. Some bidder adapters use a single set of params for each ad and then some change the value of every param. It's freakin' nuts!!!
Anyway, here's a patch that takes care of what needs to happen on DFP's end to allow "easy" integration if someone needs to tackle it.
Comment #6
scottalan commentedWe were originally loading dfp_googletag.js as a JS_LIBRARY but should probably just be JS_DEFAULT. This makes it easier for other modules to inject their js before, such as prebid. I'm actively using this configuration and it works.
Comment #7
scottalan commentedI've made some other modifications to dfp_googletag_cmd.js and cleaned it up a bit. I've re-rolled the other patches into this patch. This should be the only patch needed.
Comment #8
scottalan commentedFound a bug so re-rolling the patch with a fix.
Comment #9
scottalan commentedTESTING:
This is a "test" patch that includes a submodule for Prebid.
I'm fighting getting the prebid requests to work every time with lazy loading the ads so removing the lazy loading scroll for now to get some feedback from Ad ops on a live staging site to confirm that are seeing the bids placed properly. I can then go back in and work this back into the original dfp_googltag.cmd.js file and the prebid-request.js file.
Comment #10
scottalan commentedI stripped out all of the functionality that sets the "page level settings" and AdOps wasn't seeing the correct parameters. This patch adds most of those back it but leaves out those that could cause issues with Prebid for now. Once again, this patch is a modified version of the dfp_googletag.cmd.js file and an additional sub-module (prebid).
Comment #11
scottalan commentedThis patch is a re-roll of the patch in #10. Updating the version of the prebid.js library to "v1.17.0-pre". This is what we are testing on.
Comment #12
scottalan commentedAdding some configuration to prebid via
pbjs.setConfig(). TheUserSyncconfig might not apply to everyone so I need to find a better way to add config. Possibly a hook that allows modules to add it to theprebidsettings array.This was necessary to continue testing this setup in a production environment.
Comment #13
scottalan commentedOnce again...this is a patch we are using to get a working setup for Prebid. Once we get a baseline using this mangled patch I will begin to work backwards ensuring that I add the lazy load functionality back in.
Modifying the configuration added in the last patch for
pbjs.setConfig()and adding the slots back to the globalgoogletag.slotsobject.Comment #14
scottalan commentedHere's a fully working patch. This is currently being tested on a Live production site that can get between 2-3 million users during peak time!!!
@bleen, Once I get full sign off that this is solid maybe I can take what I've learned in this implementation and port this to our D8 version as well. If you're interested...
Comment #15
scottalan commentedComment #16
scottalan commentedGot some feedback from OAO and it appears there are some issues with some of the ads being lazy loaded. Looking into this issue and will report back with a re-rolled patch to fix this.
Comment #17
scottalan commentedUpdated patch that should fix the issues with lazy loading ads and prebid.
Comment #18
scottalan commentedRe-rolling the patch:
Fixed a few bugs, added more comments, etc.
Added three drush commands for the prebid module:
1. 'drush prebid-clone 1.23.0' => 'Clone the Prebid.js library from Github at tag 1.23.0'
2. 'drush prebid-build ixBidAdapter,openxBidAdapter,rubiconBidAdapter' => 'Build a bundle with these bid adapters.'
3. drush prebid-add-library' => 'Move the generated prebid.js file to libraries.'
Full patch included
Comment #19
thoop@10tv.com commentedScott, thanks for the hard work on this! We are interested in utilizing this solution (and helping with the dev) but running into issues with the patches. It is not able to locate js/dfp_googletag.cmd.js. Any help will be appreciated!
Comment #20
scottalan commentedAre you using the 7.x-2.x-dev version of the module? This patch only applies to this branch
Comment #21
thoop@10tv.com commentedWe made progress with the patch but running into a few bugs in the 2.x code. Digging through that now.
Comment #22
thoop@10tv.com commentedScott, thanks again for this module. We resolved the issue with the 7.x-2.x version of the DFP module. We use infinite scroll on our site so we needed to create unique ids for the adunits. We'll submit that change back once we get the other changes up and running. As for Bidder, we are trying to get Audience Network setup via a plugin but not making much progress. Do you have any examples or documentation on how implement unique networks via plugins? Thanks!
Comment #23
jamaral86 commentedSmall change to prevent throw new error from breaking following code if pbjs object is missing, added console log instead, and enclosed the rest of the code in an else to prevent more errors.
Comment #24
scottalan commented@jamaral86
Thanks will you please open up a new issue and include your patch there.
Comment #26
scottalan commentedComment #27
scottalan commentedComment #28
scottalan commentedComment #31
scottalan commentedThis has been tested on a Production site for the last 4 months. Going to call this RTBC
Comment #32
vladimirausThank you for your contributions.
Drupal 7 is no longer supported.
Closing issue as outdated.