OpenX official adapter release: Fixing the existing openx adapter and…#896
OpenX official adapter release: Fixing the existing openx adapter and…#896mkendall07 merged 1 commit intoprebid:masterfrom
Conversation
src/adapters/openx.js
Outdated
src/adapters/openx.js
Outdated
src/adapters/openx.js
Outdated
|
@mkendall07 Thanks for the review! I've fixed the ones you have mentioned, please take a look again and let me know if there are additional things to fix :) |
|
@lntho |
src/adapters/openx.js
Outdated
There was a problem hiding this comment.
Consider using the "alias" pattern with baseAdapter to allow whitelabeling of your adapter.
See https://github.com/prebid/Prebid.js/blob/master/src/adapters/appnexusAst.js#L22 for example
src/adapters/openx.js
Outdated
There was a problem hiding this comment.
window.top can throw. Please add try/catch.
There was a problem hiding this comment.
Okay, will add a try catch here
src/adapters/openx.js
Outdated
src/adapters/openx.js
Outdated
There was a problem hiding this comment.
It doesn't look like this img is used anywhere. Did you want to trigger a pixel/beacon here?
There was a problem hiding this comment.
You're right, the return is not needed. This might be a relic from testing phases, I will remove the return.
src/adapters/openx.js
Outdated
There was a problem hiding this comment.
These lines need try/catch
There was a problem hiding this comment.
The window.top here is already checked below at line 195, I think it should be fine here without a try/catch?
There was a problem hiding this comment.
Yeah that should be good.
src/adapters/openx.js
Outdated
There was a problem hiding this comment.
the bc parameter is for us to track what kind of service is making the ad request in our events
src/adapters/openx.js
Outdated
src/adapters/openx.js
Outdated
There was a problem hiding this comment.
encodeURIComponent is safe to use directly. You don't need && here.
There was a problem hiding this comment.
Here we're trying to check if window.location.href exists to begin with, and if it is undefined we want to leave it as such instead of encoding it to be a string 'undefined'
test/spec/adapters/openx_spec.js
Outdated
There was a problem hiding this comment.
nit: replace all vars with const or let in this file.
src/adapters/openx.js
Outdated
There was a problem hiding this comment.
Please pass the bidRequest bid object through the bidfactory.createBid(CONSTANTS.STATUS.GOOD, bid) so that we can match the bidId param. Example https://github.com/prebid/Prebid.js/blob/master/src/adapters/appnexusAst.js#L116
|
@lntho |
|
The PR has been updated, please let me know if there are additional issues that you see :) |
|
@lntho thanks, will review again. |
src/adapters/openx.js
Outdated
There was a problem hiding this comment.
nit: there is an extra space after this brace.
src/adapters/openx.js
Outdated
There was a problem hiding this comment.
we have a newline at the end of the file by convention.
|
Verified bids received and ads renderered. LGTM. Please address those 2 style items and we'll be good to merge. Thanks for contributing! |
… adding test coverage on it
|
The style changes have been made, thank you for the review! |
|
Thanks. BTW you don't have to squash your commits (it's actually easier to review if you don't). Github has automatic squashing during merge to master. |
|
@lntho |
… adding test coverage on it
Type of change
bidder code: openx
Send All Bids Ad Server Keys: hb_pb_openx, hb_adid_openx, hb_size_openx
Default Deal ID Ad Server Key: hb_deal_openx
Other information
Note:
The OpenX adapter requires setup and approval from your OpenX team. Please reach out to your OpenX representative or Support@openx.com for more information and to enable using this adapter.