What Is Header Bidding and How Does It Work? A Guide for Publishers

If you manage inventory through Google Ad Manager, you’ve probably heard “header bidding” mentioned as the thing that replaced the old waterfall — but the reasoning behind it, and what actually changes operationally, often gets skipped over. This guide covers what header bidding is, why it exists, how it works step by step, and what to watch for once it’s running against your inventory.

What Is Header Bidding?

Header bidding is a programmatic technique that lets a publisher offer the same ad impression to multiple demand sources — ad exchanges, SSPs, and DSPs — at the same time, before a single call is made to the primary ad server.

Instead of asking one demand source at a time whether it wants the impression, the way a waterfall does, header bidding runs one simultaneous auction across many buyers and sends the ad server a single, already-competitive bid to weigh against everything else it’s holding.

The name comes from where the original implementation lived: a snippet of JavaScript placed in the page’s header, running and collecting bids before the rest of the page — and the ad server call — continued.

Why Header Bidding Replaced the Waterfall

A traditional waterfall ranks demand sources in a fixed order based on historical average price, and calls them one at a time until someone fills the impression. It sounds reasonable, but it creates a few structural problems:

  • Sequential calls waste inventory: a lower-priority buyer can win an impression a higher-priority buyer would have paid more for, simply because it was never asked.
  • Static priority isn’t real competition: rankings are set from past averages, not what each buyer is actually willing to pay right now.
  • Latency stacks up: each additional step in the chain adds load time, so publishers historically had to limit how many demand sources they could realistically call.

Header bidding fixes this by letting every connected demand source bid at once, so the ad server receives real, current competition instead of a pre-ranked guess.

Client-Side vs. Server-Side Header Bidding

There are two ways to run the simultaneous auction, and the choice affects both page performance and how much you can scale:

  • Client-side header bidding: the auction runs in the visitor’s browser, most commonly through Prebid.js. It’s the original approach, transparent and easy to debug, but every added demand partner adds browser load and can slow the page down.
  • Server-side header bidding (S2S): the auction runs on a remote server instead of the browser, and only the winning bid is sent back to the page. This keeps page load fast even with dozens of demand partners, at the cost of slightly less precise browser-level signals reaching each bidder.

Most publishers running header bidding at scale end up using a mix of both, keeping a handful of top-performing partners client-side and routing the rest server-side to protect page speed.

How Header Bidding Works, Step by Step

  • The page starts loading, and the header bidding wrapper (commonly Prebid.js) fires before the ad server is called.
  • The wrapper sends simultaneous bid requests to every configured demand partner for that ad unit.
  • Each partner has a set timeout — typically 1 to 2 seconds — to return a bid or be dropped from that auction.
  • The wrapper collects every bid that came back in time and passes the highest one to the ad server as line-item targeting (key-values).
  • The ad server, e.g. Google Ad Manager, runs its own unified auction between that header bidding bid and its other demand: direct deals, programmatic guaranteed, and open exchange.
  • The single highest bid across all of it wins, and the ad renders.

Prebid.js: The Industry-Standard Wrapper

Prebid.js is the open-source header bidding wrapper most publishers build on. It handles sending bid requests to dozens of supported demand partners, enforcing the auction timeout, normalizing bid formats across very different partner APIs, and passing the winning bid’s targeting back to the ad server.

Because it’s open-source and vendor-neutral, Prebid.js doesn’t favor any single exchange, which is part of why it became the default rather than a proprietary alternative.

A Prebid Auction Timeline, From Page Load to Ad Server

The diagram below shows the sequence for a typical client-side Prebid setup. The important detail is that the ad server request waits for the header bidding auction, not the other way around.

1. Page loadsPrebid + GPT start 2. requestBids()timeout clock starts Bidder A Bidder B Bidder C (slow) 3. Bids backor timeout hits 4. Set keyshb_pb, hb_bidder 5. Google Ad Manager decidesheader bid line item vs. direct, AdX Bidders are called in parallel. If a bidder misses the timeout, its bid is dropped.
Client-side Prebid flow: parallel bid requests, a timeout, then one call to the ad server.

