Note: We provide header bidding optimization services, if you use header bidding and are looking to optimize your stack, please write to us at

Despite the many leaps in ad technology in recent years such such as programmatic buying and real-time bidding, fact remains that digital advertising is still imperfect at best and inefficient and fragmented at worst.

In the race to squeeze the last revenue dollar from their ad inventories, publishers are known to always be experimenting with new hacks, with varying levels of success.

One such hack which has been around for some but is only recently gaining popularity is header bidding, also known as advanced bidding or pre-bidding.

Should you implement header bidding too? If yes, how? Read on to find out.

What is Header Bidding?

Header bidding is an advanced programmatic technique which allows publishers to open their inventories to receive bids from multiple ad exchanges before making a call to their ad server (mostly DoubleClick for Publishers).

The idea is simple: The more bids you receive, the higher the potential yield for your ads… what you’re essentially doing is increasing competition for your inventory.

Header bidding also helps bypass the traditional waterfall approach to selling ad inventory which typically leads to loss in potential revenue:

The traditional publisher waterfall, where impressions are exposed to sales channels in descending order of the perceived value of each channel, has always stuck in the craw of yield-obsessed media sellers.

At its worst, the model ignores pockets of high-value inventory and reduces competition, and thus artificially caps a publisher’s revenue.

Publishers have by and large been locked into this arrangement since programmatic selling became a thing, but that is changing. Sarah Sluis, AdExchanger

Prebid.js conducted tests about how the number of bidders correlate with ad revenue, page load time, and ad load time. It’s an insightful post that you can read in full here.

Here are a few key findings:

Image courtesy: Prebid.js blog
Image courtesy: Prebid.js blog

1. You make more money when you include more bidders! Perhaps not surprising – more competition, better yield.

2. When you include more bidders, the page should wait longer too! Working with 10 bids (orange) makes incrementally more money as the ad server waits longer. But the 5 bids revenue plateaued. As the graph’s 0 – 300ms (X-axis) shows, either working with 5 bids or 10 bids makes no difference; In fact, working with 10 bids has a slight dip at 200ms, possibly due to the latency caused by sending out more bid requests.

3. Revenue actually drops if the page waits for too long. This could be caused by users leaving the page, when the ads took too long to load.

A (Very) Brief History of Header Bidding

Header bidding has been around since early 2009 when AppNexus started implementing it for some of its big publishers. Brian O’Kelley, the inventor of ad exchange and the CEO of AppNexus responds on a Quora post:

Header bidding has been gaining popularity in the past couple of years in response to a DFP feature called Dynamic Allocation, which allows Google Ad Exchange – but no other exchanges – to bid against publishers’ direct-sold campaigns. All other exchanges must operate at the end of the waterfall after direct campaigns and Google AdX cherry-pick impressions… of course at Google’s discretion.

In essence, this is a hack around a feature gap in DFP. A neutral ad server would open up Dynamic Allocation to any bidder, and would always choose the ad that is best for the publisher – or at least give publisher transparency and control over how it’s making these decisions. Since that’s not how Google has decided to operate DFP, publishers must either switch to an independent publisher ad server that can do universal dynamic allocation or use pre-bid to hack around this (intentional?) weakness of DFP.

How Does Header Bidding Work?

To enable header bidding, publishers insert a Javascript code into their header that allows demand sources to bid for the ad space before the ad server callout.

This process happens simultaneously as opposed to the traditional method where bids are placed sequentially, leading to comparatively high CPM rates.

Ad Ops Insider breaks down the technical steps involved in the process:

Image courtesy: Ad Ops Insider
Image courtesy: Ad Ops Insider
  1. User requests a website
  2. Header tag script redirects user to one or many SSPs (or DSPs, or Exchanges)
  3. User calls one or many SSPs in parallel
  4. SSPs conduct auction with DSPs and internal network demand*
  5. DSPs respond with bids*
  6. SSP determines winning bid value and returns to User
  7. User passes bid value into ad request and calls Publisher Ad Server
  8. Ad server determines final line item to serve and redirects User to Marketer Ad Server (let’s assume the ad server determines a pre-bid SSP line item for this example)
  9. User calls Marketer Ad Server
  10. Marketer Ad Server returns final creative (via CDN)
  11. User calls trackback to SSP

One potential downside to the implementation of header bidding is that increases page load times, although only marginally so, and to ultimately decide whether the trade off is worth it, individual testing is recommended.

How You Can Implement Header Bidding

Custom implementation of header bidding for your website requires considerable technical know-how and probably a dedicated ad ops team working for you.

This is because all the things that need to come together, both in terms of technology implementation and building relationships with ad partners.

This may suit you if you’re a large publisher and realize that the RoI exceeds the time and energy you put in.

Small publishers, however, don’t have this option.

Thankfully, there are open source solutions that are relatively easier to implement. One of the leading options is Prebid.js — a Javascript framework to help publishers integrate and manage header bidding partners without writing custom code.

Prebid.js is free for anyone to use. But don’t underestimate Prebid.js just because it’s free, here are a few of its features:

  • It has clean, built-in support for all major bidders (AppNexus, Rubicon, etc), as well as major ad servers (DFP, OAS, AdTech).
  • Prebid.js has solved many known problems publishers are facing – high latency, unfair auction mechanics, long development time, confusing line item and targeting setup.
  • Plugging in prebid.js is easy. Adding new header bidding bidders is a matter of adding tag Ids into a JSON config.

A Few Additional Considerations

While header bidding is another step towards further eliminating inefficiencies in how ads are served, it has some potential downsides too that you must be aware of before jumping the bandwagon. Let’s quickly round up the pros and cons:


  • Eliminate passbacks since you know in advance that the SSP wants the impression
  • No need to manage the order in which partners gain access to ad inventory
  • Improved yield management
  • Increase in overall revenue


  • Implementation can be somewhat complex
  • Increased page load time
  • Long term impact on revenue is not well documented

All things considered though, if you’re the kind of publisher who doesn’t mind testing and tweaking your ad setup in the search for a more optimized inventory… header bidding does present a compelling case.

Tell us if you’ve implemented it yet or if you’re planning to in comments!