Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

Support a Prebid Server currency override

Open spormeon opened this issue 3 years ago • 9 comments

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

spormeon avatar Oct 18 '21 23:10 spormeon

@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"

spormeon avatar Oct 20 '21 18:10 spormeon

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.

bretg avatar Oct 20 '21 21:10 bretg

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?

spormeon avatar Oct 20 '21 21:10 spormeon

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.

bretg avatar Oct 20 '21 21:10 bretg

Ok, an override sounds good to me. I didn't say "only in USD" , I said, ability to set.

spormeon avatar Oct 20 '21 21:10 spormeon

I think moving the ortb2 processing higher in the code might suffice. Consulting the geniuses.

bretg avatar Oct 20 '21 21:10 bretg

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');
   }

bretg avatar Dec 02 '21 19:12 bretg

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.

bretg avatar Dec 02 '21 20:12 bretg

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[bot] avatar Jan 08 '22 23:01 stale[bot]