In code, the same flow is a short callback pattern. This is the simplified structure from the Prebid.org documentation for Google Publisher Tag (GPT) pages: Prebid runs the auction first, writes the winning bids into GPT as key-values, and only then is the ad server asked to refresh the slots.

pbjs.que.push(function () {
  pbjs.addAdUnits(adUnits);
  pbjs.requestBids({ bidsBackHandler: sendAdserverRequest, timeout: 1000 });
});

function sendAdserverRequest() {
  if (pbjs.adserverRequestSent) return;
  pbjs.adserverRequestSent = true;
  googletag.cmd.push(function () {
    pbjs.que.push(function () {
      pbjs.setTargetingForGPTAsync();
      googletag.pubads().refresh();
    });
  });
}

The timeout value is the main trade-off you control. A longer timeout lets slower bidders participate and can raise competition, but it delays the ad server call and the first ad on the page. Many publishers start around 1,000 ms and then tune it from their own bidder response-time data.

Header bidding flowVisitor loadsthe pagePrebid wrapperruns in the pageBidder / SSP ABidder / SSP BBidder / SSP Cbid requests go out in parallel;bids must return before the timeoutBest bids go to Google Ad Manageras key-values on the ad requestAd Manager compares them with direct, AdXand other demand; the highest value wins
Header bidding in one picture: the auction runs in the page first, and Ad Manager makes the final decision.

What Google Ad Manager Receives

Prebid passes the result to Ad Manager as key-values, mainly hb_pb (the price bucket), hb_bidder and hb_adid. Ad Manager then compares the header bid line item at that price against everything else eligible for the impression. With a price granularity of 10-cent steps, a $1.37 bid is sent as hb_pb=1.30, so the line item that matches is the $1.30 one. That rounding is why granularity settings directly affect revenue: coarser buckets leave more money on the table.

To estimate what a change in header bidding performance means in dollars, use the Header Bidding Revenue Calculator. For how header bidding compares with the older waterfall approach and with Google’s unified auction, see Waterfall vs. Unified Auction. If a new demand partner returns no bids at all, check your ads.txt setup first.

Setting Up Server-Side Header Bidding with Prebid Server

Prebid Server is the open-source server-to-server counterpart of Prebid.js. You can use a hosted service from a Prebid.org member or run it yourself; the Prebid documentation notes that self-hosting is considerably harder than installing Prebid.js.

On the page side, you tell Prebid.js which bidders to route to the server with s2sConfig:

pbjs.setConfig({
  s2sConfig: {
    accountId: '12345',
    enabled: true,
    bidders: ['pubmatic', 'rubicon'],
    endpoint: 'https://prebid-server.example.com/openrtb2/auction',
    syncEndpoint: 'https://prebid-server.example.com/cookie_sync',
    timeout: 700
  }
});

The values above are placeholders. Three details are worth checking before launch:

  • Timeout: keep the server timeout roughly 200–300 ms below your Prebid.js auction timeout, so the response has time to travel back to the browser.
  • User syncing: server-side bidders rely on cookie syncs run through the sync endpoint. Where cookies are blocked or consent is denied, expect weaker matching and compare bid rates by browser.
  • One route per bidder: if you use more than one server configuration, the same bidder cannot appear in two of them.

Which Partners Go Client-Side and Which Go Server-Side?

Signal from your own reportsReasonable starting choice
Wins often and relies on browser-side identity signalsKeep client-side
Wins rarely but adds noticeable latencyTest server-side, or remove
New partner you are still evaluatingAdd one at a time, so its effect can be measured
Revenue falls after a move to server-sideCompare bid rate and CPM before and after; move it back if the gap persists

Header Bidding Inside Google Ad Manager

Google Ad Manager supports header bidding through two mechanisms that are worth telling apart:

  • Open Bidding (formerly Exchange Bidding): a server-side header bidding auction that runs inside Google’s own infrastructure, so participating exchanges compete without you having to manage a separate server-side setup yourself.
  • Unified Pricing Rules (UPR): floor prices applied consistently across every demand type — direct, programmatic guaranteed, open exchange, and header bidding — instead of separate, conflicting price rules per source. This is what keeps header bidding demand from being undercut by a lower floor set somewhere else in the account.

Getting Unified Pricing Rules configured correctly is one of the most common setup mistakes: a floor set too high on one line item can quietly exclude header bidding demand from ever competing at all.

Video Header Bidding (Instream)

Video differs from display in one important way: the player needs a VAST response, not a banner creative. In Prebid.js the ad unit declares mediaTypes.video with a context of instream or outstream. For instream with Google Ad Manager, the build must include the gamAdServerVideo module, which creates the ad tag URL your player requests:

pbjs.requestBids({
  bidsBackHandler: function () {
    var videoUrl = pbjs.adServers.gam.buildVideoUrl({
      adUnit: videoAdUnit,
      params: { iu: '/1234567/your_video_ad_unit' }
    });
    // pass videoUrl to your video player as the ad tag
  }
});
  • Caching: the winning creative has to be reachable as VAST. Check whether your bidders return a cache key or VAST URL; if they return only VAST XML, you need Prebid Cache configured, otherwise the bid cannot be used.
  • Several video slots on one page: mark winning bids as used (pbjs.markWinningBidAsUsed) so the same bid is not applied twice.
  • Outstream: there is no publisher video player, so a renderer (from the bidder or from you) must place the video.

If your video ads are inserted into a stream rather than requested by a web player, the architecture is different; see SSAI vs. CSAI for OTT and CTV.

Key Metrics That Matter for Header Bidding

  • Bid response rate per partner: what share of auctions each demand partner actually responds to — a partner that rarely bids is adding latency without adding revenue.
  • Win rate: how often a given partner’s bid actually wins the ad server’s unified auction.
  • Timeout-related bid loss: bids that arrive just after the timeout and get dropped — a strong signal that the timeout window may be too tight for that partner.
  • Latency added per partner: the load-time cost of each demand source, measured against the revenue it brings in.
  • Yield uplift vs. the previous waterfall benchmark: the actual CPM and fill improvement header bidding delivers once it’s live, not just in theory.

Troubleshooting: Where to Look First

SymptomCheck first
A new partner returns no bidsads.txt line and seller ID, bidder parameters, the bid request in the browser network tab
Bids arrive but header bidding line items do not servehb_pb and hb_bidder key-values on the ad request, line item targeting and priority, creative sizes
Many bids are lost to timeoutResponse time per bidder, auction timeout, number of client-side partners
Bid rate drops for EEA visitorsCMP behaviour and whether the consent string reaches bidders
Video bids win but nothing playsVAST URL returned to the player, caching setup, player error codes

For debugging in the browser, add ?pbjs_debug=true to the page URL and read the Prebid messages in the console.

Common Challenges When Running Header Bidding

  • Partner count vs. page speed: every additional demand source is a tradeoff between more competition and slower page load — this needs to be tested, not assumed.
  • Timeout tuning: too short a timeout drops legitimate bids; too long a timeout hurts user experience and viewability.
  • Pricing rule conflicts: floors that don’t match across direct, programmatic, and header bidding demand can quietly suppress the auction you’re trying to grow.
  • Ad quality and fraud monitoring: more simultaneous demand sources means more surfaces to monitor for malicious creatives or ad quality issues.
  • Consent management: running several demand partners at once through a CMP under GDPR/TCF adds real complexity to keeping every bidder compliant.

Key Takeaway

Header bidding isn’t a plugin you turn on — it’s a shift from asking demand sources for a bid one at a time to letting them all compete at once, with the ad server settling the final auction. The bulk of the value comes from getting the operational details right: timeout tuning, unified pricing rules, and an honest look at which partners are actually worth the latency they add.

References and further reading

Related Reading

Want to see how professional teams structure header bidding, Prebid, and Open Bidding to squeeze out maximum yield? The Ultimate AdOps Blueprint covers exactly that. Get it here.

Try it with your own numbers: the free header bidding revenue calculator estimates the eCPM uplift from each extra bidder, net of latency and tech costs.

JOIN THE NEWSLETTER
Be the first to know about new posts on ad ops, ad tech and publisher monetization.