Skip to content

Commit

Permalink
Update rubiconBidAdapter.js
Browse files Browse the repository at this point in the history
  • Loading branch information
spotxslagle authored Oct 8, 2024
1 parent 7ac768f commit 0f4decc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ config.getConfig('rubicon', config => {

const GVLID = 52;

let impIdMap = {};

var sizeMap = {
1: '468x60',
2: '728x90',
Expand Down Expand Up @@ -211,6 +213,17 @@ export const converter = ortbConverter({
}

setBidFloors(bidRequest, imp);
// ensure unique imp IDs for twin adunits
var adUnitCodeCount = {};
var adUnitCode = imp.id;
if (adUnitCodeCount[adUnitCode]) {
adUnitCodeCount[adUnitCode] += 1;
imp.id = adUnitCode + adUnitCodeCount[adUnitCode];
} else {
adUnitCodeCount[adUnitCode] = 1;
}
// update adunit map so we can translate back to original adunit code
impIdMap[imp.id] = adUnitCode;

return imp;
},
Expand Down Expand Up @@ -302,6 +315,7 @@ export const spec = {

if (filteredRequests && filteredRequests.length) {
const data = converter.toORTB({bidRequests: filteredRequests, bidderRequest});
impIdMap = {};

filteredHttpRequest.push({
method: 'POST',
Expand Down

0 comments on commit 0f4decc

Please sign in to comment.