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

Adform bidder adapter is incompatible with the currency module

Open dmitriyshashkin opened this issue 2 years ago • 6 comments

Type of issue

Bug

Description

When I try to setup the currency module and specify the adServerCurrency param, adf bider stops bidding completely. Apparently the bidder is depended on the currency module param for some unknown reason: https://github.com/prebid/Prebid.js/blob/master/modules/adfBidAdapter.js#L94

Is there any particular reason why bidders should have access to the params related to other prebid modules? Apparently the exposure of these parameters creates some odd entanglement.

Steps to reproduce

  1. Create HB setup with adf bidder included
  2. Add currency module and set adServerCurrency param. I experimented with "UAH"

Expected results

  1. The addition of the currency module has no affect on the adf bider

Actual results

  1. Adf bidder stops bidding

Platform details

Latest prebid version, nvm 15, OS Fedora 36

dmitriyshashkin avatar Jun 15 '22 16:06 dmitriyshashkin

I am unable to reproduce this because using the example provided by adf I don't get any bid regardless of currency settings - tagging @Pupis for visibility.

Could you provide a test page, or a HAR/screenshot of the ADF request?

I don't think adapters picking currency from configuration is necessarily wrong, but it's not clear what's happening in this case. I'm guessing that the backend is refusing to bid in some currencies instead of converting to them, in which case it does seem like it would be better if it ignored currency entirely. If you're using price floors it's also possible that something broke there.

dgirardi avatar Jun 15 '22 17:06 dgirardi

adform.har.gz

Attached is the bid request HAR file. We're not using floors currently.

Apparently we've already encountered this issue before with the old version of the adform adapter (in prebid 4). But back then it had an undocumented param "rcur" that allowed to overwright the currency setting. The new adapter (previously adformOpenRTB) doesn't have this option so it seems that there is no other option besides disabling the currency module alltogether and converting the bids ourselves.

I don't think adapters picking currency from configuration is necessarily wrong

The undocumented dependency on the params of seemingly unrelated modules is rather confusing. It took us some time to understand what's wrong. The "currency" setting is described in the docs as relating to the currency module only. It's not a global setting that is used by multiple modules.

dmitriyshashkin avatar Jun 20 '22 17:06 dmitriyshashkin

In that case we need Adform to help - tagging @braizhas as well.

dgirardi avatar Jun 21 '22 18:06 dgirardi

The undocumented dependency on the params of seemingly unrelated modules is rather confusing. It took us some time to understand what's wrong. The "currency" setting is described in the docs as relating to the currency module only. It's not a global setting that is used by multiple modules.

Certainly emphasize with a long frustrating bout of troubleshooting, but I'm going to argue that the currency is important to bid adapters. Providing this info is not random 'entanglement'. Bid adapters must consider currency in these scenarios:

  1. Some bidders prefer to bid in the pub's currency. For bidders that can handle bidding in the pubs currency, exchange-rate discrepancies are lower and easier to investigate.
  2. Floor conversions - say a floor is specified as 1.00 CAD. Bidders that can only handle floors defined in their native currency, need to call the getFloors function to convert the floor to something they can handle.

Looking at the adform adapter code, I think it could do a better job setting a default currency if none is provided, but overall my view is that this is an endpoint problem. The job of Prebid.js is to provide an environment that bid adapters can use to gather the auction information they need to formulate a request to their endpoint. If their endpoint can only handle a certain currency, it is their responsibility to code the adapter appropriately.

bretg avatar Jul 13 '22 16:07 bretg

The job of Prebid.js is to provide an environment that bid adapters can use to gather the auction information they need to formulate a request to their endpoint.

The idea that params which are not a part of the Prebid core configuration and are only described in the documentation of the optional module are a part of that environment seems to me a bit counter-intuitive. But I'd had much less problem with that if the inclusion of this param did not prevent the bidder from bidding.

If their endpoint can only handle a certain currency, it is their responsibility to code the adapter appropriately.

Definitely agree. Though I must say that the endpoint behavior is subject to change. If a currency becomes to volatile, it's support might be dropped by the endpoint. It'll take some time before the adapter code reflects that change. Setting this parameter on a bidder level might be a better approach.

Still I'd prefer any solution over the current one. Currently I have no other option but to patch the adapter code myself.

dmitriyshashkin avatar Jul 13 '22 19:07 dmitriyshashkin

@dmitriyshashkin, sorry for the late response. Updated Adform endpoint. It will respond in USD if currency conversion for the requested currency is unavailable. Does this solution fit your needs?

braizhas avatar Jul 19 '22 13:07 braizhas

appears complete

patmmccann avatar Sep 07 '22 20:09 patmmccann