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

Using prebid server with currency module results in double currency conversion #4579

Closed
dmitriyshashkin opened this issue Dec 11, 2019 · 8 comments
Labels

Comments

@dmitriyshashkin
Copy link
Contributor

dmitriyshashkin commented Dec 11, 2019

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

@pboisso
Copy link

pboisso commented Dec 17, 2019

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?

@dmitriyshashkin
Copy link
Contributor Author

@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

@pboisso
Copy link

pboisso commented Dec 17, 2019

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.

@pboisso
Copy link

pboisso commented Dec 17, 2019

Prebid server should output the resulting currency in the bid object. This would make things easier to debug as well as solve this issue.

@bretg
Copy link
Collaborator

bretg commented Dec 18, 2019

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 cur field on the response).

@stale
Copy link

stale bot commented Jan 1, 2020

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.

@stale stale bot added the stale label Jan 1, 2020
@SyntaxNode
Copy link

Being address in PBS-Go by prebid/prebid-server#1154

@stale stale bot removed the stale label Jan 1, 2020
@stale
Copy link

stale bot commented Jan 15, 2020

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.

@stale stale bot added the stale label Jan 15, 2020
@stale stale bot closed this as completed Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants