Problem
Many A/B tests are read with a Z-test of proportions. It assumes independent observations and breaks when the randomization unit differs from the analysis unit. If the metric is computed per session but users were randomized, several sessions come from one user. Variance is then underestimated, the Z score is inflated, and the null hypothesis is rejected too often. A few heavy units can also swing the whole result.
Example from the article: GetYourGuide randomized activity providers for an AI content-creation tool. The main metric, activity submission conversion rate, was computed per activity, so the analysis unit did not match the randomization unit. Traveler metrics for the new activities were also needed, but travelers could not be randomized and the new activities had no history to compare with.
Solution in brief
Run a permutation test: shuffle the variant labels many times, recompute the metric each time, and compare the observed difference with that shuffled distribution. The labels must be shuffled at the level where randomization happened. The team also put the test into its shared Python library and notebooks so any analyst can run it.
Questions this case answers
- How to test the significance of an experiment readout when observations are not independent because the analysis unit is finer than the randomization unit
- How to estimate the effect on a downstream population when only an upstream population was randomized and a pre-period baseline does not exist
- How to test A/B significance when the randomization unit differs from the analysis unit?
- How to keep a few large units from deciding an experiment readout?
Tools and methods
- Permutation test — builds a null distribution of the test statistic by shuffling labels, with few distributional assumptions.
- Bootstrap — optional confidence interval for the test statistic.
- Internal Python library and Databricks notebooks — two-line permutation tests, plots, pre-defined metrics, result storage in a named table.
Google or a one-time email code. No password.