From 93fb2fa060e038e56735c270c176a1ee8d60b718 Mon Sep 17 00:00:00 2001 From: Demetrio Girardi Date: Mon, 4 Apr 2022 17:23:30 -0700 Subject: [PATCH] Update PBS adapter documentation (#3662) * Update PBS documentation Unify PBS documentation as a module (not a bidder); remove duplication about it from `setConfig`; add stored impression examples PBJS PR: https://github.com/prebid/Prebid.js/pull/8154 * wordsmithing Co-authored-by: bretg --- dev-docs/adunit-reference.md | 4 +- dev-docs/bidders/prebidServer.md | 131 ---------- dev-docs/modules/prebidServer.md | 243 ++++++++++++++++++ .../publisher-api-reference/addAdUnits.md | 4 +- dev-docs/publisher-api-reference/setConfig.md | 157 +---------- 5 files changed, 250 insertions(+), 289 deletions(-) delete mode 100644 dev-docs/bidders/prebidServer.md create mode 100644 dev-docs/modules/prebidServer.md diff --git a/dev-docs/adunit-reference.md b/dev-docs/adunit-reference.md index 11be1a49bc..8ebbde2b0b 100644 --- a/dev-docs/adunit-reference.md +++ b/dev-docs/adunit-reference.md @@ -32,7 +32,7 @@ See the table below for the list of properties on the ad unit. For example ad u | Name | Scope | Type | Description | |--------------+----------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `code` | Required | String | An identifier you create and assign to this ad unit. Generally this is set to the ad slot name or the div element ID. Used by [setTargetingForGPTAsync()](/dev-docs/publisher-api-reference/setTargetingForGPTAsync.html) to match which auction is for which ad slot. | -| `bids` | Required | Array[Object] | Array of bid objects representing demand partners and associated parameters for a given ad unit. See [Bids](#adUnit.bids) below. | +| `bids` | Optional | Array[Object] | Array of bid objects representing demand partners and associated parameters for a given ad unit. See [Bids](#adUnit.bids) below. | | `mediaTypes` | Optional | Object | Defines one or more media types that can serve into the ad unit. For a list of properties, see [`adUnit.mediaTypes`](#adUnit.mediaTypes) below. | | `labelAny` | Optional | Array[String] | Used for [conditional ads][conditionalAds]. Works with `sizeConfig` argument to [pbjs.setConfig][configureResponsive]. | | `labelAll` | Optional | Array[String] | Used for [conditional ads][conditionalAds]. Works with `sizeConfig` argument to [pbjs.setConfig][configureResponsive]. | @@ -44,6 +44,8 @@ See the table below for the list of properties on the ad unit. For example ad u See the table below for the list of properties in the `bids` array of the ad unit. For example ad units, see the [Examples](#adUnit-examples) below. +Note that `bids` is optional only for [Prebid Server stored impressions](/dev-docs/modules/prebidServer.html#stored-imp), and required in all other cases. + {: .table .table-bordered .table-striped } | Name | Scope | Type | Description | |------------+----------+---------------+------------------------------------------------------------------------------------------------------------------------------------------| diff --git a/dev-docs/bidders/prebidServer.md b/dev-docs/bidders/prebidServer.md deleted file mode 100644 index f599598761..0000000000 --- a/dev-docs/bidders/prebidServer.md +++ /dev/null @@ -1,131 +0,0 @@ ---- -layout: bidder -title: Prebid Server -description: Prebid Server S2S Adaptor -biddercode: prebidServer -pbjs: true -media_types: banner, video -gdpr_supported: true ---- - -### Overview - -The Prebid Server Adapter is a meta-adapter. It's not an actual bidder, but -rather a way to get a batch of bids from other bidders with one request. -A request for the set of auctions is sent to Prebid Server, which performs -all the auctions server side (S2S), responding in time for Prebid.js to -send the results to the ad server. This lightens the performance load on the user's device. - -### Bid Params - -Bid params are sourced from the adapter configurations set for client side. These do not need to change for Prebid Server. - -{: .alert.alert-warning :} -**Errors in bidder parameters will cause Prebid Server to reject the -entire request.** The Prebid Server philosophy is to avoid silent failures -- -we assume you will test changes, and that it will be easier to notice a -4xx error coming from the server than a silent failure where it skips just -the bad parameter. - -### Configuration -To enable prebid server, set the following configuration. - -``` -pbjs.setConfig({ - s2sConfig: { - accountId : '12345', - bidders : ['appnexus','pubmatic', 'rubicon'], - defaultVendor: 'appnexus', - timeout: 300 - } -}); -``` - -To use multiple prebid servers, just define `s2sConfig` as an array. -The same bidder cannot be set in both configs. For example: - -``` -pbjs.setConfig({ - s2sConfig: [ - { - accountId: '12345', - bidders: ['appnexus','rubicon'], - defaultVendor: 'appnexus', - timeout: 300, - }, - { - accountId: '678910', - bidders: ['pubmatic'], - defaultVendor: 'rubicon', - timeout: 300, - }, - ], -}); -``` -Configuration options - -{: .table .table-bordered .table-striped } -| Field | Type | Required? | Description | -|--------------+---------------+-----------+--------------------------------------------------------------------------| -| `accountId` | String | yes | Prebid Server account ID. | -| `bidders` | Array[String] | yes | List of bidder codes; must have been enabled during Prebid.js build. | -| `defaultVendor` | String | no | Automatically includes all following options in the config with vendor's default values. Individual properties can be overridden by including them in the config along with this setting. | -| `enabled` | Boolean | no | Enables S2S; default: `false` (`true` when defaultVendor is set). | -| `endpoint` | String | no | Set the endpoint. For example: `https://prebid.adnxs.com/pbs/v1/openrtb2/auction` | -| `timeout` | Number | no | Bidder timeout, in milliseconds; default: `1000`. | -| `syncEndpoint` | String | no | Configures the user-sync endpoint. Highly recommended. | -| `adapter` | String | no | Adapter code; default: `"prebidServer"`. | -| `secure` | Integer | no | Override Prebid Server's determination of whether the request needs secure assets. Set to `1` to force secure assets on the response, or `0` for non-secure assets. | -| `adapterOptions` | Object | no | Arguments will be added to resulting OpenRTB payload to Prebid Server. | -| `extPrebid` | Object | no | Arguments will be added to resulting OpenRTB payload to Prebid Server. | - -### Examples - -**Video (Outstream):** -Note that currently, outstream video rendering must be configured by the publisher. In the adUnit, a `renderer` object must be defined, which includes a `url` pointing to the video rendering script, and a `render` function for creating the video player. See https://prebid.org/dev-docs/show-outstream-video-ads.html for more information. - -```javascript -var adUnits = [{ - code: 'div-gpt-ad-1460505748561-0', - mediaTypes: { - video: { - playerSize: [640, 480], - context: 'outstream', - mimes: ['video/mp4'], - protocols: [1, 2, 3, 4, 5, 6, 7, 8], - playbackmethod: [2], - skip: 1 - } - }, - bids: [ - { - bidder: 'appnexus', - params: { - placementId: 13232392 - }, - - } - ], - renderer: { - url: 'https://cdn.adnxs.com/renderer/video/ANOutstreamVideo.js', - render: function (bid) { - adResponse = { - ad: { - video: { - content: bid.vastXml, - player_height: bid.playerHeight, - player_width: bid.playerWidth - } - } - } - // push to render queue because ANOutstreamVideo may not be loaded yet. - bid.renderer.push(() => { - ANOutstreamVideo.renderAd({ - targetId: bid.adUnitCode, // target div id to render video. - adResponse: adResponse - }); - }); - } - } -}]; -``` diff --git a/dev-docs/modules/prebidServer.md b/dev-docs/modules/prebidServer.md new file mode 100644 index 0000000000..ef25117274 --- /dev/null +++ b/dev-docs/modules/prebidServer.md @@ -0,0 +1,243 @@ +--- +layout: page_v2 +title: Module - Prebid Server Adapter +display_name: Prebid Server Adapter +description: Server-to-Server header bidding +page_type: module +module_code : prebidServerBidAdapter +enable_download : true +vendor_specific: false +sidebarType : 1 +--- +### Overview + +The Prebid Server Adapter is a meta-adapter. It's not an actual bidder, but +rather a way to get a batch of bids from other bidders with one request. +A request for the set of auctions is sent to Prebid Server, which performs +all the auctions server side (S2S), responding in time for Prebid.js to +send the results to the ad server. This lightens the performance load on the user's device. + +### Configuration +Here's an example config enabling the AppNexus Prebid Server: + +```javascript +pbjs.setConfig({ + s2sConfig: { + accountId : '12345', + bidders : ['appnexus','pubmatic', 'rubicon'], + defaultVendor: 'appnexus', + timeout: 300 + } +}); +``` + +To use multiple prebid servers, just define `s2sConfig` as an array. +The same bidder cannot be set in both configs. For example: + +```javascript +pbjs.setConfig({ + s2sConfig: [ + { + accountId: '12345', + bidders: ['appnexus','pubmatic'], + defaultVendor: 'appnexus', + timeout: 300, + }, + { + accountId: '678910', + bidders: ['rubicon'], + defaultVendor: 'rubicon', + timeout: 300, + }, + ], +}); +``` +There are many configuration options for s2sConfig: + +{: .table .table-bordered .table-striped } +| Attribute | Scope | Type | Description | +|------------+---------+---------+---------------------------------------------------------------| +| `accountId` | Required | String | Your Prebid Server account ID. This is obtained from whoever's hosting your Prebid Server. | +| `bidders` | Optional | Array of Strings | Which bidders auctions should take place on the server side | +| `allowUnknownBidderCodes` | Optional | Boolean | Allow Prebid Server to bid on behalf of bidders that are not explicitly listed in the adUnit. See important [note](#allowUnknownBidderCodes) below. Defaults to `false`. | +| `defaultVendor` | Optional | String | Automatically includes all following options in the config with vendor's default values. Individual properties can be overridden by including them in the config along with this setting. See the Additional Notes below for more information. | +| `enabled` | Optional | Boolean | Enables this s2sConfig block - defaults to `false` | +| `timeout` | Required | Integer | Number of milliseconds allowed for the server-side auctions. This should be approximately 200ms-300ms less than your Prebid.js timeout to allow for all bids to be returned in a timely manner. See the Additional Notes below for more information. | +| `adapter` | Required | String | Adapter to use to connect to Prebid Server. Defaults to 'prebidServer' | +| `endpoint` | Required | URL or Object | Defines the auction endpoint for the Prebid Server cluster. See table below for object config properties. | +| `syncEndpoint` | Required | URL or Object | Defines the cookie_sync endpoint for the Prebid Server cluster. See table below for object config properties. | +| `userSyncLimit` | Optional | Integer | Max number of userSync URLs that can be executed by Prebid Server cookie_sync per request. If not defined, PBS will execute all userSync URLs included in the request. | +| `syncTimeout` | Optional | Integer | Maximum number of milliseconds allowed for each server-side userSync to load. Default is 1000. | +| `syncUrlModifier` | Optional | Object | Function to modify a bidder's sync url before the actual call to the sync endpoint. Bidder must be enabled for s2sConfig. | +| `coopSync` | Optional | Boolean | Whether or not PBS is allowed to perform "cooperative syncing" for bidders not on this page. Publishers help each other improve match rates by allowing this. Default is true. | +| `defaultTtl` | Optional | Integer | Configures the default TTL in the Prebid Server adapter to use when Prebid Server does not return a bid TTL - 60 if not set | +| `adapterOptions` | Optional | Object | Arguments will be added to resulting OpenRTB payload to Prebid Server in every impression object at request.imp[].ext.BIDDER. See the example above. | +| `extPrebid` | Optional | Object | Arguments will be added to resulting OpenRTB payload to Prebid Server in request.ext.prebid. See the examples below. | + +If `endpoint` and `syncEndpoint` are objects, these are the supported properties: + +{: .table .table-bordered .table-striped } +| Attribute | Scope | Type | Description | +|------------+---------+---------+---------------------------------------------------------------| +| p1Consent | Required | String | Defines the auction endpoint or the cookie_sync endpoint for the Prebid Server cluster for non-consent requests or users who grant consent. | +| noP1Consent | Required | String | Defines the auction endpoint or the cookie_sync endpoint for the Prebid Server cluster for users who do not grant consent. (This is useful for a server configured to not accept any cookies to ensure compliance regulations.) | + +**Notes on s2sConfig properties** + +- Currently supported vendors are: appnexus, openx, and rubicon +- When using `defaultVendor` option, `accountId` still needs to be defined. +- If `bidders` is omitted, only adUnits that also omit bidders will be sent to Prebid Server. See the [stored impressions](#stored-imp) example below. +- If the `s2sConfig` timeout is greater than the Prebid.js timeout, the `s2sConfig` timeout will be automatically adjusted to 75% of the Prebid.js timeout in order to fit within the auction process. +- When using the `endpoint` or `syncEndpoint` object configs, you should define both properties. If either property is not defined, Prebid Server requests for that type of user will not be made. If you do not need to distinguish endpoints for consent reasons, you can simply define the same URL value in both fields or use the String version of the field (which is configured to use defined URL for all users). +- When `allowUnknownBidderCodes` is `true`, bidders that have not been explicitly requested in [`adUnit.bids`](../adunit-reference.html#adunitbids) may take part in the auction. This can break custom logic that relies on the availability of a bid request object for any given bid. Known scenarios where custom code won't get the request when there's an "unknown bidder": + - There will not be a [`bidRequested`](getEvents.html) event. + - In the [MASS custom renderers](/dev-docs/modules/mass.html#configuration-parameters) module, `payload.bidRequest` will be undefined. + - In the [Price Floors module](/dev-docs/modules/floors.html), custom schema functions will see the bidRequest object as undefined. + + +Additional options for `s2sConfig` may be enabled by including the [Server-to-Server testing module]({{site.baseurl}}/dev-docs/modules/s2sTesting.html). + +**Passing the Referrer to Server Side Adapters** + +* Setting `extPrebid.origreferrer` will be recognized by some server-side adapters as the referring URL for the current page. + +### Bid Params + +Bid params are sourced from the adapter configurations set for client side. These do not need to change for Prebid Server. + +{: .alert.alert-warning :} +**Errors in bidder parameters will cause Prebid Server to reject the +entire request.** The Prebid Server philosophy is to avoid silent failures -- +we assume you will test changes, and that it will be easier to notice a +4xx error coming from the server than a silent failure where it skips just +the bad parameter. + + +### Examples + +s2sConfig example with the endpoint attributes defined as strings: +```javascript +pbjs.setConfig({ + s2sConfig: [{ + accountId: '1001', + bidders: ['bidderA', 'bidderB'], + endpoint: 'https://mypbs.example.com/path', + syncEndpoint: 'https://mypbs.example.com/path', + timeout: 300 + }] +}) +``` + +s2sConfig example with the endpoint attributes defined as objects: +```javascript +pbjs.setConfig({ + s2sConfig: [{ + accountId: '1001', + bidders: ['bidderA', 'bidderB'], + endpoint: { + p1Consent: 'https://mypbs.example.com/path', + noP1Consent: 'https://mypbs2.example.com/path' + }, + syncEndpoint: { + p1Consent: 'https://mypbs.example.com/path', + noP1Consent: 'https://mypbs2.example.com/path' + }, + timeout: 300 + }] +}) +``` + +**Server-Side Aliases** + +You may want to run a particular bidder on the client for banner, but that same bidder on the +server for video. You would do this by setting a **server-side** alias. For example: + +```javascript +pbjs.setConfig({ + s2sConfig: [{ + accountId: '1', + bidders: ['tripleliftVideo'], + defaultVendor: 'appnexus', + timeout: 500, + extPrebid: { + aliases: { + tripleliftVideo: tripleLift + } + } + }] +}) +``` + +Here's how it works: + +1. Video ad units are coded with the dynamic alias. e.g. tripleliftVideo +1. The s2sConfig.bidders array contains 'tripleliftVideo' telling Prebid.js to direct bids for that code to the server +1. Finally, the extPrebid.aliases line tells Prebid Server to route the 'tripleliftVideo' biddercode to the 'triplelift' server-side adapter. + +**Video via s2sConfig** + +Supporting video through the Server-to-Server route can be done by providing a couple of extra arguments on the `extPrebid` object. e.g. + +```javascript +pbjs.setConfig({ + s2sConfig: [{ + accountId: '1001', + bidders: ['rubicon', 'pubmatic'], + defaultVendor: 'rubicon', + timeout: 250, + extPrebid: { + cache: { + vastxml: {returnCreative: false} + }, + targeting: { + pricegranularity: {"ranges": [{"max": 40.00, "increment": 1.00}]} + } + } + }] +}) +``` + + + +**Stored impressions** + +Prebid Server stored [requests](/prebid-server/endpoints/openrtb2/pbs-endpoint-auction.html#stored-requests) and [responses](/prebid-server/endpoints/openrtb2/pbs-endpoint-auction.html#stored-responses-pbs-java-only) can be requested through the adUnit `ortb2Imp` property. For these cases, it's not necessary to specify `bids`: + +```javascript +pbjs.addAdUnits([{ + code: 'example-stored-request', + mediaTypes: { + banner: { + sizes: [[300, 250]] + } + }, + ortb2Imp: { + ext: { + prebid: { + storedrequest: { + id: 'your-stored-request-id' + } + } + } + }, +}, { + code: 'example-stored-response', + mediaTypes: { + banner: { + sizes: [[300, 250]] + } + }, + ortb2Imp: { + ext: { + prebid: { + storedauctionresponse: { + id: 'your-stored-response-id' + } + } + } + } +}]) +``` + +## Related Reading +- [Prebid Server Overview](/prebid-server/overview/prebid-server-overview.html) diff --git a/dev-docs/publisher-api-reference/addAdUnits.md b/dev-docs/publisher-api-reference/addAdUnits.md index 60df9ebc50..1ad30680b8 100644 --- a/dev-docs/publisher-api-reference/addAdUnits.md +++ b/dev-docs/publisher-api-reference/addAdUnits.md @@ -21,7 +21,7 @@ See the table below for the list of properties on the ad unit. For example ad u |--------------+----------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `code` | Required | String | Unique identifier that you create and assign to this ad unit. Used to set query string targeting on the ad. If using GPT, we recommend setting this to slot element ID. | | `sizes` | Required | Array[Number] or Array[Array[Number]] | All the sizes that this ad unit can accept. Examples: `[400, 600]`, `[[300, 250], [300, 600]]`. For 1.0 and later, prefer [`mediaTypes.banner.sizes`](#adUnit-banner). | -| `bids` | Required | Array[Object] | Each bid represents a request to a bidder. For a list of properties, see [Bids](#addAdUnits-Bids) below. | +| `bids` | Optional | Array[Object] | Each bid represents a request to a bidder. For a list of properties, see [Bids](#addAdUnits-Bids) below. | | `mediaTypes` | Optional | Object | Defines one or multiple media types the ad unit supports. For a list of properties, see [Media Types](#addAdUnits-MediaTypes) below. | | `labelAny` | optional | array | An array of string labels, used for showing responsive ads. With the `labelAny` operator, just one label has to match for the condition to be true. Works with the `sizeConfig` object passed in to [pbjs.setConfig]({{site.baseurl}}/dev-docs/publisher-api-reference/setConfig.html). | | `labelAll` | optional | array | An array of string labels, used for showing responsive and conditional ads. With the `labelAll` conditional, every element of the target array must match an element of the label array in order for the condition to be true. Works with the `sizeConfig` object passed in to [pbjs.setConfig]({{site.baseurl}}/dev-docs/publisher-api-reference/setConfig.html). | @@ -32,6 +32,8 @@ See the table below for the list of properties on the ad unit. For example ad u See the table below for the list of properties in the `bids` array of the ad unit. For example ad units, see the [Examples](#addAdUnits-Examples) below. +Note that `bids` is optional only for [Prebid Server stored impressions](/dev-docs/modules/prebidServer.html#stored-imp), and required in all other cases. + {: .table .table-bordered .table-striped } | Name | Scope | Type | Description | diff --git a/dev-docs/publisher-api-reference/setConfig.md b/dev-docs/publisher-api-reference/setConfig.md index bbb195245e..5872de8c96 100644 --- a/dev-docs/publisher-api-reference/setConfig.md +++ b/dev-docs/publisher-api-reference/setConfig.md @@ -436,162 +436,7 @@ a price granularity override. If it doesn't find 'video-outstream' defined, it w #### Server to Server -{: .alert.alert-info :} -Use of this config option requires the `prebidServerBidAdapter` module. - - -Prebid.js can be configured to connect to one or more [Prebid Servers](/prebid-server/overview/prebid-server-overview.html) for one or more bidders. - -Example config: - -{% highlight js %} -pbjs.setConfig({ - s2sConfig: [{ - accountId: '1', - bidders: ['appnexus', 'openx', 'tripleliftVideo'], - defaultVendor: 'appnexus', - timeout: 500, - adapterOptions: { - openx: { key: 'value' }, - appnexus: { key: 'value' } - }, - syncUrlModifier: { - 'openx': function(type, url, bidder) { - const publisherId = '00000123231231' - url += `&ri=${publisherId}`; - return url - } - }, - extPrebid: { - aliases: { - tripleliftVideo: tripleLift - } - } - }] -}) -{% endhighlight %} - -{: .alert.alert-info :} -Note that `s2sConfig` can be specified as an object or an array. - -The `s2sConfig` properties: - -{: .table .table-bordered .table-striped } -| Attribute | Scope | Type | Description | -|------------+---------+---------+---------------------------------------------------------------| -| `accountId` | Required | String | Your Prebid Server account ID. This is obtained from whoever's hosting your Prebid Server. | -| `bidders` | Required | Array of Strings | Which bidders auctions should take place on the server side | -| `allowUnknownBidderCodes` | Optional | Boolean | Allow Prebid Server to bid on behalf of bidders that are not explicitly listed in the adUnit. See important [note](#allowUnknownBidderCodes) below. Defaults to `false`. | -| `defaultVendor` | Optional | String | Automatically includes all following options in the config with vendor's default values. Individual properties can be overridden by including them in the config along with this setting. See the Additional Notes below for more information. | -| `enabled` | Optional | Boolean | Enables this s2sConfig block - defaults to `false` | -| `timeout` | Required | Integer | Number of milliseconds allowed for the server-side auctions. This should be approximately 200ms-300ms less than your Prebid.js timeout to allow for all bids to be returned in a timely manner. See the Additional Notes below for more information. | -| `adapter` | Required | String | Adapter to use to connect to Prebid Server. Defaults to 'prebidServer' | -| `endpoint` | Required | URL or Object | Defines the auction endpoint for the Prebid Server cluster. See table below for object config properties. | -| `syncEndpoint` | Required | URL or Object | Defines the cookie_sync endpoint for the Prebid Server cluster. See table below for object config properties. | -| `userSyncLimit` | Optional | Integer | Max number of userSync URLs that can be executed by Prebid Server cookie_sync per request. If not defined, PBS will execute all userSync URLs included in the request. | -| `syncTimeout` | Optional | Integer | Maximum number of milliseconds allowed for each server-side userSync to load. Default is 1000. | -| `syncUrlModifier` | Optional | Object | Function to modify a bidder's sync url before the actual call to the sync endpoint. Bidder must be enabled for s2sConfig. | -| `coopSync` | Optional | Boolean | Whether or not PBS is allowed to perform "cooperative syncing" for bidders not on this page. Publishers help each other improve match rates by allowing this. Default is true. | -| `defaultTtl` | Optional | Integer | Configures the default TTL in the Prebid Server adapter to use when Prebid Server does not return a bid TTL - 60 if not set | -| `adapterOptions` | Optional | Object | Arguments will be added to resulting OpenRTB payload to Prebid Server in every impression object at request.imp[].ext.BIDDER. See the example above. | -| `extPrebid` | Optional | Object | Arguments will be added to resulting OpenRTB payload to Prebid Server in request.ext.prebid. See the examples below. | - -If `endpoint` and `syncEndpoint` are objects, these are the supported properties: - -{: .table .table-bordered .table-striped } -| Attribute | Scope | Type | Description | -|------------+---------+---------+---------------------------------------------------------------| -| p1Consent | Required | String | Defines the auction endpoint or the cookie_sync endpoint for the Prebid Server cluster for non-consent requests or users who grant consent. | -| noP1Consent | Required | String | Defines the auction endpoint or the cookie_sync endpoint for the Prebid Server cluster for users who do not grant consent. (This is useful for a server configured to not accept any cookies to ensure compliance regulations.) | - -**Notes on s2sConfig properties** - -- Currently supported vendors are: appnexus, openx, and rubicon -- When using `defaultVendor` option, `accountId` and `bidders` properties still need to be defined. -- If the `s2sConfig` timeout is greater than the Prebid.js timeout, the `s2sConfig` timeout will be automatically adjusted to 75% of the Prebid.js timeout in order to fit within the auction process. -- When using the `endpoint` or `syncEndpoint` object configs, you should define both properties. If either property is not defined, Prebid Server requests for that type of user will not be made. If you do not need to distinguish endpoints for consent reasons, you can simply define the same URL value in both fields or use the String version of the field (which is configured to use defined URL for all users). -- When `allowUnknownBidderCodes` is `true`, bidders that have not been explicitly requested in [`adUnit.bids`](../adunit-reference.html#adunitbids) may take part in the auction. This can break custom logic that relies on the availability of a bid request object for any given bid. Known scenarios where custom code won't get the request when there's an "unknown bidder": - - There will not be a [`bidRequested`](getEvents.html) event. - - In the [MASS custom renderers](/dev-docs/modules/mass.html#configuration-parameters) module, `payload.bidRequest` will be undefined. - - In the [Price Floors module](/dev-docs/modules/floors.html), custom schema functions will see the bidRequest object as undefined. - -{: .alert.alert-warning :} -**Errors in bidder parameters will cause Prebid Server to reject the -entire request.** The Prebid Server philosophy is to avoid silent failures -- -we assume you will test changes, and that it will be easier to notice a -4xx error coming from the server than a silent failure where it skips just -the bad parameter. - -**Video via s2sConfig** - -Supporting video through the Server-to-Server route can be done by providing a couple of extra arguments on the `extPrebid` object. e.g. - -{% highlight js %} -pbjs.setConfig({ - s2sConfig: [{ - accountId: '1001', - bidders: ['rubicon', 'pubmatic'], - defaultVendor: 'rubicon', - timeout: 250, - extPrebid: { - cache: { - vastxml: { returnCreative: false } - }, - targeting: { - pricegranularity: {"ranges": [{"max":40.00,"increment":1.00}]} - } - } - }] -}) -{% endhighlight %} - -Additional options for `s2sConfig` may be enabled by including the [Server-to-Server testing module]({{site.baseurl}}/dev-docs/modules/s2sTesting.html). - -s2sConfig example with the endpoint attributes defined as strings: -{% highlight js %} -pbjs.setConfig({ - s2sConfig: [{ - accountId: '1001', - bidders: ['bidderA', 'bidderB'], - endpoint: 'https://mypbs.example.com/path', - syncEndpoint: 'https://mypbs.example.com/path', - timeout: 300 - }] -}) -{% endhighlight %} - -s2sConfig example with the endpoint attributes defined as objects: -{% highlight js %} -pbjs.setConfig({ - s2sConfig: [{ - accountId: '1001', - bidders: ['bidderA', 'bidderB'], - endpoint: { - p1Consent: 'https://mypbs.example.com/path', - noP1Consent: 'https://mypbs2.example.com/path' - }, - syncEndpoint: { - p1Consent: 'https://mypbs.example.com/path', - noP1Consent: 'https://mypbs2.example.com/path' - } - timeout: 300 - }] -}) -{% endhighlight %} - -**Server-Side Aliases** - -You may want to run a particular bidder on the client for banner, but that same bidder on the -server for video. You would do this by setting a **server-side** alias. The -[example](#setConfig-Server-to-Server) at the start of this section provides an example. Here's how it works: - -1. Video ad units are coded with the dynamic alias. e.g. tripleliftVideo -1. The s2sConfig.bidders array contains 'tripleliftVideo' telling Prebid.js to direct bids for that code to the server -1. Finally, the extPrebid.aliases line tells Prebid Server to route the 'tripleliftVideo' biddercode to the 'triplelift' server-side adapter. - -**Passing the Referrer to Server Side Adapters** - -* Setting `extPrebid.origreferrer` will be recognized by some server-side adapters as the referring URL for the current page. +See the [Prebid Server module](/dev-docs/modules/prebidServer.html).