Course outline

Choosing the Randomisation Unit

By the end of this lesson, you should be able to: choose a randomisation unit and defend it, say what each alternative costs, keep the analysis unit matched to the randomisation unit, and spot the two failures that produce a clean-looking readout from a broken experiment.

Two decisions, not one

Every experiment makes two choices about units, and they're easy to confuse.

What you randomise on decides who gets which variant. What you analyse on decides what counts as one observation.

They must be the same thing. When they aren't, the test breaks in a way that leaves no trace in the output.

Why not the session?

Randomising per session is tempting. Sessions are more numerous than users, so you get more units, which means more power for the same calendar time. You don't need anyone to be logged in.

Here's what it costs, computed on Basket's actual session counts:

Sessions the user hasShare of usersChance they see both variants
17.7%0.0%
29.4%50.0%
311.3%75.0%
510.8%93.8%
104.7%99.8%

82.2% of Basket's users would see both variants.

A user who sees the old checkout on Monday and the new one on Wednesday is in neither group. Their behaviour is a blend, and it belongs to no arm. Worse, the inconsistency is itself an experience: a product that changes between visits is confusing in a way that neither variant is.

Two panels. On the left, the chance of seeing both variants rising steeply with the number of sessions, reaching nearly 100% by ten sessions, with a dashed line marking Basket's 82% average. On the right, two bars of false positive rate: one row per user at about 5%, one row per session at about 12%, against a dashed line at 5%.
Left, what session-level randomisation does to consistency. Right, what session-level analysis does to your error rate.

That's the general rule. Randomise on the coarsest unit the effect could reach, which for most product changes is the person.