-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Pubgears Header Bidding Adapter #953
Conversation
Is it possible to implement without using additional scripts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see if you can remove additional scripts downloaded by the adapter.
Try rebasing onto current master branch, or if you prefer it may be easier to start with a new branch cut from current master branch and reintroduce your changes there. |
@Walexander looks like this needs to be rebased off master. |
The rebase has been completed. Apologies for the delay. |
It would be difficult to implement this without loading our external library. The adapter is built around receiving events from the script element itself. The code that publishes these events is implemented in the external library. |
src/adapters/pubgears.js
Outdated
var SLOT_LIST_ATTRIBUTE = 'slot-list'; | ||
var PUBLISHER_ATTRIBUTE = 'pub'; | ||
var FLAG_ATTRIBUTE = 'flag'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove all these extra new lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
src/adapters/pubgears.js
Outdated
initialized = true; | ||
} | ||
|
||
function loadScript(script) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the standard adLoader.loadScript
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use the script
element to obtain the bid response data from our API. The adLoader.loadScript
does not provide the element either via its return value or callback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Walexander can you give an example? That seems like a strange pattern to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our API uses DOM events instead of method calls. The adapter registers event listeners with the script element here
src/adapters/pubgears.js
Outdated
|
||
function getCreative(resource) { | ||
|
||
var bookends = '%%'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use utils.replaceTokenInString
for this functionality or a string template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion. This has been done.
also add unit test to insure tokens in creative template are expanded correctly
@Walexander thanks for the updates. It looks like your adapter is adding 2 bid responses using the test params. See screenshot here: You should only add a Also - it doesn't appear that |
test/spec/adapters/pubgears_spec.js
Outdated
@@ -215,7 +215,7 @@ describe('PubGearsAdapter', () => { | |||
expect(bidmanager.addBidResponse.calledOnce).to.be.ok | |||
}) | |||
|
|||
it('should not completely fucking fail', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol
LGTM |
A note here that the use of |
…built * 'master' of https://github.com/prebid/Prebid.js: (21 commits) add lodash as dependency (prebid#1174) fix size mapping for s2s (prebid#1175) Improve footer styling (prebid#1171) Bugfix: internal bids requested overwritten (prebid#1173) pre-release version bump Prebid 0.23.0 Release Yieldbot adapter - multiple requestBids per pageview (prebid#1146) Widespace adapter validate size fix (prebid#1140) Audience Network: bid when at least one valid slot size (prebid#1148) Quantcast adaptor (prebid#1063) AOL Adapter - ONE Mobile endpoint implemented. (prebid#1115) Prebid Server to Server (prebid#1165) Pubgears Header Bidding Adapter (prebid#953) remove old adloader#trackPixel (prebid#1159) added audit beacon to detect misuse of this bidder. Detects auctions… (prebid#1134) Bidfluence CDN endpoint URL update (prebid#1163) AdSupply adapter (prebid#1162) Sonobi Adapter - Enable size overrides (prebid#1141) Added an editorconfig file to match jshint and jssrc files. (prebid#1147) force cpm to be a number (prebid#1161) ...
* adapters/pubgears: initial commit of adapter, unit tests * adapters/pubgears: new specs * adapaters.json: added pubgears * 😎 style fixes * pubgears: support for non-array `sizes` bids * pubgears: use `placementCode`, not `adUnitCode` * pubgears style changes * pubgears: remove vertical white-space * pubgears: use utils.replaceInToken instead of own also add unit test to insure tokens in creative template are expanded correctly * rename test ... ahem ... * pubgears: send $0 bid as status code 2
Type of change
Description of change
Adapter and specs for Pubgears header bidder.
Other information