Header bidding
with Prebid.js and Prebid Server
All demand sources are asked in parallel, a timeout you control ends the round, and the top bid reaches GAM while the page is still loading. Prebid.js and Prebid Server are managed by Worksly.
What happens while
the page paints
Five steps, one after another. Watch them run, then read the budget below.
- 01Page loadThe wrapper tag is fetched from the edge and ad units register with their sizes and floors.
- 02Bidders called in parallelAll demand sources are asked at once, Prebid.js adapters plus Prebid Server, in the same round.
- 03TimeoutThe configured budget closes the round, and slow bidders drop out.
- 04Top bid to GAMPrice and key-values are pushed to Google Ad Manager, where line items get the final say.
- 05Auction + renderGAM decides, the creative paints inside the reserved container, and each losing bid is logged with a reason.
How the timeout
trades speed for bids
A longer timeout lets more bidders answer: higher fill, slower pages. Pick a posture and see the trade you're making.
Illustrative trade-offs. The right posture depends on your audience, your bidders and how each page earns.
Client-side
or server-side
Most publishers run both: Prebid.js on the page for banner-rich web, Prebid Server where the client can't afford the round trip.
| Prebid.js | Prebid Server | |
|---|---|---|
| Where it runs | In the page, on the client | In our cloud, server-side |
| Latency profile | Adds its timeout to the page | One request from the edge |
| Demand reach | All Prebid.js adapters | Server-side adapters + your direct deals |
| Best for | Desktop & mobile web with many bidders | CTV, AMP, app webviews, slower connections |
| You maintain | Wrapper config in your repo | Nothing: it runs as part of the platform |
| Worksly setup | Managed Prebid.js 8+ wrapper | Prebid Server endpoints, s2s configured |
Your ad server
stays in charge
The wrapper's top bid competes inside Google Ad Manager, so your existing line items keep the final word, with AdX and Worksly demand in one comparable auction.
// worksly-hb.js: Prebid.js 8+
const adUnits = [{
code: 'billboard-970x250',
mediaTypes: { banner: { sizes: [[970, 250], [728, 90]] } },
bids: [{ bidder: 'worksly', params: { placementId: 'YOUR_PLACEMENT_ID' } }]
}];
pbjs.que.push(() => {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: () => pbjs.setTargetingForGPTAsync()
});
});Where the auction
does its work
Three questions about your inventory and your team. The recommendation updates with each answer, and the setup path follows from it.
Prebid.js covers banner-rich web while Prebid Server handles CTV, apps and the long tail of slower connections. One auction, one dashboard, the same loss reasons on both lanes.
What we need
from you before setup
Five items, most of them sitting in accounts you already run. Bring them to the setup call and the test page usually runs the same week.
GAM network access
An ad manager account with permission to create an order and line items. We deliver the Worksly HB order, the price buckets and the key-values as a setup guide, and your GAM admin applies them. MCM-delegated inventory runs through the same auction.
A consent platform
For EEA and UK traffic, a CMP registered on the IAB TCF list. The Worksly tag reads the TCF 2.2 string your CMP registers, and Google Consent Mode defaults go in before the first ad tag.
ads.txt and app-ads.txt
The dashboard generates your line: worksly.io, your account ID, DIRECT, 1bc3f09e77a2c401. Apps publish the same line as app-ads.txt on the developer domain named in the store listing.
A test page
One URL where the wrapper can run before live traffic: a staging build or a low-risk section. Testing there covers the consent deny path and the first GAM deliveries without touching real inventory.
Your current setup details
The wrapper you run today, floors per placement, and the ad units for the first batch. If another wrapper is live, we benchmark both on the same traffic before anything changes.
Integration steps
From generated config to full traffic in five steps. Tick a step as your team finishes it; the tracker runs in your browser and sends nothing anywhere.
- 01Wrapper config generatedYour placements, sizes and floors become a managed Prebid.js 8 config. Worksly generates it; your team reviews and ships it.Worksly
- 02GAM order and line itemsCreate the Worksly HB order, one line item per price bucket, plus the hb_pb, hb_bidder and hb_adid key-values. The dashboard generates the bucket list for dense pricing.You
- 03ads.txt and consent verifiedPublish the generated ads.txt line, app-ads.txt for apps, and test the consent chain including the deny path of your banner.You
- 04Test page verifiedFirst deliveries show hb_bidder=worksly in GAM and bid-loss reasons start appearing in the dashboard. Floors meet real bids for the first time.Both
- 05Traffic ramp in batchesPlacements move from the test section to full traffic in batches, with fill and loss trends watched in the dashboard after each batch.Both
Reading bid-loss reasons
Each lost impression reports a reason, and the mix tells you what to fix. Filter by the kind of problem you are chasing; losses are normal, a shift is the signal.
| Reason | What happened | What to do |
|---|---|---|
| Below floorbelowFloor | A bid arrived and sat under the floor set for the placement. | Check the floor against the bid distribution before moving it; the dashboard plots both. |
| No clearing bidinsufficientBid | Bids came in and none reached the clearing price in the first-price auction. | Expected for some share of impressions; act when it climbs on a placement that used to clear. |
| Timed outtimeout | A buyer answered after the round had already closed. | Trim slow bidders from the client wrapper or move that demand server-side. |
| No eligible demandnoDemand | Category, geo or deal targeting left the impression without an eligible buyer. | Review deal targeting and blocked categories for that placement. |
| Ads.txt mismatch | The domain's ads.txt did not authorize the seller on the bid. | Publish the line generated under Settings → Inventory and let the crawler re-check. |
| Blocked category | A category you blocked removed the buyer from the auction. | Compare blocked categories against the demand bidding on the placement today. |
| Line item gap | A winning price landed in a bucket with no line item to serve it. | Regenerate the bucket list under Settings → Inventory → GAM setup. |
The codes belowFloor, insufficientBid, timeout and noDemand are the stable strings the Reporting API returns with the bidLossReasons metric, so a chart built from the dashboard keeps matching an API pull over time.
Switching from
another wrapper
Already running a wrapper? The changeover runs in stages with the old setup serving until each batch moves. Open a stage to see what happens inside it.
Prebid + GAM setup docsStage 1: export what the current wrapper knows
Ad units with sizes, bidders per slot, floors, and the GAM order structure around them. This inventory list is the input for the Worksly config, so nothing gets lost between setups.
Stage 2: run both wrappers on a test section
The Worksly wrapper serves a test section while the current wrapper keeps the rest of the site. GAM keeps the two paths in separate orders, so delivery data stays readable on both sides.
Stage 3: compare lanes on the same traffic
The dashboard puts revenue per thousand impressions, win rate and the loss-reason mix side by side per placement. A week or two of overlapping data is usually enough to read which lane earns more on each section.
Stage 4: move placements in batches
One section moves at a time: the Worksly order takes the traffic, the old line items pause for that batch, and fill and loss trends get checked in the dashboard before the next batch starts.
Stage 5: retire the old setup
Remove the old tag, its GAM order and its key-values once the last batch settles. ads.txt lines for partners you still sell through stay; the Worksly line stays too.
Start monetizing
with Worksly
Bring your current wrapper and floors. We benchmark both lanes on your traffic before you change a thing.