Set up client-side header bidding with Prebid.js and pass bids to your ad server

domain: docs.prebid.org · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Build a custom Prebid.js bundle including only the bidder adapters you need from the Prebid download page.
  2. Define ad units and call pbjs.addAdUnits(adUnits) with sizes and bidder params for each slot.
  3. Ensure your CMP resolves TCF/US-Privacy consent before calling pbjs.requestBids, or bidders may be suppressed or return no bid in regulated regions.
  4. Call pbjs.requestBids({bidsBackHandler}) to run the auction and collect bids in the callback.
  5. Push winning bid targeting to your ad server, e.g. pbjs.setTargetingForGPTAsync() for Google Ad Manager, before firing the googletag ad request.
  6. Mirror the key-value targeting configuration on the ad-server side (GAM line items) so it exactly matches what Prebid sends.

Known gotchas

Related routes

Deploy or configure Prebid Server to run server-side header bidding auctions instead of client-side Prebid.js
docs.prebid.org/prebid-server · 5 steps · unrated
configure prebid server-side price floors with dynamic fetch and caching
docs.prebid.org · 5 steps · unrated
send server-side conversion events to x ads via the conversion api
docs.x.com/x-ads-api · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans