Problem
Glovo shipped a new courier-ranking algorithm in one city, Constanta, to raise the share of slots booked by performant couriers. A plain before/after comparison showed the metric falling, which looks like harm but ignores market trends.
An A/B test was not possible. Splitting couriers inside the city makes one group affect the other. A switchback test needed app changes and was too heavy operationally. Comparing cities lacked power: too few cities.
Example from the article: the metric in Constanta fell from 40.3% before the change to 37.8% after it, while most neighboring cities trended down over the same period.
Solution in brief
Build a "fake Constanta" as a weighted average of untreated cities, with weights fitted so that it tracks the real city before the change. The gap between the real and fake city after the change is the estimated effect. Validate on held-out pre-change weeks, then test significance by treating each donor city as if it were the treated one.
Questions this case answers
- How to estimate the causal effect of a change applied to a single unit when randomization is impossible and few comparable units exist
- How to validate a counterfactual built from untreated units and test its significance with one treated unit
- How to estimate the effect of a change rolled out in one city when an A/B test is impossible?
- How to build a counterfactual for a treated city from other cities?
Tools and methods
- Synthetic control — weighted mix of untreated cities as the counterfactual
- Least squares fit, weights summing to 1 — finds the weights
- Train/test split and time series cross-validation — pick the donor pool
- Fisher's exact test (permutation over cities) — p-value with one treated unit
- scikit-learn — hand-built regression instead of a packaged library
Google or a one-time email code. No password.