A Video Walkthrough of a Typical Prebid.js Auction
A step-by-step walkthrough of a typical Prebid.js auction.
This video will walk through the steps required to serve a display ad through an ordinary Prebid.js integration.
- This is the simplest and most common type of Prebid auction. Specifically, it is a client-side auction for a display ad running in a single-format ad slot on a website that uses a primary ad server.
- There are many variations on this basic form, which include:
- Auctions for other ad formats, such as video or native
- Auctions that use Prebid Server
- Auctions that use Prebid.js without a primary ad server
- Auctions in other environments such as AMP, mobile apps, and long-form video.
- Let’s start with a high-level overview of the steps:
- When the page loads, Prebid.js loads. The page invokes Prebid.js, which goes through a three-stage process: Pre-Auction, Auction and Post Auction.
- In the Pre-Auction stage, Prebid.js gathers information that it needs to run auctions for the ad slots on the page.
- Next comes the Auction stage:
- Prebid.js makes bid requests to bidders that the publisher has selected
- The bidders respond to Prebid.js with bids
- Finally, the post-auction stage begins
- Prebid.js gathers the bids and reformats them into a format that the primary ad server will understand
- For each ad slot, requests are sent to the ad server. These requests contains information about the bids Prebid.js received.
- The ad server receives the requests and decides which of the publisher’s ad buyers should serve an ad. Prebid bidders are considered alongside other potential buyers.
- When the primary ad server selects a Prebid bidder, it returns Prebid code that renders the ad to the page.
Now, we’ll go through the process in detail.
- The user requests the page, the publishers’ CMS is called and returns the page source, which includes instructions to load Prebid.js and begin an auction for one or more Ad Units
- An Ad Unit represents a unique ad slot on the page.
- The Ad Unit contains information about the attributes of the ad slot, such as the ad format, and dimensions. The Ad Unit also includes the list of bidders that are allowed to bid on the ad slot.
- In Prebid, the word “auction” refers to the process by which bids are solicited and received for one or more Ad Units. A bidder will usually receive a single HTTP request that contains information about one or more Ad Units, and the bidder is able to bid on any or all of them.
- Before the auction begins, Prebid.js is able to retrieve other optional information, depending on how the publisher has configured it. This information can include:
- User consent information from the publisher’s consent management platform
- Ad request enrichment data that describes the user, site, or page
- Price floor information
- And more
- Auction - The auction begins.
- Prebid.js sends bid requests to bidders.
- Bidders will receive an HTTP request that contains one or more ad units. Which ad units each bidder receives depends on how the ad units are set up by the publisher.
- Bid requests contain information about the ad units, page, user, and auction, including the page URL, ad slot identifiers, user identifiers, first party data, consent data, supply chain data, price floors and more.
- A bidder’s bid adapter is the component that formats the bid requests the bidder receives. Bidders build and maintain their own bid adapters and submit them to the open-source Prebid.js repository.
- At this point, Prebid.js will also start a timer that it uses to enforce the publisher’s configured bid timeout. The bid timeout determines the amount of time that Prebid.js will wait to receive bidders’ responses.
- Bidders consider the impression opportunity. They will consult their own sources of demand and determine whether they are able to offer an ad for the opportunity. If they do, they’ll also decide upon a price they would be willing to pay.
- Bidders return responses.
- The bidder’s HTTP response contains their bids for the Ad Units in the auction. The bidder isn’t required to place a bid, and bids only on the ad units they hope to win.
- Responses that include a bid will contain a URL that refers to the ad’s creative, a price, and other information such as deal IDs.
- Bids that Prebid.js receives before the bid timeout period has elapsed are considered valid bids. The bid timeout is set by the publisher in the Prebid.js configuration. Bids not received before the bid timeout will be logged as timed-out bids.
- Prebid.js processes responses
- As Prebid.js receives responses from bidders, it processes them
- Bidders’ bid adapters are responsible for parsing the bidders’ responses and exposing bid information to Prebid.js.
- Bid processing starts with extracting information from the bid, which can include bid prices, deal IDs, and ad format information.
- Where necessary, Prebid.js will perform other validations or transformations like price floor enforcement or currency conversion
- Prebid’s auction completes when either all of the bidders have responded and Prebid has processed their bids, or when the timeout period set by the publisher has elapsed.
- After the auction has completed, Prebid formats the bid information as a set of key-value pairs that the primary ad server will understand.
- With the Prebid auction complete, the ad server is called
- A request is sent to the primary ad server for each of the slots on the page. These requests will contain the bid key-value pairs.
- The ad server receives its request and evaluates the demand sources that the publisher has enabled, which includes but is not limited to Prebid bidders.
- Other demand sources that the ad server might consider are:
- Direct-sold campaigns with reservations, guarantees, or sponsorships
- Bids from other header bidding or programmatic sources
- Waterfall-style demand sources such as ad networks
- Each ad server works a little bit differently. For more information about how Prebid.js works with ad servers, refer to Prebid’s Ad Ops documentation.
- When the ad server selects a Prebid bid to serve, it returns a piece of Prebid code called a creative.
- Ad Rendering
- The creative triggers the ad rendering process, in which Prebid.js retrieves the bidder’s ad and renders it to the ad slot on the page.
- So that’s how an ad is served through Prebid.js
- Publishers can measure their monetization performance, troubleshoot issues, and maximize yield by gathering data about their header bidding auctions. Prebid supports a standardized interface for analytics adapters that allows publishers to integrate header bidding analytics tools that give them the insights they need.
- Prebid.js logs events throughout the auction and ad serving process. These events are exposed to analytics adapters, and they include the start of the auction, requests to bidders, bid responses, timeouts, ad server requests, ad renders, and more.
- Tools like the Professor Prebid browser extension also have the ability to monitor Prebid.js events and can be used for troubleshooting, debugging, and optimization.
- To learn more about the Prebid Auction and about Prebid’s analytics, optimization, and troubleshooting tools, visit docs.prebid.org.