Sample Ratio Mismatch (SRM) is the most destructive silent failure in A/B testing. When an SRM occurs, your observed visitor distribution diverges from your intended allocation. You configured a 50/50 traffic split, but Optimizely records 53,000 visitors in control and 47,000 in variation. That difference is not harmless statistical noise. It is an algorithmic alarm signal indicating that the foundational assumption of randomized controlled trials has shattered.
At 365Finds, our stance is uncompromising: if an experiment fails an SRM check, the experiment is dead. Any reported conversion lift, $p$-value, or revenue metric is contaminated. We have seen growth teams celebrate a "+14% checkout conversion" on an SRM-flagged test, only to discover post-launch that the variation crashed on mobile Safari, systematically shedding low-converting mobile shoppers and leaving behind an artificially inflated pool of desktop buyers.
Treating SRM as an afterthought is how growth programs destroy executive credibility. Here is how Optimizely handles SRM detection, how to verify it independently, and how to track down the root cause.
How Optimizely Detects SRM
Optimizely operates differently from legacy testing suites that run a single, static Chi-Square test at the conclusion of an experiment. Instead, Optimizely embeds continuous monitoring directly into its Stats Engine.
1. Sequential SRM Testing (SSRM)
Optimizely uses a Sequential Sample Ratio Mismatch (SSRM) algorithm (ssrm-test). Rather than waiting for a test to reach a pre-scheduled end date, SSRM evaluates incoming visitor assignments on an ongoing basis. It accounts for both:
- Severity: The absolute magnitude of the deviation from the expected traffic split.
- Consistency: The persistence of the imbalance across sequential visitor arrivals.
To prevent premature false alarms caused by expected early-stage binomial fluctuations, Optimizely typically suppresses SRM health evaluations until the experiment crosses a minimum volume threshold of 1,000 visitors.
2. First Decisions as the Evaluation Unit
Optimizely evaluates SRM based on first decisions—the initial bucketing event for a visitor or session. This design isolates assignment anomalies from downstream conversion drops. If 10,000 users arrive and Optimizely logs 6,000 first decisions in Variation A and 4,000 in Variation B, the system flags an "SRM Detected" warning banner on the Results page under Experiment Health.
Why Relying Solely on UI Banners Is Risky
At 365Finds, we do not recommend relying exclusively on Optimizely's UI status indicators for enterprise decision-making.
Optimizely’s automated flag is designed to minimize false positives, which means subtle, low-grade SRMs (such as a 51.5/48.5 split on 100,000 visitors) can sometimes hover just below the alert threshold while still distorting micro-metrics. Furthermore, teams ingesting raw Optimizely event streams into external data warehouses—such as Snowflake, Databricks, or Google BigQuery—must run independent validation checks before reporting business conclusions.
The Independent Goodness-of-Fit Test
Growth data teams should implement an automated Chi-Square ($\chi^2$) goodness-of-fit test on unique randomized units:
$$\chi^2 = \sum \frac{(O_i - E_i)^2}{E_i}$$
Where $O_i$ is the observed count for variation $i$, and $E_i$ is the expected count based on your traffic allocation.
| Traffic Metric | What to Count | What to Avoid |
|---|---|---|
| Unit of Randomization | Unique User ID or Optimizely Visitor ID (optimizelyEndUserId) | Total sessions; raw pageviews; repeated event hits |
| P-Value Threshold | $p < 0.001$ (conservative) or $p < 0.01$ (standard) | Using loose thresholds like $p < 0.10$ that trigger false panics |
| Evaluation Scope | First impression beacon per unique visitor | Post-conversion pageviews; downstream goal triggers |
Counting sessions instead of unique visitors is the number one self-inflicted mistake we observe in custom analytics pipelines. If a power user in the treatment variant logs 40 sessions while control users log an average of 1.2, session-level counts will trigger a phantom SRM where none exists at the visitor level.
The Optimizely SRM Diagnostic Taxonomy
When Optimizely flags an SRM or your warehouse pipeline fails a Chi-Square check, do not guess. Work systematically through the failure taxonomy developed by experimentation researchers:
SRM Root Causes
├── 1. Assignment & Configuration (Setup Layer)
│ ├── Mid-flight traffic allocation adjustments
│ ├── Late audience / condition evaluation
│ └── Cookie truncation & Safari ITP resets
├── 2. Client-Side Execution (Rendering Layer)
│ ├── Redirect test drop-off (The Classic Trap)
│ ├── Uncaught JavaScript exceptions in variant code
│ └── Page latency & snippet execution timing
└── 3. Telemetry & Environment (Data Layer)
├── Selective bot & web scraper filtering
├── Ad blocker pattern matching on variant URLs
└── CDN & edge caching collisions
1. The Setup & Assignment Layer
- Mid-Flight Allocation Changes: If you launch a test at a 10/10/80 allocation (Control / Variant / Holdout) to verify stability and later adjust it to 50/50, historical bucketing breaks. Optimizely uses deterministic hashing (MurmurHash) on user IDs. Changing weights mid-stream alters the assignment math without wiping historical visitor associations, creating severe cumulative ratio mismatches.
- Post-Bucketing Audience Filtering: If custom audience rules evaluate asynchronous attributes (like a delayed API call returning user tier) after the bucketing decision is made, visitors get bucketed into the experiment but disqualified before impression tracking fires.
2. The Client-Side Execution Layer
- The Redirect Test Drop-Off: This is the single most common cause of SRM in Optimizely Web Experimentation. In a redirect test, Control stays on
/pricing, while Variation redirects to/pricing-v2. If the redirect occurs via JavaScript on the client side, visitors on slow mobile connections often hit the back button, close the tab, or navigate away before the variation page completes loading and executes the Optimizely tracking beacon. The user is logged in Control, but vanished from Variation. - Uncaught JavaScript Exceptions: If Variation includes a script targeting an element that does not exist on certain older browsers (e.g., Safari 14 or specific Android WebViews), the script crashes. If the error blocks execution before the
optimizely.push("activate")or equivalent impression call completes, those devices selectively drop out of the treatment group. - Snippet Loading Latency: When the Optimizely snippet is deployed asynchronously or loaded late in the
<head>, heavy variations create visual flicker or delayed rendering. Impatient users abandon the slower variation at higher rates before tracking events complete.
3. The Telemetry & Ingestion Layer
- Bot and Scraper Asymmetry: Automated crawlers often do not execute client-side JavaScript or execute it inconsistently. If your Variation alters the DOM structure in a way that triggers headless browser bot defenses or anti-scraping WAF rules, bots will appear disproportionately in Control.
- Ad Blocker Rules: If your variation URL contains strings like
/promotions/,/affiliate/, or/test-banner/, browser extensions like uBlock Origin or Brave Shields will block network requests to Optimizely's event endpoint (logx.optimizely.com), dropping telemetry for that variation alone.
Step-by-Step Troubleshooting Runbook
Follow this step-by-step sequence the moment an SRM alert appears.
Step 1: Freeze Decision-Making Immediately
Do not conclude the test. Do not declare a winner. Under no circumstances should product managers ship features based on conversion lifts observed during an active SRM. Document the current visitor counts, status flags, and timestamps.
Step 2: Analyze the Anomaly Timeline
Check when the imbalance started:
- Imbalance from Day 1: Indicates a fundamental flaw in experiment setup, audience targeting logic, redirect execution, or SDK integration.
- Imbalance appearing suddenly on Day 12: Correlates with an external change. Review deployment logs, website releases, tag manager modifications, or CDN configuration updates pushed on that exact date.
Step 3: Dimensional Slicing
Slice your raw experiment data by secondary dimensions to locate where the traffic deviates from the expected ratio:
SELECT
browser_name,
device_category,
COUNT(DISTINCT CASE WHEN variation = 'control' THEN user_id END) AS control_users,
COUNT(DISTINCT CASE WHEN variation = 'treatment' THEN user_id END) AS treatment_users,
ROUND(COUNT(DISTINCT CASE WHEN variation = 'treatment' THEN user_id END) * 1.0 /
NULLIF(COUNT(DISTINCT CASE WHEN variation = 'control' THEN user_id END), 0), 3) AS ratio
FROM optimizely_experiment_events
WHERE experiment_id = 'EXP_10492'
GROUP BY 1, 2
ORDER BY 1, 2;
Look for extreme deviations:
- Is the ratio balanced on Chrome Desktop (1.00) but severely skewed on Mobile Safari (0.72)? You are likely dealing with client-side JavaScript syntax errors or ITP cookie truncation.
- Is the imbalance confined to a single geographic territory? Inspect regional CDN edge-caching rules.
Step 4: Audit Network Payloads in DevTools
Open browser developer tools, enable network throttling (Fast 3G), and clear site storage.
- Load the experiment URL for the Control group. Verify that the event payload (
https://logx.optimizely.com/v1/events) fires immediately upon page initialization. - Force the Variation URL via Optimizely preview mode or query parameters. Check if the event beacon fires before any redirect or asynchronous DOM manipulation.
- Check the browser console for red uncaught exceptions or blocked resource requests.
Step 5: Fix and Relaunch from Zero
Once you identify the root cause—such as replacing a client-side JavaScript redirect with a server-side redirect or fixing an uncaught exception—do not continue the running experiment.
Do not attempt to splice data collected before the fix with data collected after the fix. Reset visitor cookies, update the experiment version, and launch a clean test.
At 365Finds, we emphasize that in controlled experimentation, clean data is not a luxury; it is the entire product. When the sample ratio breaks, the science breaks with it.