From 747f2d13dfc475557861745bf416a87f44d496e8 Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Wed, 22 May 2019 17:39:23 -0700 Subject: [PATCH] always adding originalCpm and originalCurrency to bid object --- modules/currency.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/currency.js b/modules/currency.js index 17c38b17a98..7cd6d6944f1 100644 --- a/modules/currency.js +++ b/modules/currency.js @@ -188,6 +188,9 @@ export function addBidResponseHook(fn, adUnitCode, bid) { return (parseFloat(cpm) * getCurrencyConversion(fromCurrency, toCurrency)).toFixed(3); }; + bid.originalCpm = bid.cpm; + bid.originalCurrency = bid.currency; + // execute immediately if the bid is already in the desired currency if (bid.currency === adServerCurrency) { return fn.call(this, adUnitCode, bid); @@ -212,8 +215,6 @@ function wrapFunction(fn, context, params) { let fromCurrency = bid.currency; try { let conversion = getCurrencyConversion(fromCurrency); - bid.originalCpm = bid.cpm; - bid.originalCurrency = bid.currency; if (conversion !== 1) { bid.cpm = (parseFloat(bid.cpm) * conversion).toFixed(4); bid.currency = adServerCurrency;