In plain English
Before an experiment can assign anything it has to decide what it is assigning. Users are the usual answer, but sessions, devices, accounts, pages and whole geographic markets are all used, and the choice is not a detail. It determines what an independent observation is, and every standard error, confidence interval and p-value in the analysis rests on that.
User-level is the default for good reasons. It gives a consistent experience — someone does not see one variant on Monday and another on Tuesday — and it keeps each person contributing one independent observation. Session-level assignment breaks both: a returning user can be assigned differently each visit, which is confusing to experience and means their sessions are neither independent of each other nor cleanly in one arm.
The choice is forced upward when users affect each other. Colleagues in a shared workspace will notice if half of them see a different interface, so cluster randomization by account is the answer. In a marketplace where both arms compete for the same supply, no user-level split is valid at all and the unit becomes time or geography — a switchback test or a geo experiment. The rule is that the unit must be large enough that assignment does not leak across its boundary.
Going coarser costs a great deal of power and it is worth knowing the shape of the cost. Randomising 400 accounts rather than 80,000 users means the effective sample size is closer to 400, not 80,000, because users within an account behave similarly. The relevant quantity is the intraclass correlation, and even modest within-cluster similarity inflates the required sample substantially. Cluster randomisation is chosen because it is necessary, not because it is better.
The most consequential thing about the choice is the constraint it places downstream. Whatever unit is randomised is the unit the analysis must respect: randomise users and the variance calculation is over users, even when the metric counts sessions or events. Getting this wrong is the single most common source of overconfident results in web experimentation, and it is the subject of the analysis unit.
The formula
One inflation factor governs what coarsening the unit costs, and it is why cluster designs need so much more data than their headline user counts suggest.
- Effective sample size
n_eff = n / ( 1 + ( m − 1 ) · ICC )m is the average cluster size, ICC the intraclass correlation. This is the design effect.
- What that means in practice
m = 20, ICC = 0.1 → n_eff = n / 2.9Even mild within-cluster similarity nearly triples the required sample — see the sample size calculator.
- The downstream constraint
compute every variance across randomisation unitsRandomise users, aggregate to users, then compare. Analysing at event level overstates precision.
- When the unit must go coarser
if treating unit A can change unit B's outcomeInterference breaks the independence assumption, and no analysis at that unit repairs it.
Worked example
A B2B tool tests a new collaborative editing feature. Two designs are considered: randomise by user, which gives 24,000 units, or randomise by workspace, which gives 900 units averaging 27 users each. Colleagues share documents, so a user-level split would mean some people in a workspace see the feature and others do not.
- User-level units
- 24,000
- Workspace-level units
- 900 (mean 27 users)
- Intraclass correlation, measured
- 0.14
- Design effect
- 1 + 26 × 0.14 = 4.64
- Effective sample, cluster design
- 24,000 / 4.64 ≈ 5,170
- Detectable effect: user vs cluster
- 2.9% vs 6.3% relative
Cluster randomisation costs more than half the sensitivity — and the user-level design is not available, because contamination would invalidate it.
The arithmetic makes the cluster design look bad and the alternative is worse, which is the usual position. If half a workspace sees collaborative editing and half does not, the ones without it still encounter shared documents created with it, so control is contaminated and the measured effect is attenuated by an unknown amount. That is a biased estimate, whereas the cluster design gives an unbiased one with wider intervals — and a wide honest interval beats a narrow wrong one. What the numbers should change is the plan rather than the design: at 6.3% detectable, this test needs either a longer run or a more sensitive metric before it is worth starting. Note also the ICC of 0.14 is the number that drives everything here, and it was measured from historical data rather than assumed. Guessing it is how a cluster-randomised test ends up half the size it needed to be.
Common misconceptions
- דRandomising by session gives more data, so it is more powerful.”
- It gives more rows and not more independent information, since sessions from one person are correlated. It also means a returning user can be assigned to different arms on different visits, which makes their experience inconsistent and their data ambiguous. The apparent power gain is an artefact of counting correlated observations as independent.
- דYou should always randomise at the finest unit available.”
- Only when treating one unit cannot affect another. Where users share documents, compete for supply, or simply talk to each other, a fine unit produces contamination that biases the result. The correct unit is the smallest one at which that leakage does not occur, which is often coarser than the data permits.
- דThe randomization unit is an implementation detail for the platform team.”
- It determines what an independent observation is, which every standard error depends on, and it caps how much power the experiment can have. It is a design decision with statistical consequences that no amount of careful analysis afterwards can undo.