Planning Metrics and an A/B Test for a Marketplace Search Feature
Statistics & ExperimentsModel answerLast updated
Design the metric set, guardrails, randomization unit, sample size and monitoring plan for a new feature in a two-sided booking marketplace, before any code is built.
Context
You work on a two-sided online marketplace where guests search for and book stays offered by hosts. A planning meeting is under way for a new feature, and the team wants the definition of success agreed on before engineering starts.
To make it concrete, assume the feature is a flexible-dates option on search. When a guest turns it on, the results also include listings available within ±3 days of the requested dates.
Task
Propose an experiment plan that covers:
- A hypothesis and the clarifying questions you would ask.
- A metric hierarchy: one primary metric, diagnostic metrics, and guardrails (with example thresholds).
- The unit of randomization and the unit of analysis, including how you would handle interference between guests and hosts.
- A sample-size and runtime calculation. Use a baseline booking conversion of 3%, a minimum detectable effect of 2% relative, a two-sided α of 0.05 and 80% power.
- Data-quality checks to run before trusting any result.
- Runtime monitoring and the decision rules for ship, iterate or kill.
Be explicit about trade-offs and about the mistakes you would avoid.
Hints
Hint 1
Pick exactly one primary metric that is user-level, directly moved by the feature and close to revenue. Put the noisier business metrics in the secondary group, and make sure the primary metric cannot be gamed by low-quality bookings.
Hint 2
Think about who else is affected when a guest in the treatment group books a listing. If supply is limited, a user-level test can overstate the lift, so consider a follow-up with market-level clusters or switchback designs.
Hint 3
For power, use the two-proportion formula with p = 0.03 and an absolute difference of 0.0006, then convert users per arm into days. Account for the attribution window, weekly cycles and variance reduction such as CUPED. Before reading any result, check sample ratio mismatch and exposure logging.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
1. Hypothesis and clarifying questions
State the bet in one sentence:
"Showing nearby-date results raises the share of searchers who find something bookable, which increases completed bookings without harming hosts or trip quality."
Questions to settle up front:
- Which users are eligible: all searchers, or only those who entered dates?
- Which platforms are in scope (web, iOS, Android)?
- What is the decision: global launch, specific markets, or iterate?
- How much downside is tolerable on revenue and on host experience?
2. Metric hierarchy
Primary metric (just one): the share of exposed users who complete a booking within 7 days of first exposure, excluding bookings cancelled within 48 hours. The cancellation filter stops the team from "winning" with low-intent bookings. Gross booking value is the business-level number, but it is heavy-tailed and noisy, so it sits in the secondary group.
Diagnostic metrics explain why the primary metric moved:
- Search-to-listing click-through rate and listing views per search.
- Share of searches with zero or very few results.
- Feature adoption (how often the toggle is used).
- Wishlist adds and time to book.
- Gap between searched dates and booked dates.
- Nights booked and booking value per searcher.
Guardrails are metrics that must not get worse than a pre-agreed margin:
| Area | Guardrail | Example margin |
|---|---|---|
| Trip quality | Guest cancellation rate; post-stay rating | ≤ +0.1 pp; ≤ −0.02 stars |
| Hosts | Rejection rate, host cancellations, calendar fragmentation | No significant increase |
| Revenue | Booking value per searcher; average nightly price | Non-inferior within −0.5% |
| Platform | p95 search latency; error rate | ≤ +50 ms; no increase |
| Support | Contacts per booking | No significant increase |
Test guardrails for non-inferiority (one-sided, against a margin). The goal is not to prove they improved, only that they did not degrade.
3. Randomization and analysis units
- Randomize by user (logged-in ID, with a stable device ID as a fallback). Guests search across many sessions and days. Session-level assignment would expose one person to both experiences and contaminate behavior.
- Analyze at the same level. For ratio metrics whose denominator is not the user (for example, clicks per search), use the delta method or user-clustered standard errors. Treating each search as independent understates variance and creates false positives.
- Interference is the marketplace-specific risk. Treated guests and control guests compete for the same inventory. If a treated guest books a listing a control guest would have taken, the measured lift partly reflects stolen supply rather than new demand. When supply is tight:
- Run a follow-up with market-level (geo-cluster) randomization or a switchback design to estimate the net effect.
- Compare the user-level lift with the market-level lift. A large gap indicates cannibalization.
- Host-facing features should be randomized by host or listing, not by guest.
4. Sample size and runtime
For a two-sided two-proportion test:
n per arm = 2 * (z_(1-α/2) + z_(1-β))^2 * p(1-p) / δ^2
Assumptions: p = 0.03, relative MDE of 2% so δ = 0.0006, α = 0.05, power 0.80.
- (1.96 + 0.84)² = 7.84
- p(1−p) = 0.0291
- n ≈ 2 × 7.84 × 0.0291 / (0.0006)² ≈ 1.27 million users per arm, about 2.5 million in total.
Converting to calendar time, assuming roughly 400k newly eligible users per day split 50/50:
- Unique-user accumulation is sub-linear because of returning visitors, so about 8–10 days of enrollment.
- Plan for 14 days: two complete weekly cycles, time for novelty effects to fade, and room for the 7-day attribution window to mature for late enrollees.
How to handle the MDE:
- Choose it from business value ("a 2% bookings lift justifies the build and maintenance cost"), not from the traffic you happen to have.
- If the test would run too long, reduce variance first: CUPED with pre-period searches and bookings (often 20–40% variance reduction), restrict analysis to triggered users who actually ran a dated search, and keep the primary metric list short.
- Correct for multiple comparisons on secondary metrics (Bonferroni or Benjamini–Hochberg), or label them exploratory.
5. Data-quality checks
- A/A test or pre-period balance check: the false-positive rate should be near 5%, with no baseline differences between arms.
- Sample ratio mismatch: run a daily chi-square test on assignment counts. If p < 0.001, stop and debug (bot filtering, redirects, crashes in one arm).
- Exposure logging parity: both arms must log exposure at the same moment, with control logging the counterfactual "would have seen the feature." Otherwise the analyzed populations differ.
- Event integrity: reconcile booking and search counts with source-of-truth tables, remove duplicates, check timezone handling.
- Outliers and bots: apply identical bot filters in both arms and winsorize booking value at a fixed percentile (for example, 99.9th).
6. Monitoring and decision rules
- Staged ramp: 1% → 5% → 50%, each stage 1–2 days, checking crashes, latency, SRM and guardrails before expanding.
- Automated alerts and a kill switch for severe regressions in errors or latency.
- No peeking at the primary metric under a fixed-horizon design. If early stopping is genuinely required, choose a sequential method in advance (alpha spending such as O'Brien–Fleming, or always-valid p-values such as mSPRT).
- Novelty check: plot the effect by days since first exposure. A decaying curve suggests novelty rather than durable value.
- Pre-registered segments: platform, new vs. returning users, region, trip length and supply tightness. Treat these as hypothesis-generating, not as grounds for a post-hoc win.
Decision framework (written before launch):
- Ship if the primary metric is significantly positive, every guardrail is within its margin, and the market-level check does not erase the gain.
- Iterate if the primary effect is flat but diagnostics show a mechanism that works (for example, higher click-through but low conversion).
- Kill if a guardrail is breached or the lift is explained by cannibalized supply.
Common mistakes
- Naming several "primary" metrics and then picking the one that moved.
- Randomizing by session or search, which leaks treatment across a user's visits.
- Ignoring supply interference and reporting an inflated lift.
- Choosing the MDE to fit traffic instead of business value.
- Stopping the moment p < 0.05 appears.
- Skipping SRM and exposure checks, then trusting a biased result.
- Defining guardrails as "must improve" rather than "must not degrade beyond a margin."