-
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
Aardvark v1.0 #2507
Aardvark v1.0 #2507
Conversation
3396a45
to
d5cf40c
Compare
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.
Hi @dejanstrbac Thanks for submitting this new adapter. I was taking a look through the code and found a few things that should be reviewed again.
In addition to the comments in-line below, when I was testing the new adapter with the test params in the .md file - I was get a 'no bid' type of response from the system. Can you take a look into this as well? Ideally we should have a valid test bid that can serve to verify everything's working with a new adapter.
Below is a copy of the response:
[{"nurl": "", "cid": "2ba9426c4afb42", "media": "banner", "error": "No bids received for WygO", "adm": "", "id": "WygO", "cpm": "0.00"}]
modules/aardvarkBidAdapter.js
Outdated
} | ||
|
||
if (bidderRequest && bidderRequest.gdprConsent) { | ||
rMap.payload.gdpr = bidderRequest.gdprConsent.gdprApplies; |
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.
There may be rare chances where this value may be undefined
if the CMP didn't have it defined. Do you want to set your own back-up/default value in that case? If so, I would recommend to check if typeof bidderRequest.gdprConsent.gdprApplies === 'boolean'
so that you can accept natural cases where gdprApplies
was set to `false.
modules/aardvarkBidAdapter.js
Outdated
const syncs = []; | ||
var url = '//' + SYNC_ENDPOINT + '/cs'; | ||
var gdprApplies = true; | ||
if (typeof gdprConsent.gdprApplies === 'boolean') { |
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 add to the check if gdprConsent
exists. On pages without a CMP, this current code would lead to an undefined error.
modules/aardvarkBidAdapter.js
Outdated
currency: rawBid.currency ? rawBid.currency : AARDVARK_CURRENCY, | ||
netRevenue: rawBid.netRevenue ? rawBid.netRevenue : true, | ||
ttl: rawBid.ttl ? rawBid.ttl : AARDVARK_TTL, | ||
exchange: rawBid.ex, |
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.
Can remove this exchange
field from the bidResponse
object. This is not a current field.
modules/aardvarkBidAdapter.js
Outdated
const AARDVARK_TTL = 300; | ||
const AARDVARK_CURRENCY = 'USD'; | ||
|
||
var hasSynced = false; |
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.
could change this to let
instead of var
.
modules/aardvarkBidAdapter.js
Outdated
var referer = utils.getTopWindowUrl(); | ||
var pageCategories = []; | ||
|
||
if (window.rtkcategories && Array.isArray(window.rtkcategories)) { |
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.
Can you clarify the use-case here for reading this window object?
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.
This is a requirement from several tier 1 publishers in order to allow RTK buyers to target specific inventory. It is currently implemented across Hearst and others
@jsnellbaker updated according to the requested changes - thanks! |
modules/aardvarkBidAdapter.js
Outdated
|
||
interpretResponse: function(serverResponse, bidRequest) { | ||
var bidResponses = []; | ||
utils._each(serverResponse.body, function(rawBid) { |
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.
Can you review the logic in using this utils._each
function? It's currently iterating through each of the properties of the response object and evaluating them each as an entire bid object.
This is a copy of the bid response object that I saw when I tested and it treated rawBid
as demo_exchange
(from the ex
field) during the first pass of the function.
{"ex": "demo_exchange", "width": 300, "cpm": 0.01, "cid": "2edd6ea6821b56", "media": "banner", "adm": "<div>Demo Unit</div>", "id": "1234", "height": 250}
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've been updating the demo auction today, sorry about that. That is an array returned from our endpoint, so it gets iterated over as an array, not a map. It is now an array as it should be.
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 making the changes; LGTM
* PreBid.js/master: (79 commits) increment prebid version Prebid 1.11.0 release replace find reference with imported version (prebid#2542) GDPR - add consent information to PBS cookie_sync request (prebid#2530) add support for safeframe workflow and new utils method to read adunit sizes (prebid#2523) Smart: GDPR support (prebid#2528) fix getPreparedBidForAuction to look for renderer on correct bid (prebid#2505) PubMatic Adapter: Bug fix to read all bids from seatBid array (prebid#2520) Create GXOne Bid Adapter and tests for it (prebid#2540) Lifestreet: gdpr and consent string parameters (prebid#2537) -GDPR support added in media net bidder (prebid#2538) change AppNexus endpoint to use ORTB (prebid#2532) fixed bug when latitute/longitue are not provided (prebid#2533) added gdpr support to userSync in rubicon adapter (prebid#2531) Show only summary and errors (prebid#2514) Aardvark v1.0 (prebid#2507) Add 1024x768 (size_id = 53) in sizeMap (prebid#2527) Add new Adapter brainyBidAdapter (prebid#2458) OpenX Adapter: GDPR Support (prebid#2504) add support for latLong in rubicon adapter (prebid#2508) ...
* Aardvark v1.0 + Add GDPR support * required modifications * cover case where gdprConsent data is not present * demo auction update * ignore empty bids * accept empty bids
Type of change
Description of change
Support for Prebid.js > v1.0
Be sure to test the integration with your adserver using the Hello World sample page.
christ@rtk.io @naegelin is the official maintainer and responsible (CTO of RTK.io)