Search ad auction rank and cost per click

Overview
Search ad auctions solve a narrow allocation problem: for a single search event, select a small ordered set of eligible advertisements and compute the charge for a later valid click. The input is not just a bid. It is a query, user and device context allowed by policy, targeting constraints, budget state, creative eligibility, predicted usefulness, and auction minimums. The output is an ordered list of ads and a clearing rule that usually charges no more than the advertiser’s declared maximum cost per click. The system must decide rank before it knows whether any click will happen, then bind a billing event to the auction state that existed at impression time.
The practical problem is multi-objective. A pure highest-bid sort would allocate prominent positions to ads that may be irrelevant, reducing search-result quality. A pure predicted-click sort would ignore declared willingness to pay and budget constraints. Search auctions therefore commonly use a rank score combining bid and quality estimates, then use a generalized second-price-style clearing rule: an ad’s billed cost per click is derived from the rank needed to keep its position, subject to minimum thresholds and rounding. The exact production formulas are proprietary, but the systems pattern is public and testable.
How it works
At request time, the retrieval layer builds candidate sets from keyword, match-type, audience, location, language, device, and negative-targeting indexes. A policy and eligibility stage removes ads that cannot be shown. A prediction stage estimates quantities such as click likelihood, ad-query relevance, and landing-page quality. Public search-ad documentation distinguishes these quality estimates from the visible diagnostic quality score; one large platform exposes a 1-to-10 diagnostic score, but auction-time quality can be more granular, query-specific, and updated continuously. That distinction matters because an engineer debugging rank cannot assume the displayed diagnostic value is the exact multiplier used in the live auction.
A minimal rank function is score = bid × quality, with optional additive or multiplicative terms for expected extensions, format effects, and minimum rank thresholds. Ads are sorted by score. In a continuous generalized second-price clearing model, the ad in position i pays enough per valid click to exceed the next ad’s rank score: cpc_i = next_score / quality_i, bounded by the bidder’s maximum and by any minimum threshold. If there is no next eligible ad, the threshold supplies the reserve. Production systems also handle discrete billing units, tie-breaking, budget pacing, and delayed invalid-click filtering, so the posted invoice value may differ from a simple floating-point formula by rounding and later adjustments.
Advertiser B holds position 1 without the highest bid — quality is doing the work.
What the standard says
There is no W3C, WHATWG, IETF, or ISO standard that specifies how a search engine must compute ad rank or cost per click. The relevant public specifications describe adjacent interfaces, not the proprietary ranking rule. IAB Tech Lab OpenRTB 2.6 defines real-time bid request and response fields such as BidRequest.at for auction type, Imp.bidfloor and bidfloorcur for minimum bid and currency, tmax for maximum response time in milliseconds, and SeatBid.Bid.price for the bid price. OpenRTB’s auction-type enumeration includes first-price and second-price-plus modes, but the specification does not require a search-ad rank formula, a quality multiplier, or a CPC-clearing equation.
The current browser-side advertising auction work is the WICG Protected Audience API, formerly called FLEDGE; the current terminology is Protected Audience. It defines browser-mediated interest-group auctions with functions such as generateBid() and scoreAd(), plus reporting hooks, but it is not a search-query text-ad standard and it does not mandate CPC billing. Measurement guidance is also separate. The MRC and IAB click-measurement guidance concerns when a click may be counted and how invalid activity should be filtered; it does not define rank. Current HTTP semantics are in IETF RFC 9110, which governs redirects and requests used in click-tracking flows, but it likewise says nothing about auction clearing.
Trade-offs
The central measurable trade-off is allocation quality versus bid weight. Increasing the quality multiplier’s influence can improve relevance and predicted engagement, but it can also make rank less transparent because small prediction changes alter both position and cost per click. Increasing bid weight makes the auction easier to reason about but risks showing less useful ads. Engineers usually measure this with prediction calibration, log loss or related scoring rules, position-level click-through estimates, complaint or policy-review rates, and the distribution of clearing ratios between billed CPC and maximum CPC. No public standard sets target values for those quantities.
Second-price-style clearing has a useful property: the winner’s charge is linked to competitive pressure rather than simply equal to the maximum bid. It is not, however, automatically strategy-proof in the presence of multiple slots, quality scores, reserve thresholds, budget pacing, broad-match expansion, and imperfect predictions. Floors and rank thresholds reduce low-quality or low-competition placements, but they also create discontinuities: a bidder can be eligible one moment and fail the next after a small quality-model update. Latency is another trade-off. OpenRTB exposes tmax as a per-request maximum response time, but search systems typically enforce internal deadlines for candidate retrieval, model scoring, and auction assembly rather than a universal public threshold.
Failure modes
Common rank failures are usually eligibility failures misread as auction failures. An ad may lose because a negative keyword matched, the query fell outside match semantics, a location or language constraint excluded it, budget pacing held it back, the landing page became disallowed, or a minimum rank threshold was not met. Diagnosis requires an auction trace that records the query normalization, candidate-source hits, all filters, maximum CPC, quality features or model outputs, rank score, threshold applied, next competitor score, tie-break decision, and final slot. Without per-stage reasons, teams tend to infer causality from the final CPC, which is insufficient.
Billing failures are different. The click may not map to the logged impression, a redirect may drop identifiers, the click may arrive after a retention window, or invalid-traffic filters may later exclude it. HTTP status handling, user-agent changes, consent state, and duplicate-click suppression can all affect measured clicks without changing the original auction. Rounding is another frequent source of discrepancy: the mathematically minimal CPC must be represented in the account’s billing unit, and taxes or external accounting fields should not be mixed into auction clearing. A correct diagnostic report separates auction-time expected CPC, click-time counted CPC, and post-filter adjusted CPC.
A minimal implementation
A correct minimal implementation needs six records: advertiser, ad, targeting rule, bid, auction event, and click event. The auction event should be immutable. It should store normalized query, eligible ad identifiers, maximum CPC, quality value, rank score, threshold, sorted position, computed clearing CPC, and a version identifier for the ranking model. The click event should reference the auction event, not recompute rank later. This prevents model drift from changing historical bills. The system also needs deterministic tie-breaking, explicit rounding, and a policy that rejects any candidate whose computed clearing CPC exceeds its maximum bid.
The minimal algorithm is: retrieve candidates; filter ineligible ads; compute quality with a versioned model; compute rank score as bid times quality; remove candidates below the required threshold; sort descending by rank score; for each shown ad, compute clearing CPC from the next lower rank score divided by the current ad’s quality, or from the threshold if there is no lower ad; round according to the billing unit; cap by maximum CPC; log all inputs and outputs. This implementation is not a complete commercial-scale auction, but it captures the essential systems invariant: rank is determined by bid and quality before the click, while cost per click is a clearing result derived from the rank needed to hold the displayed position.