-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Using prebid server with currency module results in double currency conversion #4579
Comments
We experience this bug as well. It seems to have started sometime in august/september 2019 or between prebid 2.9 and 2.32. Any work around other than stopping using PBS for the time being? |
@pboisso The problem appeared since #3951 and 2.26 was the first version affected https://github.com/prebid/Prebid.js/releases/tag/2.26.0 To fix hardcode this constant https://github.com/prebid/Prebid.js/blob/master/modules/prebidServerBidAdapter/index.js#L20 to have the same value as the server currency |
Thanks @dmitriyshashkin. Now, we download the bundled package from the prebid download page, so we can't change this constant directly other than by editing the downloaded minimized js file. I will try by changing the prebidserver chunck from a.currency=e.currency?e.currency:"USD" to a.currency=e.currency?e.currency:"CAD" and see how it goes. |
Prebid server should output the resulting currency in the bid object. This would make things easier to debug as well as solve this issue. |
This is an unfortunate bug. Two bugs actually. Fixed the PBJS side in #4638 and #4642 . @SyntaxNode will need to address the PBS-Go part of this (missing |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Being address in PBS-Go by prebid/prebid-server#1154 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Type of issue
Bug
Description
So, this constant is hardcoded to USD while adServerCurrency parameter might be set to a different value. PrebidServer adapter sends adServerCurrency as "cur" parameter to prebid-server. Prebid server uses it's own currency converter and converts bid's currency, but doesn't output the resulting currency in the bid object. Prebid.js prebid server adapter uses DEFAULT_S2S_CURRENCY instead. Prebid.js currency module sees a bid with a currency that is different from adServerCurrency value and converts the bid amount again.
I think the best way to handle this is to set DEFAULT_S2S_CURRENCY to adServerCurrency. This might be a problem if the currency converter is disabled on the side of prebid-server, but I'm not sure if that's possible and how common is such setup.
The alternative solution is to honor bidderCurrencyDefault when bidder works through PBS. Right now DEFAULT_S2S_CURRENCY is used instead.
Steps to reproduce
adServerCurrency must be set to some currency that is different to USD, some bidder working through prebid server must make a bid in USD
Test page
http://myguitar.co/video/7xs2s.html
Expected results
Prebid server converts bid to adServerCurrency, Prebid.js doesn't perform the conversion second time.
Actual results
Prebid server converts bid to adServerCurrency, Prebid.js converts it again.
Platform details
v2.44.0-pre
The text was updated successfully, but these errors were encountered: