-
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
Prebid 1.0 - currency support #1089
Comments
Suggested mechanism for utilizing the loaded exchange rates: pbjs.bidderSettings = {
abc: {
bidCpmAdjustment : function(bidCpm, bid){
return bidCpm * getCurrencyConversion("JPY");
}
},
xyz: {
bidCpmAdjustment : function(bidCpm, bid){
grossToNetConversion=0.85;
return bidCpm * getCurrencyConversion("JPY") * grossToNetConversion;
}
}
} |
Hi Bret, I have worked on something similar with a customer using the fixer.io API however it requires the price to be set up with a "Custom CPM Bucket Sizing" or a specific bidderSettings as bucket are capped. Also important to notice that as the currency rate will vary, the keyword will change and could not match the line items anymore... Cheers, |
Hi Bret, It is great that you are working on this.. Cheers! Mijhael.- |
Hi Mijhael, I think the best and more stable is the solution propose by Bret to host a static currency conversion file that will be updated daily if the request is successful. So if the web service is no more available, the rate will be the one from the day before the failure. Cheers, Antoine |
Right - the proposed design doesn't involved a remote API. If a publisher chooses to do currency conversion, a separate javascript file would be loaded that sets up an array that would be used by an internal API. This file would be updated daily by the Prebid Org team and cachable for 24 hours, and we'd be responsible for making sure it's fresh. Since the same file will be used across the internet, browsers will only have to load it once per day across all Prebid-using sites. For pubs that don't want to rely on a common currency conversion file, we'll allow specification of a custom file. |
We're considering using fixer.io as the source of currency conversions. However, it doesn't support all the currencies listed above. Exceptions:
So the plan is that the initial public service will contain only the currencies provided by http://api.fixer.io/latest. If a particular publisher requires currencies not on this list, they will be able to host their own conversion file and use the code. |
Would this allow conversions to EUR? Since you were talking about USD being the only go to. I'm asking because we have DFP setup with EURO as currency. |
Not sure if this will help, but if anyone is looking for a solution in the meantime this is what we're using to convert to Canadian:
|
@pribeh doesn't this increase the overall latency? |
Are we sure there are no non-us currency bidders that should be accounted for? |
@Slind14 It has too but by how much I haven't confirmed. I'll take a look in a bit to see if I can measure the latency. But, if you look on fixer's home page you can see they're estimation of response time to be 5.84ms – which isn't too shabby. |
@pribeh yeah, I was just wondering why you aren't caching it. |
@Slind14 Because I'm not sure how(?). |
I haven't worked with prebid jet and have no idea of its structure. Maybe someone who knows the source could let us know if there is already some sort of mem caching happening which could be used for this or if we would need to handle it our self. |
Some details about the in-progress implementation of the Prebid currency support:
Format of the conversion rate file:
|
Waiting for modules so this can be refactored to fit into a module. |
Tracking issue for currency support in Prebid 1.0 as defined in Issue #891. In additional to passing the currency abbreviation to adapters, we're going to spec a system where a static currency conversion file is stored on a CDN and updated daily. This file would optionally be loaded and used to adjust bid CPMs from specified bidders.
Note: our assumption here is that conversion is only necessary from USD to the following major currencies: AUD
BRL
CAD
CHF
CLP
CNY
CZK
DKK
EUR
GBP
HKD
HUF
IDR
ILS
INR
JPY
KRW
MXN
MYR
NOK
NZD
PHP
PKR
PLN
RUB
SEK
SGB
THB
TRY
TWD
ZAR
Let us know if there other source or destination currencies required. Wanted to keep the list to just those likely to be needed in order to keep the file small.
The text was updated successfully, but these errors were encountered: