Browse the help center

Header bidding with Google Ad Manager

Sell a page served by Google Ad Manager through header bidding — step by step from the tag to the line item in Ad Manager, with the scenarios it fits, the caveats (Adopt mode, consent, zero-priced bids), a fix-it checklist and the key-value and line-item reference.

How-to network manager admin Account → Header Bidding

What it is and why

Use this route when the publisher’s ads are served by Google Ad Manager today and you want your campaigns priced before Google is asked. The tag brings its own copy of Prebid — under its own variable, easPbjs, so nothing already on the page collides with it — asks your ad server for a price, and hands the result to Ad Manager as key-values on the ad request, where a line item you create decides whether that price beats Google’s own demand. You do not need to know Prebid to set it up, and Google never sees your creative: when the line item wins, its creative is a small script that draws the ad the browser already holds.

Example. A news page has a 728×90 leaderboard and a 300×250 rectangle, both served by Ad Manager. You sold the leaderboard to an advertiser at $2.00 CPM net. On every page view the tag bids the net price on both slots; the leaderboard bid carries the deal key hb_deal_epom_as = epom-direct, so the Sponsorship line item you created wins and the tag draws your creative. On the rectangle no campaign was sold, the deal key is absent, the line item is not eligible, and Ad Manager serves its own direct campaigns and AdX exactly as it did before the tag.

Typical scenarios

You wantSetWhere
A page that runs Ad Manager but no Prebid yet; the publisher will replace their googletag calls with one container per positionWhat the tag brings = Prebid and the ad slots; a GAM ad unit on every slot Google should also servethe tag’s Tag settings and Slots faces
A page that must keep its own Google Publisher Tag and googletag.defineSlot callsWhat the tag brings = Prebid only — reuse the publisher’s Google Ad Manager slots; each slot named by Their slot id or ad unit path (div-gpt-ad-top or /12345678/Homepage_Top)the tag; see Adopting a page’s existing Google slots
A sold campaign to always win its slot, whatever Google holdsA Sponsorship line item at goal 100 % targeting hb_deal_epom_as is epom-direct, inventory-targeted to the tag’s ad units onlythe publisher’s Ad Manager
Epom to fight Google on price insteadOne Price Priority line item per Prebid price bucket, targeting hb_pb is that bucketthe publisher’s Ad Manager
An advertiser who bought the inventory outright, drawn without an Ad Manager round tripServe our demand first, let Google take the rest onthe tag’s Google settings (owned slots only)
EEA visitors who declined TCF purpose 1 kept away from Ad Manager, your demand still servedCall Google Ad Manager without consent offthe tag’s Google settings (owned slots only)
A House ads backfill campaign to render when Google returns emptyA nominal CPM above 0 on the campaign, or Let our bids priced at zero still win onthe campaign, or the tag

Step by step

Before you start, get from the publisher the ad unit path of every position you will sell — it looks like /12345678/Site_Desktop_160x600 and is in their existing googletag.defineSlot call — and, if you are adopting, the id of the div each slot renders into (div-gpt-ad-…) or that ad unit path; either identifies the slot. You also need someone on the publisher’s side who can edit their Ad Manager: the key-values, order, line item and creative are created there, not in Epom.

  1. Build the tag as under Steps on the main page: Account → Header Bidding → Add, the Site, the Serving domain, and What the tag brings set to Prebid and the ad slots or, for a page that keeps its own Google tag, Prebid only — reuse the publisher’s Google Ad Manager slots (Create a tag).

  2. On Slots, add one slot per ad position and fill GAM ad unit on each slot Google should also serve (Slots). In Adopt, name each slot by Their slot id or ad unit path instead. Save.

    Slot form with the GAM ad unit path filled

3. Open Code → Our Prebid.js and hand the publisher what the face prints under What goes on the page: one script in the head, above the Google tag, and one attribute per ad position:

<script src="https://{serving-domain}/eas/t/{tag-public-id}.js"></script>

<div data-eas-ad="leaderboard"></div>

{serving-domain} is the serving domain’s CDN host when it has one, as the Serving domain picker shows (domain → cdn). The container blocks appear on the face as soon as a slot has a name, saved or not; the script exists only once the tag has been saved, because its address carries the tag’s public id. The publisher must not add async to the script: it is written to run before Google’s tag, and an asynchronous copy can lose that ordering.

The Code face for our Prebid.js on the page: the script and the container markup

  1. Scroll to What goes in Google Ad Manager on the same face. It prints the key list and the two line-item recipes for the tag you are on. In the publisher’s Ad Manager, under Inventory → Key-values, register the keys as free-form (dynamic) keys, values to be added later: hb_pb, hb_adid, hb_size, hb_bidder, hb_deal_epom_as. Ad Manager refuses to target a key it does not know.

    Google Ad Manager section with the key-values and the line item recipes

  2. Create an advertiser (company) and an order in their Ad Manager to hold the line item, named so the publisher can tell it apart from their own campaigns.

  3. Create the line item — a Sponsorship at goal 100 % targeting hb_deal_epom_as is epom-direct to serve whenever a campaign was sold, or one Price Priority line item per price bucket to compete on price. Scope its inventory targeting to the ad units in the tag. The two recipes and what each one does are under The Google Ad Manager line item.

  4. Add the creative: one third-party creative per trafficked size carrying the Prebid universal creative that the Code face prints, attached to the line item, with Serve into a SafeFrame ticked.

  5. If the page keeps its own Google tag, go through the rules under Adopting a page’s existing Google slots with the publisher before go-live.

  6. Watch who fills each slot in the Header Bidding report: the split between your sold campaigns, Google and House ads is shown per slot.

A tag edit reaches the CDN through an automatic purge; a page that already holds the script picks the change up within about five minutes.

Caveats and exceptions

Who does what. The network manager builds the tag and copies what the Code face prints; the Ad Manager work is done in the publisher’s own account by someone with access to it. The publisher pastes the script and the containers (what a publisher installs). A Can View share sees the site’s tags but cannot save or delete them — see the per-role notes on the main page. The tag needs the access listed under Permissions.

Two values of What the tag brings apply here. Prebid and the ad slots when the page has no Google tag yet, or the publisher is happy to replace their googletag calls with one container per position; Prebid only — reuse the publisher’s Google Ad Manager slots when the page already runs Google Publisher Tag and must keep it. The second has rules of its own, below.

Serve our demand first, let Google take the rest is off by default, and leave it off unless the advertiser bought the inventory outright. With it off, every winner is handed to Google and competes there through the line item, and Google counts and measures the impression like any other. With it on, a sold campaign’s winning bid is drawn by the tag without asking Google for that slot at all; House ads and partner bids still go through Google. Owned slots only — hidden in Adopt, because bypassing Ad Manager on a slot the publisher created would paint over an impression Ad Manager has already counted. Turning it on also hides the key list and the two line-item recipes on the Code face — the face shows them only while the setting is off (or in Adopt) — so copy them first if you still need them for the slots that go through Google.

Let our bids priced at zero still win does not let house demand overtake Google. Serve our demand first renders a winner without asking Google only when the bid carries the deal id, and House ads bids never do — so a zero-priced house bid still waits its turn behind Google, exactly as a priced one does. Partner-priced bids do not carry it either.

Tell Google the page language is off by default. It passes the page’s <html lang> to Ad Manager as the document_language key-value so line items can target it, and does nothing when the page carries no lang. Google infers the language itself, and a wrong lang attribute narrows your targeting rather than widening it. The key is page-wide, which is why Adopt never sets it on the publisher’s own GPT.

Call Google Ad Manager without consent is on by default. Turn it off when Google asks that only consented visitors reach Ad Manager: where GDPR applies and the visitor has not consented to TCF purpose 1 (storing or accessing information on the device), the tag never calls Ad Manager for them. The auction still runs and its winner — sold campaign, house or partner — is drawn by the tag itself, served without cookies; with no bid the slot stays empty or collapses. Google stops counting those requests against the publisher’s match rate, and those impressions stay with your demand. Consent that never resolved where GDPR applies counts as declined; a page with no consent manager is called as before. Owned slots only — in Adopt the Google tag is the publisher’s.

The auction can finish before Google’s tag has loaded. On a page that shows no consent banner the auction starts straight away and often ends before gpt.js is ready. A slot with an ad unit path then waits for Google’s tag and goes to Ad Manager as soon as it has loaded. Only a slot bound for Ad Manager waits: your own sold creative under Serve our demand first, and every slot of a visitor who declined consent while Call Google Ad Manager without consent is off, are served at once, also when other slots of the same round wait. If gpt.js fails to load — an ad blocker dropped it, say — or has still not loaded 3 seconds after the auction ended, the slot is served without Google: your winning bid is rendered directly, and with no bid the slot is treated as an empty round (its fallback code, or collapsed). A blocked gpt.js adds no delay; the 3 seconds are only the limit for a slow one.

Keep the container, and keep it visible, while Google’s ad loads. Once Ad Manager answers a slot with an ad, the tag leaves that creative alone, whatever size it reports. The page has to do the same. A single-page app that rebuilds its ad containers on every route change discards the rounds still on their way: the tag drops a removed container’s Google slot and never asks Ad Manager to fill it, but an ad already chosen for it is a win Ad Manager counts and never sees rendered. The same happens when a page hides an empty container with display: none and a later round fills it while it is hidden. Google reports such slots as having a low render rate, and buyers stop bidding on them. Reuse the same container element across route changes, and reserve or collapse its space without display: none.

Your own ad tag as a line item’s creative. A publisher may traffic one of your placements’ ad tags in an Ad Manager line item. Use Universal JS or Mount JS for it: once its ad has loaded, the tag tells the header-bidding tag on the page that the render is yours — from a SafeFrame or a same-origin frame alike — so the Header Bidding report shows it under Direct campaigns and the ad-server fee counts its impression once. A Simple Iframe or Direct URL tag cannot say so: that render is recorded as an Ad Manager fill and billed as one, on top of the impression the tag serves. A tag that has none of your ads to serve — it comes back empty, or with the placement’s Default code — says nothing either, and the render stays an Ad Manager fill, since no impression is counted for it.

Adopting a page’s existing Google slots

Adopt is the mode for a page that already runs Google Publisher Tag. Instead of creating slots of its own, the tag takes over the ones the publisher’s Google tag has already defined — a second slot for the same ad unit would make Ad Manager count two ad requests per pageview and treat them as two units for competitive exclusion and frequency capping.

Three things follow from that, and all three surprise people:

  • The page must already load gpt.js itself. Adopt deliberately does not load it. On a page with no Google tag there is nothing to adopt, and the tag says so in the browser console rather than sitting silent.
  • A slot’s name is their element id or their ad unit path. Either matches — div-gpt-ad-top and /12345678/Homepage_Top are both valid entries for the same slot, in the field the editor labels Their slot id or ad unit path. Use whichever the publisher can give you reliably.
  • Slots you do not list are left to Google, untouched. The tag holds the page’s first ad request back so bids can join it, which holds back the publisher’s other slots too — so it releases those straight away, once each. It only does this when the hold actually applied; if the tag loaded after the Google tag had already started, nothing was held and nothing is released.

The tag must load before the Google tag on Adopt pages. Loaded after, Google’s services are already enabled: the first ad request cannot be held back any more, so the page’s first impression goes without your bids and header bidding only joins from the first refresh. The browser console says so in as many words.

The tag keeps watching for about ten seconds after it loads, because a publisher’s Google setup is usually asynchronous and the slots may not exist yet when the tag runs. If a slot in the tag never matches anything on the page by then, the console names it. Slots Google collapsed come back into auction, and a container the page hides while empty is probed for three rounds rather than forever.

Adopt writes Prebid’s key-values, and the refresh key, onto the publisher’s own slot objects. Slot-level targeting persists until it is cleared, so check with the publisher that neither collides with a key their own setup already uses. A bid priced at exactly zero hides the whole mode until Let our bids priced at zero still win is on — the symptom is a tag that adopts every slot and never renders.

Not working?

SymptomCheckWhere
The first impression on an Adopt page never carries your bid; only refreshes doThe tag loads after Google’s tag, so the first ad request could not be held backThe page’s <head>; the browser console says so in as many words
The tag adopts every slot and never rendersBids priced at exactly zero are discarded before they render; the mode stays hiddenLet our bids priced at zero still win on the tag, or give the campaign a CPM above 0
The line item never serves although the report shows bidsThe keys are not registered in Ad Manager (it refuses to target a key it does not know), or the line item’s inventory targeting does not cover these ad unitsInventory → Key-values and the line item’s targeting in the publisher’s Ad Manager
Ad Manager picks the line item but the slot stays blankThe universal creative addresses pbjs; the tag’s Prebid is easPbjs. Tick Serve into a SafeFrame so the creative asks by message, whatever the global is calledThe creative in Ad Manager
The key list and line-item recipes are gone from the Code faceServe our demand first is on; the face shows them only while it is off (or in Adopt)The tag’s Google settings
House ads never fill after Google returns emptyThe backfill campaign bids exactly 0, so Prebid discards itThe campaign’s CPM, or Let our bids priced at zero still win
A slot you listed in Adopt is never auctionedIts name matches neither the element id nor the ad unit path; the console names it about ten seconds after loadTheir slot id or ad unit path on the slot; the publisher’s googletag.defineSlot call
Google reports a low render rate on the slotThe page rebuilds or hides (display: none) containers while a round is on its wayThe page’s single-page-app routing and CSS
EEA visitors get empty slotsCall Google Ad Manager without consent is off and they declined purpose 1; the slot is served by the tag alone, and with no bid it stays empty or collapsesThe tag’s Google settings; the campaigns’ targeting for those visitors
Slots load with Google but never your creative on a page with no consent banner, after gpt.js was blockedAn ad blocker dropped gpt.js: the slot is served without Google — your winning bid directly, or the fallbackThe browser’s network panel
A change you just saved is not on the pageThe CDN purge takes up to about five minutes to reach a page that already loaded the scriptWait five minutes, hard-reload
Your own tag trafficked in Ad Manager is counted as an Ad Manager fillIt is a Simple Iframe or Direct URL tag, or it served nothing; only Universal JS and Mount JS report the render as yoursThe ad tag type on the placement’s Ad tags & API card
Your demand wins the slot but Google demand never does on the leaderboardA Sponsorship at 100 % outranks the publisher’s lower-priority line items; it must be scoped to the tag’s ad units, never run-of-networkThe line item’s inventory targeting

A slot that returns nothing at all is explained on the placement’s troubleshooting log — see What the troubleshooting log says about a bid.

Reference

The Google Ad Manager line item

Google never sees your creative. What reaches Ad Manager is a handful of key-values on the ad request — the price, an id, the size, the bidder, and the deal key — and a line item you create decides whether they beat Google’s own demand. When it does, the line item’s creative is a small script that pulls the already-won ad out of the browser and draws it. All of this is created once per publisher network, in their Ad Manager, and applies only to slots with a GAM ad unit.

KeyWhat it carries
hb_pbThe bid price, in Prebid’s standard buckets, in US dollars
hb_adidThe id of the won bid the universal creative asks the page’s Prebid to render
hb_sizeThe creative size
hb_bidderThe bidder — epom_as
hb_deal_epom_asepom-direct on bids from campaigns the network sold itself; absent on House ads and partner bids
refreshfalse on the first round, true on every refresh — written on every Google slot so the publisher can target or exclude refreshed impressions
document_languageThe page’s <html lang>, only with Tell Google the page language on

Two line-item recipes, and the first is the one this route is built for:

  • To serve regardless of price: a Sponsorship line item, goal 100 %, with Custom targeting hb_deal_epom_as is epom-direct. The deal id exists only on bids from campaigns the network sold itself — neither House ads nor a programmatic partner’s win carries one — so Google demand keeps the slot whenever nothing was genuinely bought. A Sponsorship at 100 % also outranks the publisher’s own lower-priority line items, so scope its inventory targeting to the ad units in the tag, never to run-of-network.
  • To compete on price: one Price Priority line item per price bucket, each with Custom targeting hb_pb is that bucket’s price and a rate to match, using Prebid’s standard buckets. The winner is whoever bids highest, you included. Use this only if the publisher wants Epom to fight Google on price rather than take the slot when a campaign was sold.

The creative. One third-party creative per trafficked size, carrying the Prebid universal creative, attached to the line item — that is the recipe the Code face prints. Its job is to ask the Prebid on the page to render the bid whose id Ad Manager passes in hb_adid. The tag’s Prebid lives under the global easPbjs, not pbjs: a creative that addresses the page’s Prebid by name has to use that one. Tick Serve into a SafeFrame on the universal creative and it asks the page’s Prebid by message, whatever the global is called.

What fills and what Google keeps. The serving order per slot is sold campaign → Google → House ads campaign → fallback markup (or the container is hidden). A sold campaign wins whenever it bids, because its bid carries the deal id and the Sponsorship line item outranks everything else. A bid priced from a programmatic partner does not carry it: the money behind that bid is a cleared partner price, not a rate the publisher agreed with you, so it competes in Ad Manager on price like any other bidder. When it does not bid, the key is absent, the line item is not eligible, and Ad Manager serves exactly as it did before the tag — its own direct campaigns, then AdX or AdSense. Only when Google returns empty does the tag fall back to a House ads bid it is holding, then to the slot’s fallback markup. A House ads backfill campaign reaches that step only if its bid survives Prebid: bids priced at exactly zero are discarded before they can render, so either give the campaign a nominal CPM above zero or turn on Let our bids priced at zero still win, which exempts Epom’s bidder from that rule and leaves the rest of the page’s demand alone. The Header Bidding report shows this split per slot.

Prices. Epom bids what the publisher earns — the net price after site and placement pricing and revenue sharing — in US dollars, so the hb_pb value Google sees is comparable with every other bidder’s.

The tag’s Google settings

SettingDefaultDoesShown
Serve our demand first, let Google take the restoffDraws a sold campaign’s winning bid without asking Google for that slot; House ads and partner bids still go through Google. Hides the key list and recipes on the Code face while onowned slots only
Tell Google the page languageoffPasses <html lang> as the document_language key-valueowned slots only
Call Google Ad Manager without consentonOff: visitors without TCF purpose 1 consent where GDPR applies never reach Ad Manager; the tag serves its own winner cookielessowned slots only
Let our bids priced at zero still winoffExempts Epom’s bidder from Prebid’s rule that discards bids priced at exactly zeroowned and Adopt

Every other setting of the tag and the slot is on Header bidding tag settings and slots.

Related pages

Please disable Adblock
Are you using adblock? Disable it and reload the page to proceed to the destination page.

A registration has already been submitted from this page. Please try again in 10 minutes.