Detecting and Diagnosing Sample Ratio Mismatches in Mobile App Telemetry
Why subtle allocation imbalances between test variants corrupt experiment validity, how to compute chi-square goodness of fit, and four common mobile client mechanisms that trigger silent SRM.
When running a 50/50 randomized controlled trial in a mobile application, seeing 50,420 users in Control and 49,580 in Variant B might appear unremarkable at a casual glance. However, calculating the Pearson chi-square statistic reveals a p-value of 0.0078—well below standard significance thresholds. This deviation indicates a Sample Ratio Mismatch (SRM).
In experimental measurement, an unaddressed SRM invalidates any subsequent statistical comparison. This article explores why SRMs happen, how to detect them across sub-cohorts, and how to remediate the underlying mobile client architectures.
The Mathematics of SRM Detection
The standard test for SRM is the Pearson (\chi^2) goodness-of-fit test:
[ \chi^2 = \sum_{i=1}^{k} \frac{(O_i - E_i)^2}{E_i} ]
For a two-arm test with sample sizes (N_1) and (N_2) and expected equal proportion (p = 0.5):
[ \chi^2 = \frac{(N_1 - N/2)^2}{N/2} + \frac{(N_2 - N/2)^2}{N/2} ]
Where (N = N_1 + N_2). For 1 degree of freedom, a (\chi^2) value exceeding 6.635 corresponds to (p < 0.01), and exceeding 10.828 corresponds to (p < 0.001).
Four Common Root Causes in Mobile Applications
Through dozens of client telemetry audits at Flow Harbor Point, we have categorized the primary mechanisms producing false sample splits:
1. Variant-Specific UI Thread Crashes
If Variant B contains a layout rendering bug or an unhandled null pointer exception on a specific device architecture (e.g. Android 12 on MediaTek chipsets), the app may crash immediately before the analytics logging dispatch call executes. The affected users are dropped from Variant B, artificially making Variant B look like it has higher conversion among the surviving devices.
2. Network Latency & Redirect Penalties
When a variant involves fetching a dynamic configuration or heavy asset payload over the network before showing a screen, users on slow 3G or unstable connections may drop off or navigate away before the exposure event registers.
3. Asynchronous Feature Flag Resolution
If the feature flag client evaluates asynchronously with a default fallback to Control, users with high disk I/O latency or slow cold start times are assigned to Control for their first screen view, while faster devices receive Variant B.
4. Anonymous to Authenticated Identity Merges
When user assignment keys transition from anonymous device UUIDs to authenticated user IDs upon login, users who log in during the test session can be double-counted or reassigned, distorting bucket counts.
Best Practice Diagnostic Workflow
1. Calculate overall Chi-Square test on all assigned entities.
2. If p < 0.01, slice dataset across:
- Operating system version
- App release build number
- Connection type (Wi-Fi vs Cellular)
- Country / region
3. Inspect client crash and exception logs correlated with assignment timestamps.
4. Verify exposure event trigger location in the client view hierarchy.
When an SRM is confirmed, product teams must avoid the temptation to “normalize” or re-weight conversion rates without isolating the missing cohort. In the vast majority of cases, the experiment must be paused, the tracking flaw fixed, and the test re-launched with clean telemetry.
Have questions regarding this statistical method?
Our practitioners review experiment designs and data streams daily.