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.09k forks source link

Proposal: Bidder specific SupplyChain objects #4465

Closed jsnellbaker closed 4 years ago

jsnellbaker commented 5 years ago

Type of Issue

Intent to Implement (extension to https://github.com/prebid/Prebid.js/issues/3870)

Description

To broaden the capabilities of the initial schain module for Prebid.js, we're looking to introduce a new means for publishers to be able to specify unique schain configs for individual bidders. This ability to selectively override the global schain config (which will continue to exist for more general use-cases) will enable publishers to better describe their relationships/situations with other exchanges, resellers, and other entities within the schain object(s) before it gets passed along to downstream parties.

Further details on the changes to publishers can be found below. Adapters shouldn't expect any changes to the existing documented implementation; any adapters already supporting schain should expect their setup to continue to work as is. If publisher did setup a bidder override, the schain module will assign the appropriate schain config to you on the bidRequests object to ensure you receive the correct information.

Implementation Details for Publishers

As mentioned above, the changes for publishers are optional. Those setups that only need a single global config will continue to work as is. For those publishers who need more advanced/unique setups, they'll be required to:

The following example demonstrates both means to set the schain object in the Prebid config code:

// setup the global config for all bidders
pbjs.setConfig({
  "schain": {
    "validation": "strict",
    "config": {
      "ver":"1.0",
      "complete": 1,
      "nodes": [
        {
          "asi":"indirectseller.com",
          "sid":"00001",
          "hp":1
        }
      ]
    }
  }
});

// where you set an override for specific bidders
pbjs.setBidderConfig({
  "bidders": ["bidderA"],
  "config": {
    "schain": {
      "validation": "strict",
      "config": {
        "ver": "1.0",
        ... // rest of unique setup for this bidderA
      }
    }
  }
});

In the above setup:

The pbjs.setBidderConfig() can be called multiple times if you have different configs for different bidders. If it fits the use-case (such as if you're using multiple aliases of the same bidder), a single bidderConfig can be shared by multiple bidders by listing them in the bidders array field.

Other Information

Related conversation where this approach was discussed: https://github.com/prebid/Prebid.js/issues/3870 Specific comment link to the thread in that issue: here

PR on setting up bidder level configs and access control on config.getConfig() to this bidder data: https://github.com/prebid/Prebid.js/pull/4334

jsnellbaker commented 5 years ago

Note - based on discussion in https://github.com/prebid/Prebid.js/pull/4479 I have updated this I2I to reflect the revised set of planned changes.

The changes focused on the previous adapter section. With the new changes, adapters don't need to change their implementation, so that section has been removed entirely.