You call one function, and a stopwatch starts. Several SSPs are asked at once, bids trickle in, and at some deadline Prebid says "time is up" and hands the best price to your ad server. Understand that timeline and you can debug almost anything.
The whole auction hangs off requestBids(). Here is the sequence, start to finish:
- 1
requestBids()fires every bid adapter in parallel. - 2Bid responses are collected as they arrive.
- 3
bidsBackHandlerfires when all bids are back OR the timeout hits, whichever comes first. - 4
setTargetingForGPTAsync()writes the winning key-values onto the ad slots. - 5The ad server is called, and it decides the final winner across header demand and its own.
pbjs.requestBids({
timeout: 1500,
bidsBackHandler: function () {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
},
});The Prebid event system (pbjs.onEvent with bidWon, bidResponse, bidTimeout, and more) lets you hook the lifecycle for analytics and debugging without changing the core flow.
Quick check
Your bidsBackHandler runs with `timedOut: true`. What does that tell you?
Note
When bids arrive late or the page feels slow, this lifecycle is the map. The Debug "Timeouts / slow page" runbook walks it.