Prebid Server

Toma
Toma
  • Updated

To use a Prebid Server integration, your Adform account must be able to use server-to-server transfers. With server-to-server transfers you can include more partners/bidders into the auction without any latency on the visitor's side. To activate this feature for your inventory, contact Publishers Support (publishers@adform.com).

Once the server-to-server feature is activated, you need to set up the prebid server:

  1. Choose Prebid Server Host. You have three options:

    - Xandr (formerly AppNexus) host (https://prebid.adnxs.com/)

    - Magnite (formerly Rubicon project) host (prebidserver@rubiconproject.com)

    - Hosting prebid in your own system (Download the Prebid Server code and deploy it to your server.)

  2. Download Prebid.js with Prebid Server selected and with all the other demand adapters you want to work with selected.

  3. Update your site with the new build of Prebid.js. If you're using a header bidding container, update the script source inside the container, too.

  4. Configure server-to-server bidder adapters. By configuring server-to-server adapters, you can specify which bidders should be called from the server-side and which from the client-side.

    An example of a hybrid setup: If you have Adform, Xandr, Magnite, and PubMatic as bidders, and you specify Adform and Xandr as bidders in s2sConfig, the Prebid Server calls only Adform and Xandr. Magnite and PubMatic are called traditionally through Prebid.js directly from the website.

    The Prebid Server settings, defined by the pbjs.setConfig method, go to the same anonymous function where you define your ad units. Call this method before pbjs.requestBids.

    If you use one of the existing Prebid.org members as your server host, you can use the defaultVendor property. This property represents the vendor's default settings for the s2sConfig. When used, these settings are automatically populated to the s2sConfig, so you don't need to individually list out all data points. Currently, appnexus and rubicon values are supported.

This example represents the minimum configuration required when using the defaultVendor option:

var pbjs = pbjs || {};

pbjs.que.push(function() {
      pbjs.setConfig({
            s2sConfig: {
                   accountId: '1',
                   bidders: ['adform', 'appnexus'],
                   defaultVendor: 'appnexus'
                }
         });
        var adUnits = [{
              code: 'div-ppas-mid-xxxxxx',
              sizes: [[300, 250]],
              bids: [{
                    /* Etc. */
             }]
     }];
});

By including the property with the desired value in the configuration, you can override these defaults.

Example of a full s2sConfig ( ):

var pbjs = pbjs || {};

pbjs.que.push(function() {
    pbjs.setConfig({
       s2sConfig: {
          accountId: '1',
          enabled: true,
          bidders: ['adform', 'appnexus'],
          timeout: 1000,
          adapter: 'prebidServer',
          endpoint: 'https://prebid.adnxs.com/pbs/v1/auction',
          syncEndpoint: 'https://prebid.adnxs.com/pbs/v1/cookie_sync',
          cookieSet: true,
          cookiesetUrl: 'https://acdn.adnxs.com/cookieset/cs.js'
       }
  });

  var adUnits = [{
      code: 'div-ppas-mid-xxxxxx',
      sizes: [[300, 250]],
      bids: [{
         /* Etc. */
      }]
  }];
});

This table shows the Header Bidding Server configuration parameters.

Attribute

Scope

Type

Description

accountId

Required

String

Your Prebid Server account ID

bidders

Required

Array of Strings

Which bidders support auctions on the server side

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.

enabled

Optional

Boolean

Enables server-to-server (Defaults to false.)

timeout

Required

Integer

Number of milliseconds allowed for the server-side auctions

adapter

Required

String

Adapter code for server-to-server (Defaults to ‘prebidServer’.)

endpoint

Required

URL

Defines the auction endpoint for the Prebid Server cluster

syncEndpoint

Required

URL

Defines the cookie_sync endpoint for the Prebid Server Cluster

cookieSet

Optional

Boolean

Initiates link-rewriting for Safari to improve cookie match rate.

cookieSetUrl

Optional

URL

Cluster-specific script for Safari link-rewriting

Was this article helpful?

/
How we can make it better?

Thank you for your feedback!