Debugging a Retention Drop in a Button-Color Experiment
Statistics & ExperimentsModel answerLast updated
A product test shows lower retention after a button turned red. Explain how to rule out assignment, balance, metric and statistical artifacts before blaming the color.
Scenario
Your team ran a randomized experiment on a call-to-action button. Control users saw a green button and treatment users saw a red one. When the results came in, treatment retention was lower than control. Some stakeholders think the way users were split between the two groups, rather than the color itself, may be responsible.
Question
Walk through how you would determine whether the traffic split could explain the retention drop. Specifically:
- Which diagnostics and balance checks would you run, and in what order?
- Which statistical tests would you use for each check?
- What would convince you that the drop is a genuine effect of the red button, and what would convince you it is an artifact?
State what you would do if a check fails, and describe the decision you would make at the end.
What a good answer covers
- Validity checks on the assignment mechanism itself
- Comparability of the two groups before treatment
- Fair computation of the retention metric across groups and over time
- Robust statistical inference, including how the stopping decision was made
- Segment-level analysis and its pitfalls
- A clear decision rule
Hints
Hint 1
Start with the cheapest check that can invalidate everything: do the observed group sizes match the intended split? A goodness-of-fit test on counts is the first step.
Hint 2
If the allocation percentage changed during the test, or the groups differ in when users joined, a pooled comparison can show a gap even when each day shows none. Think about stratifying by enrollment date.
Hint 3
Check how the result was reached: was the test stopped early after repeated looks? Also confirm that the retention window had fully elapsed for every user counted, and that segment findings are corrected for multiple comparisons.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Core idea
Treat the retention drop as a claim that must survive a sequence of validity checks. Only after the experiment is shown to be sound do I interpret the effect as caused by the color. I order the checks from cheapest and most invalidating to most nuanced.
1. Sample ratio mismatch (SRM)
Compare observed users per arm with the designed split using a chi-square goodness-of-fit test.
Example: a 50/50 design yields 491,000 control and 502,000 treatment users. The expected count is 496,500 per arm, so chi-square is about 2 × 5,500² / 496,500 ≈ 122 with 1 degree of freedom, giving p around 1e-28. A 1% gap looks harmless but is overwhelming evidence at this scale. I alert at a strict threshold such as p < 0.001.
from scipy.stats import chisquare
def srm_check(n_c, n_t, ratio=0.5, alpha=0.001):
total = n_c + n_t
exp = [total * ratio, total * (1 - ratio)]
stat, p = chisquare([n_c, n_t], f_exp=exp)
return stat, p, p < alpha
I run it overall, per day, and per segment (platform, app version, country, new vs. existing). An SRM confined to one slice usually points to the cause.
Typical causes: unit mismatch (randomize by device, analyze by user), logging or trigger asymmetry (the red variant crashes or renders slowly so events drop), bot filtering that interacts with the arm, and re-bucketing or caching bugs. If SRM is present I stop: the missing users are rarely missing at random, so the retention comparison cannot be trusted. Fix the pipeline and rerun, or restrict to a provably clean slice.
2. Assignment mechanics and exposure
- Confirm hashing is deterministic, salted per experiment, and independent of user attributes, and that overlapping experiments are orthogonalized.
- Look for users present in both arms and flag or drop them.
- Analyze by assignment (intent-to-treat). If the analysis is restricted to exposed users, verify the exposure trigger fires identically in both arms.
- Run an A/A test or replay through the same pipeline. P-values should be roughly uniform across reruns; if not, the analysis stack is biased.
3. Pre-treatment covariate balance
Compare arms on variables fixed before assignment: prior activity or retention, tenure, new-user share, platform, country, acquisition channel.
- Use standardized mean differences (flag above about 0.1), chi-square for categorical and t-tests for continuous variables.
- With around 20 covariates, one p < 0.05 is expected by chance. Look for large or systematic imbalance, not a single hit.
- Run a pre-period placebo: the "effect" on retention before launch should be zero. A non-zero value means the groups differed before treatment.
- If minor imbalance remains, use CUPED or regression adjustment with pre-period retention. This corrects residual imbalance and reduces variance.
4. Allocation changes over time and Simpson's paradox
If the treatment share ramped during the test, "traffic distribution" can create a spurious gap.
Example: treatment is 10% in week 1 and 50% in week 2. Week 2 users are a weaker cohort (retention 30% vs. 40% in week 1) in both arms, so the true effect is zero. Pooled: control = (90k×0.4 + 50k×0.3)/140k ≈ 36.4%, treatment = (10k×0.4 + 50k×0.3)/60k ≈ 31.7%. The 4.7 point drop is purely compositional.
Fixes: analyze only a period with stable allocation, or stratify by enrollment day or cohort and combine within-stratum differences (Cochran-Mantel-Haenszel, or regression with day fixed effects).
Related trap, metric maturity: D7 retention requires seven elapsed days. If treatment users enrolled later on average, more have immature windows and look "not retained." Restrict each metric to users whose full window has elapsed.
5. Peeking and temporal effects
- Ask whether the test was stopped when the dashboard first turned significant. Repeated looks at alpha = 0.05 can push the false-positive rate to 20-30%.
- Evaluate at the pre-registered horizon, or use a valid sequential method (group-sequential with O'Brien-Fleming boundaries, alpha spending, or mSPRT).
- Plot the daily effect. Novelty or primacy effects can produce an early shift that fades; do not extrapolate from a few days.
6. Segment analysis
Break results down by platform, OS, app version, country, and new vs. returning users.
- A drop concentrated in one slice (for example dark mode on one Android version) suggests a rendering bug, not a color preference. A genuine preference effect tends to appear modestly across many segments.
- Correct for multiple comparisons (Bonferroni or Benjamini-Hochberg) and treat findings as hypotheses.
- Segment only on pre-treatment attributes, never on post-treatment behavior such as clicking.
7. Main effect test
Once the checks pass, use a two-proportion z-test (or a regression with covariates) on the retention rate, report the absolute difference with a confidence interval, and compare it to the minimum effect that matters for the business. Check guardrail metrics (conversion, crashes, latency) and the direction of related metrics for consistency. Use a bootstrap or cluster-robust errors if the unit of randomization differs from the unit of analysis.
Decision rule
- SRM or placebo failure: the result is invalid. Fix and rerun; make no conclusion about the color.
- Compositional or maturity artifacts: reanalyze with stratification or a matured window and see whether the effect survives.
- Clean experiment, consistent negative effect, CI excludes the practical threshold: conclude the red button hurts retention and roll back, possibly after a confirmatory rerun.
- Effect confined to a segment: investigate a bug in that segment before judging the color.
Common mistakes
- Reading the result before checking SRM.
- Using a loose alpha for SRM and ignoring small percentage gaps at large scale.
- Pooling across periods with different allocation.
- Filtering to exposed users with an asymmetric trigger.
- Declaring a segment win or loss without multiple-testing correction.
- Reporting only a p-value without effect size or interval.