Skip to content

docs: add Experimentation guides#7993

Open
Zaimwa9 wants to merge 5 commits into
mainfrom
docs/experimentation-guides
Open

docs: add Experimentation guides#7993
Zaimwa9 wants to merge 5 commits into
mainfrom
docs/experimentation-guides

Conversation

@Zaimwa9

@Zaimwa9 Zaimwa9 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Documents the Experimentation feature end to end, as a new top-level sidebar category on docs.flagsmith.com:

  • Experimentation (Beta) category covering the full lifecycle: Connect a Warehouse, Create Metrics,
    Create an Experiment, Run an Experiment (JavaScript and Python instrumentation), and Analyse an Experiment.
  • Statistics Glossary: the existing Experiment Statistics page, moved into the category and renamed.
  • Example: PayPal Button: an end-to-end walkthrough of a real experiment, modernised from the old
    A/B testing tutorial (branches on variation names via useExperiment).
  • UI screenshots for the warehouse tab, the create wizard, and the results page.

How did you test this code?

  • npm run build in docs/ passes with no broken links in the new pages.
  • All pages, images, cross-links and the sidebar order verified on the local dev server.
  • Prettier clean (make lint).

@Zaimwa9 Zaimwa9 requested a review from a team as a code owner July 13, 2026 09:36
@Zaimwa9 Zaimwa9 requested review from Holmus and removed request for a team July 13, 2026 09:36
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 13, 2026 9:40am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ignored Ignored Jul 13, 2026 9:40am
flagsmith-frontend-staging Ignored Ignored Jul 13, 2026 9:40am

Request Review

@github-actions github-actions Bot added the docs Documentation updates label Jul 13, 2026
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds an Experimentation documentation section covering warehouse connections, metrics, experiment creation, event instrumentation, PayPal testing, result analysis, and anonymous identity handling. It also creates category navigation, updates the statistics glossary, reformats the existing A/B testing guide, and adds redirects for renamed documentation pages.

Estimated code review effort: 3 (Moderate) | ~20 minutes


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 52af566f-521f-4125-bce3-1858e21df39d

📥 Commits

Reviewing files that changed from the base of the PR and between 1c73453 and 6ec2a1c.

