Prebid.js

Prebid.js is a feature-rich header bidding platform for the web, including more than 150 demand sources and 15 analytics adapters. It supports currency conversion, GDPR, common ID systems, and multiple ad servers.


Use prebid.js with Appconsent CMP

  1. Add the AppConsent CMP code to your website

  2. Place your prebid.js file in your web directory

  3. In your website, add the following configuration script for prebid.js, with the consentManagement configuration (Take care of loading this script before loading the cmp snippet):

<script>
  var PREBID_TIMEOUT = 300;
  var pbjs = pbjs || {};
  pbjs.que = pbjs.que || [];
  pbjs.que.push(function()
                {
    pbjs.setConfig({consentManagement:
                     { cmpApi: 'iab', //needs to be iab 
                       timeout: 8000, //timeout for prebid to wait for consent in ms 
                       allowAuctionWithoutConsent: false //send requests without consent? 
                     }
                    });
    var units = [];
    units[units.length] = { 
      code: "content", 
      sizes: [[300, 250]], 
      bids: [ 
        {bidder: "criteo", params: {zoneId: "..."}}, 
        {bidder: "fidelity", params: {zoneid: "...", floor: 0.05, server: "..."}}, 
        {bidder: "stroeerCore", params: {sid: "..."}} 
        //more bidders here 
      ]};
    pbjs.addAdUnits(units);
    pbjs.timeout = 300;
    pbjs.requestBids({ bidsBackHandler: function(bidResponses){ }, timeout: 300 });
  });
</script>
circle-exclamation
circle-info

INFO

If you are using Tag commander or GTM, please refer to your Prebid representatives to ask them the best way to implement the script.

Last updated