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 Core and Several Bid Adapters: fix win notification price bug #8171

Merged
merged 12 commits into from
Mar 14, 2022
2 changes: 1 addition & 1 deletion modules/axonixBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const spec = {
const { nurl } = bid || {};

if (bid.nurl) {
triggerPixel(replaceAuctionPrice(nurl, bid.cpm));
triggerPixel(replaceAuctionPrice(nurl, bid.originalCpm || bid.cpm));
};
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/koblerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const onBidWon = function (bid) {
const adServerPrice = deepAccess(bid, 'adserverTargeting.hb_pb', 0);
const adServerPriceCurrency = config.getConfig('currency.adServerCurrency') || SUPPORTED_CURRENCY;
if (isStr(bid.nurl) && bid.nurl !== '') {
const winNotificationUrl = replaceAuctionPrice(bid.nurl, cpm)
const winNotificationUrl = replaceAuctionPrice(bid.nurl, bid.originalCpm || cpm)
.replace(/\${AUCTION_PRICE_CURRENCY}/g, cpmCurrency)
.replace(/\${AD_SERVER_PRICE}/g, adServerPrice)
.replace(/\${AD_SERVER_PRICE_CURRENCY}/g, adServerPriceCurrency);
Expand Down
2 changes: 1 addition & 1 deletion modules/mediaforceBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export const spec = {
onBidWon: function(bid) {
const cpm = deepAccess(bid, 'adserverTargeting.hb_pb') || '';
if (isStr(bid.burl) && bid.burl !== '') {
bid.burl = replaceAuctionPrice(bid.burl, cpm);
bid.burl = replaceAuctionPrice(bid.burl, bid.originalCpm || cpm);
triggerPixel(bid.burl);
}
},
Expand Down
5 changes: 2 additions & 3 deletions src/prebid.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,8 @@ $$PREBID_GLOBAL$$.renderAd = hook('async', function (doc, id, options) {

if (shouldRender) {
// replace macros according to openRTB with price paid = bid.cpm
bid.ad = replaceAuctionPrice(bid.ad, bid.cpm);
bid.adUrl = replaceAuctionPrice(bid.adUrl, bid.cpm);

bid.ad = replaceAuctionPrice(bid.ad, bid.originalCpm || bid.cpm);
bid.adUrl = replaceAuctionPrice(bid.adUrl, bid.originalCpm || bid.cpm);
// replacing clickthrough if submitted
if (options && options.clickThrough) {
const {clickThrough} = options;
Expand Down
6 changes: 3 additions & 3 deletions src/secureCreatives.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,16 @@ function handleEventRequest(reply, data, adObject) {
}

export function _sendAdToCreative(adObject, reply) {
const { adId, ad, adUrl, width, height, renderer, cpm } = adObject;
const { adId, ad, adUrl, width, height, renderer, cpm, originalCpm } = adObject;
// rendering for outstream safeframe
if (isRendererRequired(renderer)) {
executeRenderer(renderer, adObject);
} else if (adId) {
resizeRemoteCreative(adObject);
reply({
message: 'Prebid Response',
ad: replaceAuctionPrice(ad, cpm),
adUrl: replaceAuctionPrice(adUrl, cpm),
ad: replaceAuctionPrice(ad, originalCpm || cpm),
adUrl: replaceAuctionPrice(adUrl, originalCpm || cpm),
adId,
width,
height
Expand Down