⛔ Files ignored due to path filters (5)
  • docs/static/img/experimentation/create-experiment-rollout.png is excluded by !**/*.png
  • docs/static/img/experimentation/create-experiment-setup.png is excluded by !**/*.png
  • docs/static/img/experimentation/experiment-results-analysis.png is excluded by !**/*.png
  • docs/static/img/experimentation/experiment-results-overview.png is excluded by !**/*.png
  • docs/static/img/experimentation/warehouse-tab.png is excluded by !**/*.png
📒 Files selected for processing (11)
  • docs/docs/experimentation-ab-testing.md
  • docs/docs/experimentation/_category_.json
  • docs/docs/experimentation/analyse-an-experiment.md
  • docs/docs/experimentation/connect-a-warehouse.md
  • docs/docs/experimentation/create-an-experiment.md
  • docs/docs/experimentation/create-metrics.md
  • docs/docs/experimentation/example-paypal-button.md
  • docs/docs/experimentation/index.md
  • docs/docs/experimentation/run-an-experiment.mdx
  • docs/docs/experimentation/statistics.md
  • docs/vercel.json

Comment on lines 48 to +50
## Scenario - Testing a new Paypal button

For this example, lets assume we have an app that currently accepts credit card payments only. We have a hunch that we are losing out on potential customers that would like to pay with PayPal. We're going to test whether adding PayPal to the payment options increases our checkout rate.
For this example, lets assume we have an app that currently accepts credit card payments only. We have a hunch that we

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use the official PayPal spelling and correct the apostrophe.

Replace “Paypal” with “PayPal” throughout this section and change “lets assume” to “let’s assume”.

Also applies to: 55-60, 72-73

🧰 Tools
🪛 LanguageTool

[uncategorized] ~48-~48: The official name of this payment provider is spelled with two capital “P”.
Context: ...smith SDK. ## Scenario - Testing a new Paypal button For this example, lets assume w...

(PAYPAL)


[uncategorized] ~50-~50: It seems likely that a singular genitive (’s) apostrophe is missing.
Context: ... a new Paypal button For this example, lets assume we have an app that currently ac...

(AI_HYDRA_LEO_APOSTROPHE_S_XS)

Source: Linters/SAST tools

Comment on lines +54 to +80
We have a lot of users on our platform, so we don't want to run this test against our entire user-base. We want 90% of
our users to be excluded from the test. Then for our test, 5% of our users will see the new Paypal button, and the
remaining 5% will not see it. So we will have 3 buckets:

1. Excluded (Control) Users
2. Paypal test button users
3. Test users that don't see the Paypal button

Because Flagsmith flags can contain both boolean states as well as multivariate flag values, we can make use of both. We will use the boolean flag state to control whether to run the test. Then, if the flag is `enabled`, check the multivariate value. In this example, we will only show the PayPal button if the value is set to `show`.
Because Flagsmith flags can contain both boolean states as well as multivariate flag values, we can make use of both. We
will use the boolean flag state to control whether to run the test. Then, if the flag is `enabled`, check the
multivariate value. In this example, we will only show the PayPal button if the value is set to `show`.

## Steps

1. Create a new [multivariate flag](/managing-flags/core-management) that will control which of the 3 buckets the user is put into. We'll call this flag `paypal_button_test`. We will provide 3 variate options:
1. Create a new [multivariate flag](/managing-flags/core-management) that will control which of the 3 buckets the user
is put into. We'll call this flag `paypal_button_test`. We will provide 3 variate options:

1. Control - 90% of users
2. Paypal button - 5% of users
3. Test users that don't see the Paypal button - 5% of users

2. In our app, we want to [identify](/flagsmith-concepts/identities) each user before they start the checkout process. All Flagsmith multivariate flags need us to identify the user, so we can bucket them in a reproducible manner.
3. When we get to the checkout page, check the `value` of the `paypal_button_test` flag for that user. If it evaluates to `show`, show the PayPal payment button. Otherwise, don't show the button.
4. Send an event message to the analytics platform, adding the name/value pair of `paypal_button_test` and the value of the flag; in this case it would be one of either `control`, `show` or `hide`.
2. In our app, we want to [identify](/flagsmith-concepts/identities) each user before they start the checkout process.
All Flagsmith multivariate flags need us to identify the user, so we can bucket them in a reproducible manner.
3. When we get to the checkout page, check the `value` of the `paypal_button_test` flag for that user. If it evaluates
to `show`, show the PayPal payment button. Otherwise, don't show the button.
4. Send an event message to the analytics platform, adding the name/value pair of `paypal_button_test` and the value of
the flag; in this case it would be one of either `control`, `show` or `hide`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make the rollout model consistent with the documented buckets.

The guide says 90% of users are excluded and that the boolean state gates the test, but the next steps define one multivariate flag with control/show/hide weights of 90/5/5 and then assume every user produces one of those values. The required targeting or rollout configuration for the 90% cohort is never specified.

Either document control as a 90% control variant and remove the “excluded”/separate-gate wording, or define a 10% rollout and explain the disabled/default path separately.

🧰 Tools
🪛 LanguageTool

[style] ~54-~54: Consider using a synonym to be more concise.
Context: ...s increases our checkout rate. We have a lot of users on our platform, so we don't want...

(A_LOT_OF)


[style] ~54-~54: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...this test against our entire user-base. We want 90% of our users to be excluded fr...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[uncategorized] ~55-~55: The official name of this payment provider is spelled with two capital “P”.
Context: ... test, 5% of our users will see the new Paypal button, and the remaining 5% will not s...

(PAYPAL)


[uncategorized] ~59-~59: The official name of this payment provider is spelled with two capital “P”.
Context: ...uckets: 1. Excluded (Control) Users 2. Paypal test button users 3. Test users that do...

(PAYPAL)


[uncategorized] ~60-~60: The official name of this payment provider is spelled with two capital “P”.
Context: ... users 3. Test users that don't see the Paypal button Because Flagsmith flags can con...

(PAYPAL)


[grammar] ~62-~62: Probable usage error. Use “and” after ‘both’.
Context: ...h flags can contain both boolean states as well as multivariate flag values, we can make u...

(BOTH_AS_WELL_AS)


[uncategorized] ~69-~69: The official name of this payment provider is spelled with two capital “P”.
Context: ...er is put into. We'll call this flag paypal_button_test. We will provide 3 variate...

(PAYPAL)


[uncategorized] ~72-~72: The official name of this payment provider is spelled with two capital “P”.
Context: ...ns: 1. Control - 90% of users 2. Paypal button - 5% of users 3. Test users t...

(PAYPAL)


[uncategorized] ~73-~73: The official name of this payment provider is spelled with two capital “P”.
Context: ...ers 3. Test users that don't see the Paypal button - 5% of users 2. In our app, we...

(PAYPAL)


[uncategorized] ~77-~77: The official name of this payment provider is spelled with two capital “P”.
Context: ...checkout page, check the value of the paypal_button_test flag for that user. If it ...

(PAYPAL)


[grammar] ~79-~79: An article may be missing.
Context: ...alytics platform, adding the name/value pair of paypal_button_test and the value of ...

(BUNCH_OF)


[uncategorized] ~79-~79: The official name of this payment provider is spelled with two capital “P”.
Context: ...platform, adding the name/value pair of paypal_button_test and the value of the fl...

(PAYPAL)

Identities that were served more than one variation are quarantined and shown as excluded. A small number is normal; a
growing one means users are slipping between variations.

<!-- Screenshot: exposures panel with enrolment chart -->

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Replace the screenshot placeholder with the actual Exposures image.

This HTML comment renders nothing, leaving the Exposures section without the promised visual. Add the image with meaningful alt text, or remove the placeholder if no screenshot is intended.

Comment on lines +40 to +41
- **Variation split**: how identities _inside_ the rollout are distributed across control and the variations. Weights
must sum to 100, and control takes whatever the variations don't. Use **Split evenly** for an equal distribution.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== Relevant file excerpt ==\n'
sed -n '1,120p' docs/docs/experimentation/create-an-experiment.md | cat -n

printf '\n== Search for allocation / split wording across experimentation docs ==\n'
rg -n --hidden -S "Variation split|Split evenly|control takes whatever|weights must sum to 100|rollout can still be edited|locked during execution|variation.*control|control.*variation" docs/docs

printf '\n== Open the referenced related doc excerpt if present ==\n'
if [ -f docs/docs/experimentation/run-an-experiment.mdx ]; then
  sed -n '80,130p' docs/docs/experimentation/run-an-experiment.mdx | cat -n
fi

Repository: Flagsmith/flagsmith

Length of output: 6399


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== Search for experiment rollout / split implementation references ==\n'
rg -n --hidden -S "split evenly|variation split|rollout.*edit|edit.*rollout|locked while the experiment is running|cannot be edited|control takes whatever|weights must sum to 100" .

printf '\n== Search for API/serializer fields that suggest exact semantics ==\n'
rg -n --hidden -S "rollout|control|variation.*weight|weights.*100|experiment.*weight|split" backend web docs -g '!**/node_modules/**' -g '!**/dist/**' -g '!**/build/**'

Repository: Flagsmith/flagsmith

Length of output: 50375


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== Rollout step wording ==\n'
sed -n '1,120p' frontend/web/components/experiments/steps/RolloutStep.tsx | cat -n

printf '\n== Split editor shape ==\n'
sed -n '1,220p' frontend/web/components/experiments/RolloutSplitEditor/RolloutSplitEditor.tsx | cat -n

printf '\n== Example experiment wording ==\n'
sed -n '30,50p' docs/docs/experimentation/example-paypal-button.md | cat -n

Repository: Flagsmith/flagsmith

Length of output: 8566


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '1,220p' frontend/web/components/experiments/rollout.ts | cat -n

Repository: Flagsmith/flagsmith

Length of output: 4446


Make the split wording explicit. The entered weights are for the variations only; control is the derived remainder. Rephrase this so it’s clear that the variation weights do not need to total 100, and that control fills whatever is left.


:::caution

While an experiment is running, its flag is locked and cannot be edited.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Clarify which parts of the flag are locked.

This says the flag cannot be edited while running, while docs/docs/experimentation/run-an-experiment.mdx line 100 says the rollout can be edited from the experiment page. State explicitly that flag configuration/variations are locked but the experiment rollout remains editable, if that is the intended behaviour.

Comment on lines +81 to +82
On the experiment page, check the **Exposures** panel: enrolment should track about 10% of checkout traffic, split
50/50. Then watch the results as conversions arrive; see

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Measure rollout against identities, not raw traffic.

The setup page defines rollout as a percentage of identities, and exposures are deduplicated per identity. Therefore, 10% of identities will not necessarily equal 10% of checkout requests. Reword this as approximately 10% of eligible identities/exposures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant