Quick answer
Header bidding is a way for publishers to sell ad slots by asking several demand partners to bid at the same time, before the ad server is called, so the bids compete with the ad server's own demand instead of being tried one by one in a waterfall.
What is header bidding?
Header bidding is a way for a publisher to sell an ad slot in which several demand partners are asked to bid at the same time, before the ad server is called, and the bids then compete with the ad server's own demand. The name comes from where the bidding code is placed: in the <head> of the page, so it runs before the rest of the ad-selling logic.
The alternative is the waterfall, where demand sources are called one after another in a fixed priority order and the first one willing to buy the impression takes it, even if a source further down would have paid more. Header bidding exists to remove that blind spot. This article defines both, works a three-bidder example with numbers you can recompute, and covers the cost that header bidding adds to the page.
How does the waterfall work and where does it lose money?
In a waterfall the publisher ranks demand sources, usually by their historical average price. The ad server asks the first source whether it will fill the impression at or above a price for that tier. If yes, the impression is sold and the rest are never asked. If no, the request "falls" to the next source.
The loss is structural. Prices are set from past averages, not from this impression's real value. A source in tier 1 that bids $1.60 against a $1.50 tier floor wins, even if tier 2 would have paid $1.95 for the same impression. Nobody ever finds out, because tier 2 was never asked. Prebid's documentation describes the traditional model the same way: the process was mostly invisible to the publisher, who could not confirm that they had received the best available price.
How does header bidding work step by step?
The Prebid project's description can be summarised in four steps:
- The page loads and the wrapper starts. A library (Prebid is the common open-source one) runs before the ad server is called.
- Requests go to all selected bidders at once. Not one at a time. Client-side set-ups typically use 5 to 15 demand partners, and the Prebid ecosystem lists more than 300.
- A timeout closes the auction. Any bidder that has not answered by the time limit is left out.
- The ad server makes the final decision. The winning header bid (or bids) are passed to the ad server, where they compete with its own line items, such as direct deals. Alternatively the library can pick the winner itself.
Two consequences are worth stating plainly. The publisher chooses which suppliers may bid. And because bid collection happens before the ad server is called, it adds some latency by design.
What does a three-bidder auction look like?
Sample data: six impressions of the same slot. Three bidders (A, B and C) would pay the CPMs shown. In the waterfall, the tiers are A, then B, then C, with tier floors of $1.50, $1.20 and $0.80, so the first tier whose bid meets its floor takes the impression. In header bidding, all bids arrive together and the highest wins. On impression 5, bidder C answered after the timeout, so it is excluded.
| Impression | Bid A | Bid B | Bid C | Waterfall winner (price) | Header bidding winner (price) |
|---|---|---|---|---|---|
| 1 | $1.60 | $1.95 | $1.40 | A ($1.60) | B ($1.95) |
| 2 | $1.10 | $1.65 | $1.35 | B ($1.65) | B ($1.65) |
| 3 | $1.75 | $1.70 | $1.00 | A ($1.75) | A ($1.75) |
| 4 | $0.90 | $1.05 | $1.25 | C ($1.25) | C ($1.25) |
| 5 | $1.55 | $1.20 | too late | A ($1.55) | A ($1.55) |
| 6 | $1.45 | $0.95 | $0.85 | C ($0.85) | A ($1.45) |
| Sum of CPMs | $8.65 | $9.60 |
The average CPM is $8.65 ÷ 6 = $1.44 in the waterfall and $9.60 ÷ 6 = $1.60 with header bidding, an increase of 11.0%. The two models agree on 4 of the 6 impressions. The whole difference comes from impression 1 (A cleared its tier floor and shut out B) and impression 6 (A's $1.45 missed its $1.50 floor, so the impression fell all the way to C at $0.85). Those are the cases the waterfall cannot see.
The sample is small and the bids were chosen to show the mechanism; it is not a prediction of uplift. Real gains depend on how many bidders you add, how your tier floors were set and how many bids miss the timeout.
How are header bids turned into ad server line items?
The ad server compares header bids with its own demand using a price bucket. Prebid rounds each bid down to a bucket, and the bucket value is passed as the hb_pb key-value that your line items target. Prebid's default granularity is "medium": $0.10 steps, capped at $20.
| Granularity | Step | Cap |
|---|---|---|
| low | $0.50 | $5 |
| medium (default) | $0.10 | $20 |
| high | $0.01 | $20 |
| auto | $0.05 up to $5, $0.10 from $5 to $10, $0.50 from $10 to $20 | $20 |
| dense | $0.01 up to $3, $0.05 from $3 to $8, $0.50 from $8 to $20 | $20 |
In the example, bid B on impression 1 ($1.95) lands in the $1.90 bucket under "medium", and A's $1.75 lands in $1.70. A direct deal line item worth $1.92 would beat the $1.90 bucket even though the bid was $1.95, which is the cost of coarse buckets. Prebid's documentation says rounding affects only the ad server's auction, not what is paid: a $2.75 bid rounded to $2.50 that wins still pays $2.75. If your price distribution is mostly under $3, a finer granularity such as "dense" loses less to rounding, at the price of more line items to maintain.
What is the difference between client-side and server-side header bidding?
| Client-side | Server-side | |
|---|---|---|
| Where auction requests are sent from | The visitor's browser, one request per bidder | A server: the browser sends one request and the server contacts the bidders |
| Typical number of partners (Prebid) | About 5 to 15 | Not stated in the overview |
| Usual reason to choose it | Simplest set-up, bidders see the browser directly | Fewer browser requests, so less page latency |
Prebid can run auctions client-side or through Prebid Server. Many publishers combine the two.
What does header bidding cost the page?
It adds waiting time. A measurement study presented at ACM IMC 2019 (Pachilakis and others) crawled about 35,000 top websites and analysed roughly 800,000 auctions. It found header bidding on 14.28% of those sites, and that its latency could be up to 3 times that of the waterfall in the median case. The data is from 2019, so treat the percentages as a historical snapshot and the 3× as an upper range, not a forecast for your site.
The timeout is the dial. A short timeout protects the page and loses slow bidders; a long one keeps more bids and delays the ad. Sample data: you log how many bids arrive within each timeout and the average winning CPM.
| Timeout | Bids arriving in time | Average winning CPM | Gain over the previous row |
|---|---|---|---|
| 500 ms | 71% | $1.31 | |
| 800 ms | 90% | $1.52 | +$0.21 |
| 1,000 ms | 95% | $1.58 | +$0.06 |
| 1,500 ms | 98% | $1.60 | +$0.02 |
Here, raising the timeout from 800 to 1,000 ms buys $0.06 for 200 extra milliseconds, while going from 1,000 to 1,500 ms buys $0.02 for 500 ms. A reasonable rule is to stop where the next 200 ms buys less than the revenue you would lose from slower pages. Measure your own bidder response times; the figures above are only an illustration, and Prebid's configuration example, which sets a 3,000 ms global timeout, is a syntax sample, not a recommendation.
A second page-side effect is layout. Ads are among the largest contributors to layout shift, and web.dev recommends reserving the slot's space and not collapsing it when no bid wins.
How do you set up header bidding sensibly?
- Start with a small set of partners (for example 3 to 5) and add more only when you can show the extra partner raises the winning price more than it adds latency.
- Choose price granularity from your bid distribution, not by default. If most bids are under $3, use a finer bucket.
- Set the timeout from measured response times and revisit it each quarter.
- Protect direct deals. In the ad server, make sure header bidding line items do not bypass higher-priority direct campaigns.
- Run it as an experiment first. Ad servers let you send a percentage of traffic through header bidding while the rest stays on the current set-up, so you can compare revenue and speed.
- Watch the real-user page metrics after launch, not only the revenue report.
For the neighbouring terms, see real-time bidding, which is the auction mechanism bidders typically use, and ad network for the demand side of a waterfall.
Measuring header bidding's effect on your page with TapCub
TapCub is not an ad-tech tool: it does not run auctions, hold bids or choose demand partners, and it does not report ad revenue. What it can tell you is whether adding or tuning the bidding wrapper made your pages slower or less engaging for real visitors.
- Mark the change. Add a date annotation in Configuration › Annotations the day you add partners or change the timeout.
- Read real-user performance. In Monitoring › Performance, compare Largest Contentful Paint, Cumulative Layout Shift and Interaction to Next Paint at P75 (good thresholds: 2.5 s, 0.1 and 200 ms) for the ranges before and after. The page has no previous-period comparison, so set the two date ranges yourself.
- Find the pages that got slower. Use the breakdown by page, device and country, and the Slowest pages list, which is sorted by P75 Largest Contentful Paint. See check Core Web Vitals.
- Check engagement. In Web analytics › Pages compare bounce and duration on the monetised pages for the same two ranges. If bounce rose as latency rose, the extra bids are costing readers.
Numbers from the page-speed side belong next to your ad-revenue numbers, which come from your ad server.
Sources
- Prebid, Introduction to Header Bidding and Prebid.org overview (bid collection before the ad server, timeout, typical 5 to 15 client-side partners, 300+ demand partners).
- Prebid, Price granularity and setConfig (rounding down to buckets,
hb_pb, granularity presets). - Pachilakis, Papadopoulos, Markatos and Kourtellis, No More Chasing Waterfalls: A Measurement Study of the Header Bidding Ad-Ecosystem, ACM IMC 2019.
- Google Ad Manager Help, Header bidding trafficking with the Prebid wrapper (true bid values, protections, experiments).
Was this explanation clear?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Product Experience Specialist
Explores usability, user journeys, and feature adoption through practical examples of onboarding and everyday product use.