-
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
onetag Bid Adapter : add support for price floors, supply chain, and gpid #8675
Conversation
@onetag-dev can you please add a unit test or two around the schain validation function? 🙏 |
|
…gpid (#8675) * Adds support for price floor, supply chain, GPID * Removes unused import * Updates onetag test file * Remove trailing space * Add unit tests for schain validation function Co-authored-by: federico <f.liccione@onetag.com>
…gpid (prebid#8675) * Adds support for price floor, supply chain, GPID * Removes unused import * Updates onetag test file * Remove trailing space * Add unit tests for schain validation function Co-authored-by: federico <f.liccione@onetag.com>
…gpid (prebid#8675) * Adds support for price floor, supply chain, GPID * Removes unused import * Updates onetag test file * Remove trailing space * Add unit tests for schain validation function Co-authored-by: federico <f.liccione@onetag.com>
…gpid (prebid#8675) * Adds support for price floor, supply chain, GPID * Removes unused import * Updates onetag test file * Remove trailing space * Add unit tests for schain validation function Co-authored-by: federico <f.liccione@onetag.com>
function getBidFloor(bidRequest, mediaType, sizes) { | ||
const priceFloors = []; | ||
if (typeof bidRequest.getFloor === 'function') { | ||
sizes.forEach(size => { | ||
const floor = bidRequest.getFloor({ | ||
currency: 'EUR', | ||
mediaType: mediaType || '*', | ||
size: [size.width, size.height] | ||
}); | ||
floor.size = deepClone(size); | ||
if (!floor.floor) { floor.floor = null; } | ||
priceFloors.push(floor); | ||
}); | ||
} | ||
return priceFloors; | ||
} |
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.
was this a mistake to set all bid currency to EUR for floors? am seeing a warning when bidding is set in USD:
WARNING: Price Floors: Unable to get currency conversion for getFloor for bidder onetag. You must have currency module enabled with defaultRates in your currency config
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 @andyblackwell, that's not a mistake if what is written in documentation is true:
The job of the getFloor() function is to retrieve an appropriate floor for the requesting Bid Adapter, for a given auction context. If a Bid Adapter performs a getFloor() call with a currency different than the currency of the floor data, the module will attempt to perform a currency conversion, utilizing the convertCurrency function in the global Prebid object.
If a currency conversion is successful in getFloor(), the resulting floor will be returned to the requesting Bid Adapter. If the conversion failed, the module will return the original floor currency defined within the selected rule location data set.
So we always request the price floor in EUR, but if conversion fails we pass the original currency (e.g USD) to our server, which makes the right conversion internally. Let me know if you catch something wrong in my point.
Thanks
Type of change
Description of change
Add support for price floors, supply chain and gpid