Prebid.js
Prebid.js copied to clipboard
Support a Prebid Server currency override
as noted over in this issue on PBS https://github.com/prebid/prebid-server/issues/2050#issue-1029667923
when you have the currency module installed and using e.g. GBP as the adServerCurrency, PBS is sending cur: GBP , picking it up from the adServerCurrency: GBP
no clue if this is a PBJ or PBS issue/ problem
I tried setting: ortb2: { cur: [ "USD" ] },
but it wont "override" it, sets [GBP, USD]
if I set adServerCurrency: USD, it works, but nothing then gets converted for targeting
@mansinahar found the problem after chat on the issue raised on prebid server board, its here apparently https://github.com/prebid/Prebid.js/blob/master/modules/prebidServerBidAdapter/index.js#L770-L776
prebidserver module sends adServerCurrency: X as cur: X, creates problems if want request bids in USD and convert on fly back to ad server for GBP (adServerCurrency: "GBP", sends cur: "GBP"
I answered the issue over in prebid-server. This isn't a PBJS issue, it's a bid adapter issue.
if want request bids in USD
What is the use case? I'm guessing it's a workaround to the above-mentioned adapter bug, but open to the idea that perhaps there's a use case that ought to be considered.
having the ability to "set" cur: USD in PBJS, lets anyone using "currency module" to set USD as PBS request currency, 99.99% of them all want/ bid mostly in USD. Their saying their just using whats there, your saying, they should take it and change it. Six of one , half a dozen of another and a Pub cant control it at all and its their setups?
I firmly disagree that PBS should work only in USD. Currency is a complex and important feature that bid adapters need to take responsibility for handling correctly rather than lobotomizing a key feature that makes PBS a global product working across PBJS, App, and AMP.
However, it would be easy enough to support a currency override for the pbsBidAdapter. Changing the title of this issue.
Ok, an override sounds good to me. I didn't say "only in USD" , I said, ability to set.
I think moving the ortb2 processing higher in the code might suffice. Consulting the geniuses.
I'm proposing we move these two lines up higher in the code
const commonFpd = getConfig('ortb2') || {};
mergeDeep(request, commonFpd);
Move them above line 774:
const adServerCur = config.getConfig('currency.adServerCurrency');
And then change that line to skip the currency.adServerCurrency block if request.cur is already set:
if (! deepAccess(request,"cur")) {
const adServerCur = config.getConfig('currency.adServerCurrency');
}
The only way moving this could cause a change of any kind is if the ortb2 object contained any of these:
- _appendSiteAppDevice - I think this whole routine could be deprecated at some point -- just use ortb2 instead of special site/app setConfig.
- schain
- aliases
- eids
- eid permissions
- multibid
- GDPR applies and GDPR consent
- CCPA
- COPPA
ortb2 could conceivably be set with GDPR, CCPA, and COPPA values, but I'd argue that (A) that's not what we've documented and (B) The values should be the same either way, so moving the priority order should not matter.
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.