Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions content/collections/web_experiment/en/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,38 @@

URL redirects retain any query parameters on the original page URL. For example, you create a variant to redirect users from `https://example.com` to `https://example.com/get-started`. If a user clicks a link `https://example.com?utm_source=facebook`, Web Experiment redirects that user to `https://example.com/get-started?utm_source=facebook`.

{{partial:admonition type="note"}}
It's possible for the URL redirect test to have a [Sample Ratio Mismatch (SRM)](/docs/feature-experiment/troubleshooting/sample-ratio-mismatch). Redirect tests work by loading the redirected page, ideally as fast as possible. The sequence for this is:

**Control flow**
- Load control page HTML.
- Browser parses and loads dependencies (including the experiment script).
- Experiment script initializes, evaluates the user, and logs an impression if they're in control.

**Treatment flow**
- Load control page HTML.
- Browser parses and loads dependencies (including the experiment script).
- Experiment script evaluates the user → assigns them to treatment → triggers a redirect.
- Load treatment page HTML.
- Browser parses and loads dependencies (including the experiment script again).
- Experiment script initializes and logs the impression for treatment.

Because the treatment flow involves more steps before the impression is logged, users who bounce quickly (for example, after clicking an ad by mistake) are more likely to be counted in control than in treatment. This imbalance can show up as Sample Ratio Mismatch (SRM).

Check warning on line 50 in content/collections/web_experiment/en/actions.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Microsoft.Passive] 'be counted' looks like passive voice. Raw Output: {"message": "[Microsoft.Passive] 'be counted' looks like passive voice.", "location": {"path": "content/collections/web_experiment/en/actions.md", "range": {"start": {"line": 50, "column": 172}}}, "severity": "INFO"}

Check warning on line 50 in content/collections/web_experiment/en/actions.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Microsoft.Adverbs] Remove 'quickly' if it's not important to the meaning of the statement. Raw Output: {"message": "[Microsoft.Adverbs] Remove 'quickly' if it's not important to the meaning of the statement.", "location": {"path": "content/collections/web_experiment/en/actions.md", "range": {"start": {"line": 50, "column": 98}}}, "severity": "WARNING"}

Check warning on line 50 in content/collections/web_experiment/en/actions.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Microsoft.Passive] 'is logged' looks like passive voice. Raw Output: {"message": "[Microsoft.Passive] 'is logged' looks like passive voice.", "location": {"path": "content/collections/web_experiment/en/actions.md", "range": {"start": {"line": 50, "column": 70}}}, "severity": "INFO"}

Check warning on line 50 in content/collections/web_experiment/en/actions.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Microsoft.SentenceLength] Try to keep sentences short (< 30 words). Raw Output: {"message": "[Microsoft.SentenceLength] Try to keep sentences short (\u003c 30 words).", "location": {"path": "content/collections/web_experiment/en/actions.md", "range": {"start": {"line": 50, "column": 1}}}, "severity": "INFO"}

Researchers have observed similar effects: if treatment slows performance, more users may leave before logs are generated, leading to fewer recorded impressions. Conversely, faster performance can lead to more recorded users in treatment than in control.

Check warning on line 52 in content/collections/web_experiment/en/actions.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Microsoft.Passive] 'are generated' looks like passive voice. Raw Output: {"message": "[Microsoft.Passive] 'are generated' looks like passive voice.", "location": {"path": "content/collections/web_experiment/en/actions.md", "range": {"start": {"line": 52, "column": 109}}}, "severity": "INFO"}

**Further reading:**
* [Causes of SRM](https://www.lukasvermeer.nl/srm/docs/causes/)
* [Pitfalls in Metric Interpretation (KDD 2017)](https://exp-platform.com/Documents/2017-08%20KDDMetricInterpretationPitfalls.pdf)

Check warning on line 56 in content/collections/web_experiment/en/actions.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Microsoft.Acronyms] 'KDD' has no definition. Raw Output: {"message": "[Microsoft.Acronyms] 'KDD' has no definition.", "location": {"path": "content/collections/web_experiment/en/actions.md", "range": {"start": {"line": 56, "column": 39}}}, "severity": "INFO"}
* [Diagnosing SRM in Online Experiments (KDD 2019)](https://exp-platform.com/Documents/2019_KDDFabijanGupchupFuptaOmhoverVermeerDmitriev.pdf)

Check warning on line 57 in content/collections/web_experiment/en/actions.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Microsoft.Acronyms] 'KDD' has no definition. Raw Output: {"message": "[Microsoft.Acronyms] 'KDD' has no definition.", "location": {"path": "content/collections/web_experiment/en/actions.md", "range": {"start": {"line": 57, "column": 42}}}, "severity": "INFO"}

**What to do**

* **Reduce latency in evaluation**. The longer the delay before impressions are logged, the more pronounced the SRM effect.

Check warning on line 61 in content/collections/web_experiment/en/actions.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Microsoft.Passive] 'are logged' looks like passive voice. Raw Output: {"message": "[Microsoft.Passive] 'are logged' looks like passive voice.", "location": {"path": "content/collections/web_experiment/en/actions.md", "range": {"start": {"line": 61, "column": 77}}}, "severity": "INFO"}
* **Use local evaluation where possible**. For example, target only on browser properties instead of slower remote attributes like Country. This reduces the chance that users drop off before logging. Here’s a configuration example in Amplitude Experiment.

{{/partial:admonition}}

## Custom code

{{partial:admonition type="note"}}
Expand Down
Loading