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

Adagio Bid Adapter: fix floor prices module support #10711

Merged
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
11 changes: 7 additions & 4 deletions modules/adagioBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {find} from '../src/polyfill.js';
import {
_map,
cleanObj,
deepAccess,
deepClone,
Expand Down Expand Up @@ -570,6 +569,7 @@ function _parseNativeBidResponse(bid) {
bid.native = native
}

// bidRequest param must be the `bidRequest` object with the original `auctionId` value.
function _getFloors(bidRequest) {
if (!isFn(bidRequest.getFloor)) {
return false;
Expand Down Expand Up @@ -996,7 +996,7 @@ export const spec = {

const aucId = generateUUID()

const adUnits = _map(validBidRequests, (rawBidRequest) => {
const adUnits = validBidRequests.map(rawBidRequest => {
const bidRequest = deepClone(rawBidRequest);

// Fix https://github.com/prebid/Prebid.js/issues/9781
Expand Down Expand Up @@ -1068,7 +1068,10 @@ export const spec = {
});

// Handle priceFloors module
const computedFloors = _getFloors(bidRequest);
// We need to use `rawBidRequest` as param because:
// - adagioBidAdapter generates its own auctionId due to transmitTid activity limitation (see https://github.com/prebid/Prebid.js/pull/10079)
// - the priceFloors.getFloor() uses a `_floorDataForAuction` map to store the floors based on the auctionId.
const computedFloors = _getFloors(rawBidRequest);
if (isArray(computedFloors) && computedFloors.length) {
bidRequest.floors = computedFloors

Expand Down Expand Up @@ -1149,7 +1152,7 @@ export const spec = {
});

// Build one request per organizationId
const requests = _map(Object.keys(groupedAdUnits), organizationId => {
const requests = Object.keys(groupedAdUnits).map(organizationId => {
return {
method: 'POST',
url: ENDPOINT,
Expand Down