Skip to content

Commit

Permalink
Fix prebid#3059 by returning both hb_deal and hb_deal_${bidder_code}
Browse files Browse the repository at this point in the history
  • Loading branch information
ZLester committed Sep 9, 2018
1 parent b1e7843 commit ebe25fb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/targeting.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,16 @@ export function newTargeting(auctionManager) {
typeof winner.sendStandardTargeting === 'undefined' ||
winner.sendStandardTargeting ||
standardKeys.indexOf(key) === -1)
.map(key => ({
[(key === 'hb_deal') ? `${key}_${winner.bidderCode}`.substring(0, MAX_DFP_KEYLENGTH) : key.substring(0, MAX_DFP_KEYLENGTH)]: [winner.adserverTargeting[key]]
}))
.reduce((acc, key) => {
const targetingValue = [winner.adserverTargeting[key]];
const targeting = { [key.substring(0, MAX_DFP_KEYLENGTH)]: targetingValue };
if (key === 'hb_deal') {
const bidderCodeTargetingKey = `${key}_${winner.bidderCode}`.substring(0, MAX_DFP_KEYLENGTH);
const bidderCodeTargeting = { [bidderCodeTargetingKey]: targetingValue };
return [...acc, targeting, bidderCodeTargeting];
}
return [...acc, targeting];
}, [])
};
});

Expand Down

0 comments on commit ebe25fb

Please sign in to comment.