Two randomly assigned groups can contain shoppers with very different purchase histories by chance. If previous behavior predicts spending during an experiment, that history can help reduce noise in the estimated treatment effect. CUPED uses pre-experiment information for this purpose. It does not create extra customers, improve tracking, or turn an observational comparison into a randomized experiment.
EcomToolkit’s approach is to treat variance reduction as an analysis design decision made before results arrive. This guide explains the commercial use case, a simple calculation, and the checks that protect interpretation. Every numerical example is hypothetical. No precision gain or test-duration reduction is promised for a particular store.
Table of Contents
- Start with the decision and experimental unit
- Understand the adjustment without treating it as revenue
- Work through a small numerical example
- Keep the pre-period genuinely before treatment
- Handle new customers and weak predictors honestly
- Preserve the experiment decision rules
- EcomToolkit point of view
Start with the decision and experimental unit
Suppose a store tests a new replenishment reminder experience for signed-in customers. The primary outcome is revenue per assigned customer during a fixed follow-up window. Customers remain in the denominator even if they buy nothing. Randomization, outcome collection, and the analysis unit should agree on what one customer means.
Previous customer spending may explain some variation in later spending. CUPED adjusts the outcome using that pre-period signal so the treatment comparison can be more precise. Microsoft’s variance reduction explanation distinguishes improved estimator precision from changing the underlying behavior or removing inconvenient observations.
An order-level average is a different estimand. If the treatment affects whether someone places an order, analyzing only purchasers changes the population after assignment. Specify the commercial question first. For a purchase-frequency intervention, revenue per assigned customer may be more informative than revenue per completed order alone.

Understand the adjustment without treating it as revenue
In a simple one-covariate formulation, let Y be the experiment outcome and X the pre-period measure. The adjusted outcome is Y minus theta multiplied by X minus the overall pre-period mean. Under the standard setup, theta is chosen using the relationship between X and Y, commonly covariance divided by variance of X.
This produces an analysis variable, not a replacement financial ledger. An adjusted value can be negative even when recorded revenue is nonnegative. That does not mean the shopper returned more than they purchased. It means the statistical adjustment placed their result below the expected level associated with their historical signal.
The original CUPED paper provides the method and its assumptions. For implementation, use a reviewed statistical pipeline rather than copying a single formula into a spreadsheet and assuming the resulting standard errors are valid for every metric and assignment design.
| Quantity | Meaning in this example | Keep separate from |
|---|---|---|
| Y | Revenue in the experiment window | Pre-period spending |
| X | Revenue before assignment | Any behavior affected by treatment |
| Theta | Adjustment coefficient | A commercial uplift percentage |
| Adjusted Y | Statistical analysis outcome | Booked revenue |
| Difference between adjusted means | Estimated treatment contrast | A causal claim from nonrandom groups |
Work through a small numerical example
Assume the pre-period mean is £40 and a predetermined illustrative coefficient is 0.5. A shopper with £60 in pre-period revenue and £70 during the experiment has an adjusted outcome of £60: 70 minus 0.5 times 20. Another shopper with £20 previously and £30 during the experiment has an adjusted outcome of £40.
The calculation subtracts predictable baseline differences while retaining the randomized comparison. It should be applied consistently to both groups with a valid estimation procedure. Do not fit unrelated adjustments to whichever segment makes the treatment look strongest, then report the most favorable result as the primary analysis.
| Illustrative shopper | Pre-period X | Experiment Y | Adjustment | Adjusted Y |
|---|---|---|---|---|
| A | £60 | £70 | Subtract £10 | £60 |
| B | £20 | £30 | Add £10 | £40 |
| C | £40 | £50 | No change | £50 |
| D | £0 | £0 | Add £20 | £20 |
The fourth row demonstrates why adjusted revenue is not cash. A nonbuyer can have a positive adjusted value. Financial reporting must continue to use actual transactions. The adjusted metric exists to support the experiment estimate and its uncertainty, with the raw outcome retained alongside it.
In the idealized single-covariate case, a correlation of 0.6 corresponds to a residual variance fraction of 1 minus 0.6 squared, or 0.64. That is a 36% variance reduction under the model, while the corresponding standard-deviation multiplier is 0.8. It is not a universal 36% reduction in calendar duration.
Keep the pre-period genuinely before treatment
Freeze the pre-period boundary before assignment or first eligible exposure, according to the design. A “historical” feature recalculated after treatment begins can accidentally include treatment-affected behavior. That leakage undermines the interpretation of the adjustment even if the feature name still says previous revenue.
Document how late-arriving transactions and refunds are handled. If a historical period is revised after the experiment starts, decide whether the analysis uses the frozen snapshot or an explicitly versioned correction. The rule should apply consistently and should not depend on which variant benefits from the revision.
Identity joins require similar discipline. A customer record merged after exposure may change which pre-period transactions appear attached to the experiment unit. Preserve the assignment record and investigate ambiguous joins. The analytics quality framework explains the broader importance of reconciling measurement before interpreting outcomes.
The pre-period length is a modeling choice, not a guaranteed optimization. A longer window may capture more purchases but become less representative after a category change or seasonal shift. Evaluate predictive usefulness on historical data and record the selected window before reading the treatment result.

Handle new customers and weak predictors honestly
New customers may have no observed history. Missing history is not always equivalent to observed zero spending. A zero can mean a known eligible customer made no purchase; a missing value can mean the identity did not exist or could not be matched. Preserve that distinction in the design.
A practical approach can include a missing-history indicator or a prespecified model that handles incomplete covariates. The exact estimator needs statistical review. Do not silently drop new customers to improve the precision figure if the intended business decision applies to all assigned customers.
If the covariate has little predictive relationship with the outcome, there may be little useful variance reduction. Report coverage and realized precision rather than describing CUPED as an automatic shortcut. The Datadog CUPED documentation describes implementation considerations, but a tool’s support for the method is not evidence that your store has a useful pre-period predictor.
Separate returning-customer performance from all-customer applicability. A method that helps a repeat-purchase experiment may offer little benefit on a first-visit acquisition landing page. The commercial audience, identity coverage, and outcome sparsity determine whether the extra analytical complexity is justified.
Preserve the experiment decision rules
Variance reduction does not replace checking assignment balance, logging quality, exposure integrity, or sample-ratio mismatch. Use the sample-ratio mismatch guide before trusting either adjusted or unadjusted estimates. A more precise result from a broken assignment process remains a broken result.
Keep the planned stopping rule and guardrails. Revenue can improve while refund rates, customer complaints, or unsubscribes worsen. Report the treatment effect, interval, raw group outcomes, covariate coverage, and the analysis version together. If the adjusted and raw estimates disagree materially, investigate rather than selecting the preferred number.
Run an A/A validation or retrospective simulation using the actual assignment and data structure before relying on the method for launch decisions. Check interval behavior, missing-history handling, and sensitivity to unusually large purchasers. More resampling or more elaborate modeling cannot repair a feature that contains post-treatment information.
A useful analyst handoff includes the assignment key, frozen feature snapshot, outcome window, exclusion rules, and the exact query used to join them. A second person should be able to reconstruct both raw and adjusted group summaries without interpreting undocumented notebook state. Preserve the reviewed specification with the experiment so future teams can distinguish a genuine modeling improvement from an accidental change in population.
EcomToolkit point of view
CUPED is useful when it makes a well-designed experiment more informative about a clear business decision. Its value comes from disciplined data boundaries and transparent analysis, not a smaller p-value on demand. To assess whether your store has the necessary measurement foundation, request an ecommerce experimentation data review.