Concurrent Shelf and Item Ranking A/B Tests
Medium · Analytics & Experimentation · Data Scientist · Technical Screen
Prompt
A consumer shopping-and-rewards mobile application organizes its browse screen into horizontal shelves, where each shelf showcases a collection of items. Two ranking layers govern what a shopper sees: one algorithm orders the individual items inside each shelf, and a second algorithm orders the shelves vertically from top to bottom.
Product engineering plans to run two concurrent A/B tests on this surface:
- Experiment 1 (Within-shelf item ranking): Alters how items are ordered inside each shelf, enrolling 50% of app traffic.
- Experiment 2 (Vertical shelf ranking): Alters the top-to-bottom sequence of shelves across the screen, enrolling 9% of app traffic.
The overarching business objective is to lift shopper engagement and downstream conversion—measured through signals such as item taps, cart additions, completed orders, gross spend, or receipt uploads.
Address the following four questions:
- Which experimental design choices and analytical prerequisites matter most before launching and reading out these two tests?
- Suppose traffic between the two tests cannot be fully isolated into separate user pools. Does traffic overlap invalidate both readouts? Explain why or why not.
- When a subset of shoppers experiences both experiments simultaneously, how can you quantify how Experiment 2 alters the treatment effect of Experiment 1?
- Which decision metrics, safety guardrails, statistical health checks, and rollout-interpretation pitfalls should your evaluation plan cover?
Scope & Expectations
- Randomization & power planning: Specify the randomization unit, hashing independence, exposure logging trigger, run horizon, and minimum detectable effect implications of the asymmetric
50%vs.9%traffic split. - Causal validity under overlap: Distinguish independent orthogonal assignment from true threats to validity (correlated hashing, cross-session contamination, and shared-budget interference), showing how interaction effects affect standalone vs. joint rollout estimates.
- Interaction estimation: Formulate a concrete method (such as a
2x2factorial contrast or regression model) to estimate Experiment 2's moderating effect on Experiment 1, noting its variance and confidence-interval behavior. - Metrics & statistical rigor: Structure primary, diagnostic, and guardrail metrics at the proper unit of analysis alongside pre-readout integrity checks (sample ratio mismatch, pre-period balance, variance reduction, and cannibalization/novelty checks).
Step-by-step walkthrough
Map both experiments onto one user grid
Imagine a grocery store running two layout tests in the same week: Experiment 1 (E1) rearranges which items sit at eye level inside each shelf, while Experiment 2 (E2) rearranges which shelves sit closest to the front entrance. Both changes touch the exact same shopping screen, so whether a user taps a product can depend on both which shelf appears near the top and which products appear first inside that shelf.
The scenario allocates a 50% traffic share to E1 and a 9% traffic share to E2. Standard practice is to split each experiment's enrolled traffic evenly between control and treatment (
25% / 25%for E1;4.5% / 4.5%for E2), while un-enrolled users (50%for E1;91%for E2) continue seeing today's default app ordering.If the experimentation platform assigns each experiment using an independent hash salt (a unique string appended to
user_idbefore hashing so the two experiments shuffle users independently), every user lands in one cell of a3 x 3grid whose shares multiply cleanly:E2 control (4.5%) E2 treatment (4.5%) Not in E2 (91.0%) E1 control (25.0%) 1.125% 1.125% 22.750% E1 treatment (25.0%) 1.125% 1.125% 22.750% Not in E1 (50.0%) 2.250% 2.250% 45.500%With an illustrative
1,000,000weekly exposed shoppers: - E1 compares250,000control users against250,000treatment users. - E2 compares45,000control users against45,000treatment users. - The 2x2 overlap contains four cells of11,250users each (45,000users total).Nail down the experiment design: unit, trigger, duration, and power
Before analyzing a single row of data, several design choices determine whether the two tests are trustworthy:
- Randomize by user, never by session or request. Ranking changes must stay consistent across visits; otherwise a shopper sees shelves jump around between sessions, and delayed outcomes like purchases or receipt uploads cannot be tied cleanly to one variant.
- Use independent hash salts. Hashing
user_id + "exp1_product_rank"anduser_id + "exp2_shelf_rank"guarantees that E1 control and E1 treatment each contain the same4.5%fraction of E2 treatment users. Reusing the same salt would trap all9%of E2 inside a single slice of E1 and confound both tests. - Trigger on entering the shelf surface, not on viewing a specific shelf. Many users open a rewards app only to check their point balance and never visit the shopping shelves; including unexposed users dilutes real effects toward zero. Log an exposure trigger (the timestamp when a user first loads the shelf screen) symmetrically in both arms. Never trigger on "user saw Shelf X," because E2 moves Shelf X up or down — that would create post-treatment selection bias (where the treatment itself changes who enters your analysis sample).
- Run whole weeks and pre-register. Shopping and receipt-scanning habits swing sharply between Tuesdays and Saturdays, so run for full 7-day multiples (at least 2 weeks to let initial curiosity settle) and lock in metrics, duration, and ship criteria beforehand (pre-registration).
- Check statistical power, especially for E2's 9% slice. Statistical power is the probability of detecting a true effect when it exists (standard target:
80%), and the minimum detectable effect (MDE) is the smallest true change a test can reliably separate from noise at a two-sided5%significance level. For a binary conversion rate nearp = 10%(p * (1 - p) = 0.09),MDE = (1.96 + 0.84) * SE:
Comparison Users per arm / cell Standard error (SE) MDE (abs / relative) E1 main effect 250,000 vs 250,000 0.085 pts 0.24 pts (2.4% rel) E2 main effect 45,000 vs 45,000 0.200 pts 0.56 pts (5.6% rel) E1 x E2 interaction (2x2) 11,250 in each of 4 0.566 pts 1.58 pts (15.8% rel)Because E2 only gets
9%of traffic, its MDE (0.56percentage points) is more than twice as wide as E1's (0.24points). If shelf reordering is expected to move conversion by0.3points, E2 at9%is under-powered and will likely look "flat" by chance unless we run longer, raise traffic, or apply variance reduction.Are overlapping results unusable? No — here is what overlap actually does
Overlapping traffic does NOT make the experiment results unusable, provided the two assignments are independent.
Why? Because independent hashing balances E2 evenly across E1's arms:
4.5%of E1 treatment users and4.5%of E1 control users receive E2 treatment. Any standalone boost from E2 is added equally to both sides of E1 and cancels out when we take the difference. E1's estimator remains unbiased for E1's average effect across today's app traffic.What overlap does affect is how the estimate generalizes if both experiments ship, whenever there is an interaction effect (
gamma, the extra synergy or friction that occurs only when a user gets both E1 treatment and E2 treatment at once). Lettau1be E1's lift under the current shelf order,tau2be E2's lift under the current product order, andgammabe their interaction:E1 measured lift = 0.955 * tau1 + 0.045 * (tau1 + gamma) = tau1 + 0.045 * gamma E2 measured lift = 0.750 * tau2 + 0.250 * (tau2 + gamma) = tau2 + 0.250 * gamma Worked numeric example: tau1 = +0.80 pts, tau2 = +0.40 pts, gamma = -0.40 pts - E1 measures: 0.80 + 0.045 * (-0.40) = +0.782 pts (almost purely tau1) - E2 measures: 0.40 + 0.250 * (-0.40) = +0.300 pts (25% of E2 sits in E1 treatment!) - If BOTH ship to 100% of users: combined lift = tau1 + tau2 + gamma = 0.80 + 0.40 - 0.40 = +0.80 pts (NOT +1.20 pts!)Notice the asymmetry: only
4.5%of E1 sees E2 treatment, so E1's headline number barely budges, whereas 25% of E2's traffic sits inside E1 treatment, shifting E2's headline estimate noticeably.Overlap only breaks validity under three specific failures: 1. Correlated assignment (shared hash salt or enrolling E2 only inside E1's treatment group). If all four
(E1, E2)cells still have users, you can salvage unbiased estimates by computing E1's lift separately inside each E2 arm; if a cell has zero users, the effects are mathematically inseparable there. 2. User contamination (logged-out/logged-in identity splits or caching bugs letting one shopper experience both orderings), which dilutes treatment differences toward zero. 3. Shared resource competition (a violation of SUTVA, the assumption that one user's variant does not alter another user's outcome — for example, treatment shoppers exhausting a fixed daily brand-reward budget so control shoppers see "offer sold out").Measure Experiment 2's impact on Experiment 1 with a 2x2 factorial analysis
Inside the
4.5%of traffic enrolled in both tests (4cells of11,250users), the overlap forms a 2x2 factorial design (an experiment layout testing all four combinations of(T1 in {0, 1}) x (T2 in {0, 1})).You can measure how E2 changes E1's impact using linear regression on the overlap users:
Y = b0 + b1 * T1 + b2 * T2 + b3 * (T1 * T2) + error b0 = baseline conversion rate when both E1 and E2 are in control b1 = E1's lift when E2 is in control (old shelf order) b1 + b3 = E1's lift when E2 is in treatment (new shelf order) b3 = interaction effect: how much E2 changes E1's liftEquivalently,
b3is a difference-in-differences across the four cell conversion rates, which is easy to compute and explain directly in Python:import math def analyze_overlap_cells(cells): """cells[(t1, t2)] = (conversions, users). Returns conditional lifts, interaction, and SE.""" rates = {} total_variance = 0.0 for key, (conversions, users) in cells.items(): rate = conversions / users rates[key] = rate # Each cell is an independent sample of users, so cell variances add total_variance += rate * (1.0 - rate) / users e1_in_old_shelves = rates[(1, 0)] - rates[(0, 0)] e1_in_new_shelves = rates[(1, 1)] - rates[(0, 1)] interaction = e1_in_new_shelves - e1_in_old_shelves se_interaction = math.sqrt(total_variance) return e1_in_old_shelves, e1_in_new_shelves, interaction, se_interaction overlap_cells = { (0, 0): (1125, 11250), # 10.0% conversion (1, 0): (1215, 11250), # 10.8% conversion -> E1 lifts +0.8 pts under old shelves (0, 1): (1170, 11250), # 10.4% conversion (1, 1): (1215, 11250), # 10.8% conversion -> E1 lifts +0.4 pts under new shelves } old_lift, new_lift, gamma_hat, se = analyze_overlap_cells(overlap_cells) # old_lift = +0.0080, new_lift = +0.0040, gamma_hat = -0.0040 (-0.40 pts), se = 0.0058 (0.58 pts)In this trace, E1 adds
+0.80percentage points under the old shelf order but only+0.40points under the new shelf order, givinggamma_hat = -0.40points withSE = 0.58points (z = -0.69,95%confidence interval[-1.53, +0.73]points). BecauseVar(interaction)sums four cell variances instead of two, a balanced interaction has 2x the standard error (and needs 4x the sample size) of a main effect on the same cells.Three practical ways to sharpen this analysis: - Report confidence intervals, never just "not significant." An interval of
[-1.53, +0.73]points means the overlap is too small to rule out a meaningful negative interaction, NOT thatgamma = 0. - Pool un-enrolled E2 users only after verifying equivalence. The91%of E1 users outside E2 also see the old shelf order (227,500users per E1 arm). If E2 has no special targeting filter or latency overhead (verified by checking thatE2 controlandNot in E2match on baseline metrics), pooling them raises the old-shelf sample from11,250to238,750per E1 arm, cutting the interaction SE from0.57to0.41points (MDEdrops from1.58to1.15points). If E2 uses custom eligibility gating, stick strictly to the four11,250-user overlap cells. - Inspect mechanism metrics (such as whether E2 shifts clicks away from shelves where E1 made its biggest product changes) and, if both teams want to ship together, run a properly sized 2x2 confirmation test before full rollout.Choose metrics and guardrails for a shopping rewards app
Organize metrics into three tiers before starting the experiment:
- Primary decision metric (one per experiment, measured per exposed user): shopping conversion rate or attributed orders / verified receipt uploads per exposed shopper over the test window. Pick the single metric closest to durable business value.
- Secondary diagnostic metrics (explain why the primary metric moved):
- Item taps and cart-addition events per exposed shopper.
- For E1 (within-shelf order): share of clicks landing in horizontal slots 1–3 of a shelf, and per-shelf click-through rate.
- For E2 (shelf order): vertical rank of the first-clicked shelf, vertical scroll depth, and share of users reaching lower shelves.
- Guardrail metrics (must stay within pre-agreed safety bounds):
- 7-day retention and sessions per user, ensuring aggressive ranking changes do not fatigue shoppers.
- Gross revenue or net reward margin per user, catching cases where ranking cheap impulse items boosts click volume while shrinking basket dollars.
- Partner / sponsored shelf exposure, ensuring reordered shelves do not breach brand partner impression commitments.
- App performance: p95 shelf-rendering latency and client crash rate.
When computing ratio metrics like impression-level click-through rate (
total clicks / total impressions), never plug total impressions into a textbook binomial formula: one active shopper generates dozens of correlated impressions, which makes naive p-values falsely tiny. Instead, compute variance at the user level using the delta method (a formula that derives the variance ofSUM(clicks_u) / SUM(impressions_u)from user-level variances and covariance) or a user-level bootstrap (resampling whole users with replacement).Run statistical checks before reading any treatment lift
Run a standard checklist of validity and precision checks before interpreting treatment effects:
- Sample ratio mismatch (SRM) on each test and on the 4 overlap cells. SRM occurs when the observed user split deviates from the intended ratio by more than random chance allows, signaling a routing, caching, or logging bug. Suppose E2 expects
45,000 / 45,000users and observes45,600 / 44,400:chi_square = (45600 - 45000)^2 / 45000 + (44400 - 45000)^2 / 45000 = 16.0(p = 0.00006). Stop immediately and fix the pipeline before reading any metric. - Cross-experiment independence check. Run a chi-square test of independence on the
2 x 2table of(E1 arm) x (E2 arm)counts to confirm each cell holds ~25%of the overlap. - Pre-period A/A balance. Confirm the assigned arms had statistically indistinguishable conversion and spend in the 2–4 weeks before exposure.
- Variance reduction via CUPED. CUPED (Controlled-experiment Using Pre-Experiment Data) adjusts each user's test-period outcome
Yusing their pre-experiment baselineX:Y_adj = Y - theta * (X - mean(X))wheretheta = cov(X, Y) / var(X). If pre- and post-period conversions correlate atr = 0.6, CUPED cuts variance byr^2 = 36%— equivalent to getting56%more traffic for free, which helps under-powered E2 the most. - Multiple testing, peeking, and heavy-tail handling. Pre-commit to one primary metric; apply Benjamini-Hochberg false-discovery-rate correction (a p-value ranking adjustment that controls the expected share of false positives across many secondary metrics); wait for the full planned horizon (or use a formal sequential test rather than peeking daily); and winsorize (cap extreme top-
1%outliers at a pre-set threshold) skewed metrics like revenue per user.
- Sample ratio mismatch (SRM) on each test and on the 4 overlap cells. SRM occurs when the observed user split deviates from the intended ratio by more than random chance allows, signaling a routing, caching, or logging bug. Suppose E2 expects
Avoid interpretation traps when making the launch call
Even when every statistical check passes, ranking experiments carry subtle interpretation traps:
Cell (E1, E2) Conversion rate Lift vs (control, control) (control, control) 10.0% -- (E1 treatment, control) 10.8% +0.8 pts (control, E2 treatment) 10.4% +0.4 pts (E1 treatment, E2 treatment) 10.8% +0.8 pts (sub-additive: NOT +1.2 pts!)- Sub-additive combinations (
1 + 1 < 2). In the table above, both teams see positive standalone results (+0.8pts and+0.4pts), yet shipping both delivers+0.8pts — zero gain over shipping E1 alone, because both rankers surfaced the same popular items! Always make the launch call on the exact combination cell you intend to ship. - Shelf cannibalization and position bias. Moving Shelf A to position 1 steals attention from Shelf B below it: Shelf A's CTR surges even if total conversions per user stay flat (cannibalization). Likewise, comparing a product's CTR across arms mixes item appeal with screen slot (position bias). Base launch decisions strictly on per-user totals.
- Novelty vs learning curves. Plot daily treatment lift by days since first exposure; habitual shoppers often click a rearranged screen more (or less) in week 1 before settling into a steady state.
- Simpson's paradox during traffic ramps. Simpson's paradox happens when pooling data across time reverses the true within-period comparison — for example, ramping E2 from
2%on Tuesday to9%on Saturday (when weekend conversion is naturally higher) inflates E2 treatment with weekend shoppers. Keep traffic splits constant during the analysis window, or compute lifts within each ramp phase and combine them with inverse-variance weights. - Clickbait proxy divergence. If product clicks jump
+5%while purchases or receipt submissions stay at0%, the new ranking surfaces eye-catching items shoppers do not actually buy — iterate on the ranking objective rather than shipping on clicks.
- Sub-additive combinations (
Intuition & how it works
Picture a supermarket testing two layout ideas in the same week: Experiment 1 (E1, 50% of shoppers) rearranges which products sit first inside each shelf, while Experiment 2 (E2, 9% of shoppers) rearranges which shelves sit closest to the store entrance. When the app assigns users to E1 and E2 using two independent hash salts (distinct strings mixed with user_id before hashing so the two coin flips are completely unrelated), the overlap is not a bug — it automatically forms a 2x2 factorial experiment (a four-cell grid covering (E1 control/treatment) x (E2 control/treatment)). Because E1 control and E1 treatment each contain the exact same 4.5% share of E2 treatment users, E2's standalone lift cancels out of E1's comparison, leaving both main-effect estimates unbiased.
Two naive instincts fail badly here. First, throwing away overlapping users wastes valuable sample size and blinds you to what happens when both ranking changes run together in production. Second, naively adding E1's headline lift and E2's headline lift (+0.8 + +0.4 = +1.2 percentage points) ignores interaction effects (synergy or cannibalization when both changes are active simultaneously) — for instance, if E1 promotes bestsellers to slot 1 of a shelf and E2 moves that shelf up or down, their gains can overlap instead of stacking.
Here is a concrete 4-cell trace on 45,000 shoppers enrolled in both experiments (11,250 per cell):
Cell (E1, E2) Users Conversions Rate What it tells us
(0, 0) Old products, old shelf 11,250 1,125 10.0% Baseline
(1, 0) New products, old shelf 11,250 1,215 10.8% E1 lift under old shelves = +0.8 pts
(0, 1) Old products, new shelf 11,250 1,170 10.4% E2 lift under old products = +0.4 pts
(1, 1) New products, new shelf 11,250 1,215 10.8% E1 lift under new shelves = +0.4 pts
Interaction (difference-in-differences) = (+0.4 pts) - (+0.8 pts) = -0.4 pts
Combined lift if both ship = 10.8% - 10.0% = +0.8 pts (same as E1 alone!)
Key points
- Independent overlap is unbiased in expectation. Orthogonal hashing ensures each arm of E1 gets the same
4.5%dose of E2 treatment, and each arm of E2 gets the same25%dose of E1 treatment, so standalone lifts cancel out of each experiment's difference. - Overlap shifts external interpretation asymmetrically. With interaction
gamma, E1's overall lift equalstau1 + 0.045 * gamma(almost purely E1's effect under today's shelf order), whereas E2's overall lift equalstau2 + 0.25 * gammabecause25%of E2 users sit inside E1 treatment. Neither headline number equals the combined rollout lifttau1 + tau2 + gamma. - True threats are correlated assignment, contamination, and shared budgets. Reusing one hash salt confounds the two tests; cross-device identity splits dilute effects toward zero; and shared reward caps violate SUTVA (the assumption that one user's treatment does not affect another user's outcome).
- Measure E2's impact on E1 via the 2x2 interaction
b3 = (p_11 - p_01) - (p_10 - p_00). BecauseVar(b3)adds four cell variances instead of two, a balanced interaction has2xthe standard error and needs4xthe sample size of a main effect on the same cells (MDE = 1.58percentage points here vs0.56points for E2 and0.24points for E1). - Guard validity and precision systematically. Trigger on entering the shelf screen as a whole (never a single shelf), check sample ratio mismatch (SRM) with a chi-square test per experiment and across the 4 cells, apply CUPED (variance reduction using pre-experiment user baselines), analyze ratio metrics at the user level via the delta method or bootstrap, and judge success on per-user shopping conversions alongside revenue, retention, partner-exposure, and latency guardrails.
Common mistakes
- Dropping overlapping users from the analysis. Excluding the
4.5%overlap throws away statistical power and destroys the exact2x2cell ((1, 1)) needed to see whether both changes work together. - Adding the two standalone lifts to forecast a joint launch. When two rankers surface the same popular products, their combined lift is often much smaller than
tau1 + tau2(or even negative if they clash). - Treating "interaction p > 0.05" as proof of zero interaction. With
11,250users per overlap cell, the interaction test cannot reliably detect anything smaller than1.58percentage points; always inspect the confidence interval. - Reusing the same hash salt across experiments. Hashing
user_idwith an identical seed maps the9%of E2 into a deterministic slice of E1 instead of spreading it evenly across E1 control and treatment. - Using impression-level binomial standard errors for CTR. One user generates many correlated shelf impressions, making naive standard errors artificially tiny and inflating false positives.
- Judging E2 by individual shelf CTR or triggering on a specific shelf. Moving a shelf to the top boosts its clicks by cannibalizing lower shelves and changes which shoppers reach it; only per-user totals on all shelf-screen visitors give an apples-to-apples comparison.
- Ramping traffic mid-experiment without stratifying by phase. Changing E2 from
2%on weekdays to9%on weekends creates Simpson's paradox (pooling unequal time slices biases the treatment arm toward high-converting weekend traffic).
Follow-up questions
- When should two ranking experiments be isolated in mutually exclusive traffic buckets rather than allowed to overlap? Mutual exclusion makes sense when two changes cannot technically coexist in the UI, when engineering expects a severe negative interaction that could break the user experience (such as crashes or empty shelves), or when only one of the two candidates could ever ship. The trade-off is smaller available traffic pools (
50% + 9% = 59%consumed linearly) and zero direct data on the(treatment, treatment)combination. When both ranking improvements could plausibly ship together, independent overlap with an explicit2x2check is strictly more informative. - What sample size would a dedicated 2x2 factorial test need to detect a 0.4-percentage-point interaction effect? With
nusers in each of the 4 cells and baseline conversionp = 10%, the interaction's standard error issqrt(4 * p * (1 - p) / n). Solving(1.96 + 0.84) * sqrt(4 * 0.09 / n) = 0.004givesn = 4 * 0.09 * (2.80 / 0.004)^2 = 176,400users per cell, or705,600exposed users total (4xthe176,400total users required to detect a0.4-point main effect). Because that sample requirement is steep, teams combine CUPED pre-period adjustment with diagnostic exposure metrics (like top-shelf click share) and reserve full-size interaction tests for launches where shipping both is on the table. - How would you act if Experiment 1 boosts item clicks by 6% while completed orders and receipt uploads stay flat? Hold back the launch and trust the pre-registered primary conversion metric, because clicks are only an upstream proxy metric (a fast-moving intermediate signal that imperfectly predicts business value). Diagnose why clicks failed to convert: check whether E1 promoted cheap/out-of-stock eye-candy items, whether add-to-cart rate per click dropped, or whether shoppers clicked more items only because the first item was worse and forced extra searching. Use that finding to retrain or re-weight E1's ranking score toward predicted purchase or receipt value rather than raw click probability.
Follow-up questions
- When should two ranking experiments be isolated in mutually exclusive traffic buckets rather than allowed to overlap?
- What sample size would a dedicated 2x2 factorial test need to detect a 0.4-percentage-point interaction effect?
- How would you act if Experiment 1 boosts item clicks by 6% while completed orders and receipt uploads stay flat?
Similar questions
- Investigating an Alleged Quarterly Retail Sales Drop
- Driving Clarity and Metric Rigor with Quiet Stakeholders
- Quarterly Overall and Same-Store Sales Comparison in SQL
- Independent vs. Stratified Ad Placement in a 100-Item Feed
- Customer Support Costing, Metric Drops, and Order Defects
- Causal Evaluation of a Regional Feature Rollout