-
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
Optimize AOL adapter and heavily reduce the size #653
Conversation
- no aditional request for a JavaScript library - also supports deals - unit tests - Number.isInterger() polyfill
This is great news!! Really looking forward to this. |
I think the failed build was not caused by the changes introduced in this PR. It might be related to #642. |
ajax(pubapiUrl, (response) => { | ||
if (!response && response.length <= 0) { | ||
utils.logError('Empty bid response', BIDDER_CODE, bid); | ||
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.
For an empty bid response, you will still want to add a bid response, likely with _addErrorBidResponse
.
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 is now fixed.
I'm seeing issues with the |
@nedstankus that is not part of this PR. You are not testing the correct git branch. Please use |
@marian-r You're correct-- |
Are there still any issues/concerns regarding this PR? It has been marked as 'needs review' so do you have an estimate of when the PR could be reviewed? |
I should be able to review today or tomorrow, thanks for your patience. |
These update of AOL adapter also changes the way how gross to net price calculations are handled for AOL bidder. Would it be possible to include a note about this change in the release notes once this is released? I would suggest something like this: If you're using AOL as a bidder, please contact your Marketplace account team for a quick config fix (not doing gross to net config client side) as it's now done server side for AOL. And do you have any estimate of when this could be released? Is it possible to include this in the 0.14.0 milestone? |
@marian-r |
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 looks great, thanks for the submission. As noted an empty seatbid
array in the response shouldn't throw an error as this is normal "no bid" response. Also if possible to sync the bid request/response IDs.
if (!bid) { | ||
utils.logError('mismatched bid: ' + context.placement, ADTECH_BIDDER_NAME, context); | ||
try { | ||
bidData = response.seatbid[0].bid[0]; |
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.
An empty bid or "no bid" response causes this to fail which throws an error, though a response with an empty seatbid
array appears to be common in my testing, so should be handled as other than Error.
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.
When an error is thrown here, addErrorBidResponse()
is called, which adds bid response to the bidmanager with status 2 (empty or error bid response). That, I believe, is correct behavior, but I removed error logging, so it won't appear as error in the console when debugging. That was done in 981fb75.
var bidreq = _mapUnit(bid); | ||
window.ADTECH.loadAd(bidreq); | ||
}); | ||
var bidResponse = bidfactory.createBid(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.
Consider setting the bid response ID to match the bid request ID as described here: #509.
Doing so will position the adapter to take advantage of Prebid Roadmap features such as secure iframe support, improved analytics, Prebid Auctions and so on.
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 this suggestion. Done in 38bd3ae.
|
||
// add it to the bid manager | ||
function _addErrorBidResponse(bid, response = {}) { | ||
var bidResponse = bidfactory.createBid(2); |
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.
Consider setting the bid response ID to match the bid request ID as described here: #509.
Doing so will position the adapter to take advantage of Prebid Roadmap features such as secure iframe support, improved analytics, Prebid Auctions and so on.
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 this suggestion. Done in 38bd3ae.
All issues have been addressed. |
if (cpm === null || isNaN(cpm)) { | ||
return _addErrorBid(response, context); | ||
if (!SERVER_MAP.hasOwnProperty(regionParam)) { | ||
console.warn(`Unknown region '${regionParam}' for AOL bidder.`); |
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.
console.warn
doesn't play nice in IE 9. Please use utils.logWarn
instead for safety.
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.
The reason for using console.warn()
directly is that this warning is meant to be shown when a publisher is configuring a site and uses incorrect region. I want to show the warning even if the debug mode is turned off, so the publisher can see what's wrong. And I expect publisher to be configuring it in a browser other than IE9 🤔. After the site is configured correctly, the warning should go away, so I believe it is safe to use this console.warn()
. If you feel otherwise, please let me know.
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.
fair enough I suppose. Thanks
@marian-r |
@mkendall07 thanks for merging. I'm just following with the testing params: This is for 728x90 placements:
This is for 300x250 placements:
Please let me know whether they work. |
Type of change
Description of change
Number.isInterger()
polyfill.Other information
AOL adapter is now maintained by @aol/header-bidding team.