Header Bidding Demand Integration – Prebid.js


This document will guide you on how to integrate your existing Prebid Header Bidding setup with Browsi.


Before showing how to integrate Browsi, let’s take a look at a regular prebid setup:

(click to view a prebid example)


To integrate with Browsi, add the following lines of code to your head HTML  tag (“<head>”) and replace the “<AD_UNIT_NAME>” with the appropriate ad units in your prebid set up –  these being the ad units you wish Browsi to handle.

<script type=”text/javascript”>

window.browsiAdUnitCodes = [“<AD_UNIT_CODE_1>”, “<AD_UNIT_CODE_2>”];

window.pbjs = window.pbjs || {};

window.pbjs.que = window.pbjs.que || [];


window.pbjs.que.push(function () {

var eventListener = (typeof pbjs.onEvent === “function” ? “onEvent” : “addCallback”);

window[“pbjs”][eventListener](“auctionEnd”, function () {

pbjs[“auctionEnded”] = true;




Important Notes

  1. Make sure you define the ad units you wish to use with Browsi with the correct ad unit size. Browsi currently supports 320×50 and 300×250 – make sure to define the appropriate ad unit size in your prebid set up.
  2. If you wish, Browsi can handle Dynamic Allocation with Google DFP for you, as part of our service. In order to handle it correctly, please send the dedicated DFP ad unit tags that you wish to use with Browsi to your account manager for implementation on our back-end.
  3. Please make sure you do not add any special handling of the prebid ad units you will be using with Browsi (those that you have previously defined in the “browsiAdUnitCodes“ object) anywhere in your code.


Integration code examples

To explore different examples of header bidding integration with Browsi, please navigate here, and select the example that best suits your setup. Please note, the examples given are only available when using a mobile emulator.