Skip to content
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

Intent to Implement: PrebidServer Adapter Cleanup #2420

Closed
jaiminpanchal27 opened this issue Apr 18, 2018 · 3 comments
Closed

Intent to Implement: PrebidServer Adapter Cleanup #2420

jaiminpanchal27 opened this issue Apr 18, 2018 · 3 comments

Comments

@jaiminpanchal27
Copy link
Collaborator

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
}
  1. 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
Copy link
Contributor

dbemiller commented Apr 19, 2018

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
Copy link
Collaborator

second @dbemiller's comments.

@jaiminpanchal27
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants