Skip to content
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

Prebid 8: use prebid.floors.floorMin instead of prebid.floorMin #9899

Merged
merged 1 commit into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prebid 8: use prebid.floors.floorMin instead of prebid.floorMin
  • Loading branch information
dgirardi committed May 3, 2023
commit 6e521c1e5e204d572403499d103cfd9c2640595d
5 changes: 3 additions & 2 deletions modules/priceFloors.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,9 @@ export function getFirstMatchingFloor(floorData, bidObject, responseObject = {})
matchingRule
};
// use adUnit floorMin as priority!
if (typeof deepAccess(bidObject, 'ortb2Imp.ext.prebid.floorMin') === 'number') {
matchingData.floorMin = bidObject.ortb2Imp.ext.prebid.floorMin;
const floorMin = deepAccess(bidObject, 'ortb2Imp.ext.prebid.floors.floorMin');
if (typeof floorMin === 'number') {
matchingData.floorMin = floorMin;
}
matchingData.matchingFloor = Math.max(matchingData.floorMin, matchingData.floorRuleValue);
// save for later lookup if needed
Expand Down
4 changes: 2 additions & 2 deletions test/spec/modules/priceFloors_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ describe('the price floors module', function () {
let myBidRequest = { ...basicBidRequest };

// should take adunit floormin first even if lower
utils.deepSetValue(myBidRequest, 'ortb2Imp.ext.prebid.floorMin', 2.2);
utils.deepSetValue(myBidRequest, 'ortb2Imp.ext.prebid.floors.floorMin', 2.2);
expect(getFirstMatchingFloor(inputFloorData, myBidRequest, { mediaType: 'banner', size: '*' })).to.deep.equal({
floorMin: 2.2,
floorRuleValue: 1.0,
Expand All @@ -297,7 +297,7 @@ describe('the price floors module', function () {
delete inputFloorData.matchingInputs;

// should take adunit floormin if higher
utils.deepSetValue(myBidRequest, 'ortb2Imp.ext.prebid.floorMin', 3.0);
utils.deepSetValue(myBidRequest, 'ortb2Imp.ext.prebid.floors.floorMin', 3.0);
expect(getFirstMatchingFloor(inputFloorData, myBidRequest, { mediaType: 'banner', size: '*' })).to.deep.equal({
floorMin: 3.0,
floorRuleValue: 1.0,
Expand Down