From 78d495b3830b5786adcd4d45c9f44487d0d1758e Mon Sep 17 00:00:00 2001 From: Demetrio Girardi Date: Mon, 22 May 2023 07:43:51 -0700 Subject: [PATCH] Prebid 8: use `prebid.floors.floorMin` instead of `prebid.floorMin` (#9899) --- modules/priceFloors.js | 5 +++-- test/spec/modules/priceFloors_spec.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/priceFloors.js b/modules/priceFloors.js index 92aecb0ca50..1936c445c0a 100644 --- a/modules/priceFloors.js +++ b/modules/priceFloors.js @@ -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 diff --git a/test/spec/modules/priceFloors_spec.js b/test/spec/modules/priceFloors_spec.js index f232631d73d..b2ae8efba32 100644 --- a/test/spec/modules/priceFloors_spec.js +++ b/test/spec/modules/priceFloors_spec.js @@ -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, @@ -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,