-
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
Feature : Display counter at Adslot level #2940
Conversation
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.
Thank you for changing the implementation. Just a few small changes and this will be good
src/adUnits.js
Outdated
return deepAccess(adUnits, `${adunit}.counter`) || 0; | ||
} | ||
|
||
exports.adunitCounter = { |
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.
new modules should prefer ES6 module interface (ie import
/ export
).
src/adUnits.js
Outdated
function incrementCounter(adunit) { | ||
adUnits[adunit] = adUnits[adunit] || {}; | ||
adUnits[adunit].counter = (deepAccess(adUnits, `${adunit}.counter`) + 1) || 1; | ||
return adUnits[adunit].counter; |
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.
why return the count?
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.
It is increment and get rather than just increment. Will be useful for developer.
src/adUnits.js
Outdated
return adUnits[adunit].counter; | ||
} | ||
|
||
function getCounter(adunit) { |
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 jsdoc definitions to public functions.
@mkendall07 Have made required changes, please check the same. |
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.
LGTM. It's also a nice starting point to start moving some of the adUnit logic into adUnits.js
modules/medianetBidAdapter.js
Outdated
@@ -122,7 +122,8 @@ function slotParams(bidRequest) { | |||
let params = { | |||
id: bidRequest.bidId, | |||
ext: { | |||
dfp_id: bidRequest.adUnitCode | |||
dfp_id: bidRequest.adUnitCode, | |||
display_count: bidRequest.displayCount |
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.
err small nit with this name. Isn't it more accurate as bidRequestsCount
? We don't know if it was displayed. Or auctionParticipationCount
Please also submit a PR to update the documentation for the bidder. Somewhere in here would be good: http://prebid.org/dev-docs/bidder-adaptor.html#bidder-adaptor-Building-the-Request |
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.
LGTM but I agree it could use a better name.
@mkendall07 @snapwich @jaiminpanchal27 have renamed it to |
Type of change
Description of change
As discussed in #2295 thread, some bidders will be interested in getting the Display Counter which is added in this PR.
buildRequests
of an adapter will be called with an keydisplayCount
at adSlot level.This PR also contains Media.net adapter integration with this feature
Other information
As discussed in #2802 with @mkendall07 , the ad unit counter variable is set private.