-
Notifications
You must be signed in to change notification settings - Fork 748
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
Currency conversion utility function #1482
Comments
We discussed in last week's Prebid Server committee meeting and have a simplified proposal: provide a simple utility function:
bid adapters can make use of this function as needed. e.g. if they only support floors in USD, they can convert non-USD imp[].bidfloor values. |
Hi @bretg, @bszekely1
or if BidAdapter will be responsible for retrieving bidrequest.prebid.currency, utility function will be the same as for bid price:
where prioritizePbsRatescan be retrieved from bidRequest.prebid.currency.usepbsrates or hardcoded by bidAdapter. If PBS should not use request currencies for converting bidfloor for bidadapters, |
Good call @BraslavskiyAndrey - this sounds good:
|
To make conversion in adapter possible next steps should be done:
and pass it to the bidder constructor. Call currencyConversionService method
it will thow PrebidException class if conversion failed with a reason in a message |
Implemented in PBS-Go 0.166.0. Adapters now have access to a helper method for performing currency conversions with the following signature:
The helper method already incorporates both server level and request level currency rates. It is accessible from the
|
Type of issue
The overall objective of Prebid is provide global attributes for those that are common across bid adapters, examples being bidfloor, video attributes, etc. This ticket is specific to support for bid floor. When the currency of the bid floor is different than the currency of the bid adapter supports, there needs to be a method bid adapters can call to convert the currency.
Goals
Proposed Design
If the currency conversion feature is enabled in a host PBS instance, Bid Adapters need a utility function to convert currencies of different types. Below are the technical requirements:
3.If the input currency in the utility function is the same as the set currency, no conversion is necessary
Interfaces
Request
Response
Other information
The text was updated successfully, but these errors were encountered: