prebid / Prebid.js

Setup and manage header bidding advertising partners without writing code or confusing line items. Prebid.js is open source and free.
https://docs.prebid.org
Apache License 2.0
1.33k stars 2.08k forks source link

Intent to Implement: PrebidServer Adapter Cleanup #2420

Closed jaiminpanchal27 closed 6 years ago

jaiminpanchal27 commented 6 years ago

Type of issue

Feature Request

Description

For client side header bidding we have got bidderFactory as base adapter for all the bidders. For server side header bidding we use PrebidServer adapter to create bidRequests and interpret bidResponse. Over the course of adding more features, we had to add some hardcoded usage of bidders to do various tasks. Some of theme are updating bid params, convert type of params, set default values and maybe something else in future.

Proposed Solution

Extend bidder spec to add new functions to remove all hardcoded occurrences. PrebidServer adapter will use this functions if they exist and update the request payload. Both these functions will be optional

1) getS2SDefaultValues() - This function will return s2s default values for particular bidder. For appnexus it will return this https://github.com/prebid/Prebid.js/blob/master/modules/prebidServerBidAdapter.js#L36

/**
 * @return {object} defaultConfig
 */
getS2SDefaultValues: function () {
   // return default values
}

2) getS2SBidParams(params) - This function will receive its own bid params and return updated params. In case of appnexus, it needs to convert type of params and convert camel case params to underscore. https://github.com/prebid/Prebid.js/blob/master/modules/prebidServerBidAdapter.js#L474

/**
 * @param {object} params Bidders own params. `adUnit.bid.params`
 * @return {object} params Updated params
 */
getS2SBidParams: function (params) {
  // update params
  return params;
}
dbemiller commented 6 years ago

One big thing jumps out at me:

  1. It might not be a good idea to tie S2SDefaultValues to the Bidders. Someone might want to be a PBS host without being a Bidder.

For example, a bunch of independent Publishers might join together and split the cost of hosting a PBS instance on a neutral domain so that they can benefit from shared usersyncs without giving up control to a particular Bidder.

It's also generally better to have two small interfaces than one big one.

  1. get is a misleading name here. Something like update or transform would be clearer.
snapwich commented 6 years ago

second @dbemiller's comments.

jaiminpanchal27 commented 6 years ago

Discussed this offline with @dbemiller For 1. we will create a new module s2sVendors and export S2S_VENDORS with default values.

Taking inspiration from amp project. https://github.com/ampproject/amphtml/blob/master/extensions/amp-a4a/0.1/callout-vendors.js