-
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
Quantcast adaptor #1063
Quantcast adaptor #1063
Conversation
…in the requests object
Hey @ShreeniwasIyer are https://github.com/prebid/prebid.github.io/tree/master/dev-docs/bidders |
Thanks @aneuway2 for pointing out. Done now through prebid/prebid.github.io#204 |
Hi @aneuway2 , @mkendall07 - does this need any more inputs before review? I see that PRs submitted after this one have already been reviewed - so was wondering if I missed something.. |
@ShreeniwasIyer |
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.
@ShreeniwasIyer Please check comments
Test parameters has bidder: 'qcx', it should be bidder:'quantcast' as defined in adapters.json
Also i am not able get bids back while testing from localhost due to CORS.
src/adapters/quantcast.js
Outdated
|
||
const DEFAULT_BID_FLOOR = 0.0000000001; | ||
// The following 2 constants are adopted from bidfactory.js codes | ||
const BID_STATUS_CODE_AVAILABLE = 1; |
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.
Use STATUS.GOOD and STATUS.NO_BID defined in constants.json
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. Thanks. @jaiminpanchal27
src/adapters/quantcast.js
Outdated
if(utils.isEmpty(responseText)) { | ||
return; | ||
} | ||
let response = JSON.parse(responseText); |
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.
wrap this in try catch
src/adapters/quantcast.js
Outdated
publisherId = '' + bids[0].params.publisherId; | ||
utils._each(bids, function(bid) { | ||
// make sure the "sizes" are an array of arrays | ||
if (!(bid.sizes[0] instanceof Array)) { |
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.
DFP allows sizes to be array and array of arrays. Support both.
parseSizesInput function https://github.com/prebid/Prebid.js/blob/master/src/utils.js#L117 will help
src/adapters/quantcast.js
Outdated
let returnEmptyBid = function() { | ||
var bidsRequested = $$PREBID_GLOBAL$$._bidsRequested.find(bidSet => bidSet.bidderCode === BIDDER_CODE).bids; | ||
if (bidsRequested.length > 0) { | ||
let bid = bidfactory.createBid(BID_STATUS_CODE_EMPTY); |
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.
Pass bidRequest as second param
src/adapters/quantcast.js
Outdated
let bidRequests = {}; | ||
|
||
let returnEmptyBid = function() { | ||
var bidsRequested = $$PREBID_GLOBAL$$._bidsRequested.find(bidSet => bidSet.bidderCode === BIDDER_CODE).bids; |
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.
Use getBidRequest https://github.com/prebid/Prebid.js/blob/master/src/utils.js#L518
test/spec/adapters/quantcast_spec.js
Outdated
|
||
beforeEach(() => { | ||
bidsRequestedOriginal = pbjs._bidsRequested; | ||
pbjs._bidsRequested = []; |
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.
Use
@jaiminpanchal27 I fixed the code as per the comments above. We are also currently pushing an change to our domain handling to allow for testing from localhost on certain test cases, this one inclusive. I believe it should be done in the next 3 hours or so. |
@jaiminpanchal27 All changes are done both in JS and server side and it seems we are good to go. Please review. (The last build is working from the PR perspective, but failing on some other test, which seems to pass sometimes and fail at other times. Please re-invoke the tests and I am confident they will pass.) |
@ShreeniwasIyer I now see response but its not a valid bid. Here is the response i get. |
Hi @jaiminpanchal27 , thanks for your review comments. We have fixed a few issues we noticed along the way. Now our bidder is definitely responding with the bids and would do so, so long as you are testing this on localhost and you are doing this from an US IP. Please note that we have updated the publisherId in the PR - so please use the revised one while testing. Can you please review and let us know? |
@ShreeniwasIyer I still see the same CORS error. I am testing from US ip. I am testing using this example page, https://jsfiddle.net/L618t79a/ Update prebid path before testing at your end. Ajax request to your endpoint Let me know if i am doing something wrong here. |
Thanks @jaiminpanchal27 for the review. Would you be merging it into the master when ready for next release? Do I need to do anything else? |
@ShreeniwasIyer It looks good to me. No you don't need to do anything else from your side. |
} catch(e) { | ||
// Malformed JSON | ||
utils.logError("Malformed JSON received from server - can't do anything here"); | ||
return; |
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.
Should really try to add a error bid here if possible
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.
@mkendall07 I tried to, but at that point in code we don't have the placement code for which the empty text response came and hence returning an error bid isn't possible..
This is merged into master. Please submit a PR to the docs repo to add a file for your adapter to the bidders directory so your adapter's params will appear on the bidders page. Thank you for contributing |
…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) ...
…21.0 to aolgithub-master * commit '4d573b42c5fbbabf23fed48fa042b75a72dd16b2': (31 commits) Added prebidServer in aolPartnersIds.json. Added adapters in aolPartnersIds.json. Added changelog entry. Prebid 0.23.1 Release Add trafficSourceCode + test (prebid#1184) Clear cookie sync to prevent multiple calls (prebid#1181) change s2s adapter to filter out units with empty sizes array (prebid#1179) Sharethrough: Change to using a closure for the callback from ajax to preserve bidObj (prebid#1108) check array length when mapping sizes (prebid#1180) Bugfix/encoding url (prebid#1178) 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) ...
We are implementing a new adaptor for Quantcast with a code name qcx for the bidderCode.
Type of change
Description of change
Other information