Header bidding is the publisher asking buyers what they will pay before the ad server picks a winner, instead of offering the impression to one buyer at a time.
In a waterfall, the ad server (or the page) calls one demand source, waits, and only then tries the next, usually in an order frozen from older prices. Header bidding calls those sources together. Their bids are on the table when the ad server runs its own auction.
The ad server still decides. Prebid's job is to run the parallel auction and hand the result over as key-values, most often the hb_ keys Google Ad Manager line items target. A bid that loses inside Prebid can still lose again inside the ad server, to a direct campaign or to another exchange.
The short definition, without the setup, is in the glossary. The waterfall is the pattern header bidding replaced for a lot of remnant inventory.
Prebid.js is the library that runs this auction in the page. The page registers ad units, asks every adapter for a bid, writes targeting, and only then releases the ad server. Bidder names and parameters come from each adapter's own docs. The snippet is the shape of Prebid's basic example, not a bidtune config.
googletag.cmd.push(function () {
googletag.pubads().disableInitialLoad();
});
pbjs.que.push(function () {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({ bidsBackHandler: sendAdServerRequest });
});
function sendAdServerRequest() {
pbjs.setTargetingForGPTAsync();
googletag.cmd.push(function () {
googletag.pubads().refresh();
});
}Buyers who would have sat behind a waterfall can bid on the same impression. You keep the ad server, the orders, and the partners you already use. One auction is easier to reason about than a chain of passbacks.
The page waits. A long auction delays the ad; a short one drops bids still in flight. Every extra bidder adds requests and, if you send every bid, more key-values to the ad server. A second wrapper beside one that already runs Prebid just auctions twice.