What is Prebid.js?
Prebid.js is the open-source JavaScript library, maintained by Prebid.org, that runs header bidding auctions in the browser. Publishers configure ad units and bidder adapters; Prebid.js calls each demand partner in parallel, collects bids within a timeout, and passes the winners to the ad server as targeting keys. It can also route some bidders through Prebid Server instead of calling them from the page.
Also called: Prebid JS, prebidjs, pbjs, Prebid.
How it works
Each demand partner has a bidder adapter that turns Prebid's internal bid request into that partner's format. Many adapters send OpenRTB, often built with Prebid's shared OpenRTB conversion library, while others still send proprietary JSON. Either way, the request a bidder sees was assembled by an adapter, so two adapters can describe the same impression differently.
Publisher data reaches adapters through two configuration objects that mirror OpenRTB. ortb2 holds request-level first-party data laid out like a BidRequest, with keys such as site, user, device, and regs, and ortb2Imp holds per-ad-unit data laid out like an Imp. Modules for user IDs, consent, and the supply chain write into the same structures, and adapters copy them into their requests.
Two parts of Prebid.js often explain odd numbers. Price granularity buckets bids before they reach the ad server, so the price recorded there is rounded down to a bucket rather than the exact bid. And the bidder timeout configured in Prebid.js is separate from any BidRequest.tmax an adapter sends, so a bidder can receive a generous tmax and still be cut off by the page.
Read more
Related terms
Every term is in the glossary.