|
| 1 | +--- |
| 2 | +id: experiments |
| 3 | +title: Experiments |
| 4 | +slug: /workflow/experiments |
| 5 | +--- |
| 6 | + |
| 7 | +# Designing Experiments |
| 8 | + |
| 9 | +:::tip |
| 10 | +Need help designing your experiment? |
| 11 | +Reach out in [`#ask-experimenter`](https://mozilla.slack.com/archives/CF94YGE03) on Slack or attend an [office hours session](https://mozilla-hub.atlassian.net/wiki/spaces/DATA/pages/6849684/Office+Hours). |
| 12 | +::: |
| 13 | + |
| 14 | +An experiment is a controlled test that measures the impact of a change by comparing two or more groups of users. Unlike [rollouts](/advanced/rollouts) (which deliver features) or [Firefox Labs](/workflow/firefox-labs) (which gather qualitative feedback), experiments are designed to produce **statistically significant, quantitative results** — they tell you *whether* and *how much* a change affects user behavior. |
| 15 | + |
| 16 | +## When to use an experiment |
| 17 | + |
| 18 | +- You want to **measure the causal impact** of a feature or change on specific metrics. |
| 19 | +- You need to **compare multiple approaches** (A/B or A/B/C testing) to decide which one to ship. |
| 20 | +- You want **data science support** with statistical analysis and a results dashboard. |
| 21 | +- You need to make a **data-informed decision** before committing to a broader rollout. |
| 22 | + |
| 23 | +## When not to use an experiment |
| 24 | + |
| 25 | +- **Use a [rollout](/advanced/rollouts) instead** if you've already decided to ship a feature and just need to deliver it incrementally to manage risk. Rollouts don't have a control group or produce analysis results. |
| 26 | +- **Use [Firefox Labs](/workflow/firefox-labs) instead** if the feature is early-stage and you want qualitative feedback from opt-in early adopters before it's ready for a broader audience. |
| 27 | + |
| 28 | +## How experiments work |
| 29 | + |
| 30 | +### Experiment lifecycle |
| 31 | + |
| 32 | +1. **Design** — Define your hypothesis, metrics, and audience |
| 33 | +2. **Configure** — Set up the experiment in Experimenter with branches, feature configuration, and targeting |
| 34 | +3. **Review** — Submit for review and approval |
| 35 | +4. **Live (Enrolling)** — Users matching your targeting criteria are randomly assigned to branches |
| 36 | +5. **Live (Observation)** — Enrollment closes and you wait for data to accumulate |
| 37 | +6. **Complete** — End the experiment |
| 38 | +7. **Analysis** — Statistical analysis runs automatically and results appear in Experimenter |
| 39 | + |
| 40 | +### Key concepts |
| 41 | + |
| 42 | +- **Branches** — Each experiment has at least two branches: a **control** (unchanged experience) and one or more **treatments** (the changes you're testing). Users are randomly assigned to a branch. |
| 43 | +- **Enrollment period** — The window during which new users can be assigned to the experiment. Defaults to one week, to capture a balanced sample across all days of the week. |
| 44 | +- **Observation period** — After enrollment closes, the period during which you collect data. Defaults to three weeks, for a total experiment duration of four weeks. |
| 45 | +- **Sizing** — How many users you need in each branch to detect a meaningful difference. Work with your data scientist to determine this. |
| 46 | + |
| 47 | +## Designing your experiment |
| 48 | + |
| 49 | +### 1. Start with a hypothesis |
| 50 | + |
| 51 | +The best experiments start with a clear **question** you want answered and a **hypothesis** about what you expect to happen. A good hypothesis takes the form: |
| 52 | + |
| 53 | +> *If we [make this change] for [specific users], then we will see [outcome].* |
| 54 | +> |
| 55 | +> *We believe this because we have observed [observations] through [data source, user research, surveys, previous experiments, etc.].* |
| 56 | +
|
| 57 | +For example: *"If we move the bookmark button to the toolbar, we expect to see an increase in bookmark usage. We believe this because user research shows users have difficulty finding the current bookmark action."* |
| 58 | + |
| 59 | +This gives you a testable prediction, a clear metric to measure, and a basis for deciding what to do with the results. If you don't have a specific question an experiment can answer, consider whether user research, market research, or a [Firefox Labs](/workflow/firefox-labs) experience might be a better fit. |
| 60 | + |
| 61 | +### 2. Define success metrics |
| 62 | + |
| 63 | +Before you build anything, decide how you'll know if your hypothesis is correct: |
| 64 | + |
| 65 | +- **Primary outcomes** — The key outcomes you're trying to move (e.g., bookmark usage, engagement, retention). You can select up to **two** primary outcomes per experiment. |
| 66 | +- **Secondary outcomes** — Additional outcomes you want to observe. These don't have a limit but can't overlap with primary outcomes. |
| 67 | +- **Guardrail metrics** — Metrics you don't want to regress (e.g., DAU, search count, ad clicks). These are [automatically included](https://experimenter.info/deep-dives/jetstream/metrics#how-do-i-add-a-metric-to-my-experiment) in analysis. |
| 68 | +- **Feature-specific metrics** — Specific interactions you want to observe. Link to the relevant telemetry probes in the [Glean Dictionary](https://dictionary.telemetry.mozilla.org/). |
| 69 | +- **Segments** — Do you need to break results down by user type (new vs. existing), locale, or geography? Plan this upfront. |
| 70 | + |
| 71 | +### 3. Design your branches |
| 72 | + |
| 73 | +Every experiment needs at least two branches: |
| 74 | + |
| 75 | +- **Control** — The current, unchanged experience. This is what treatments are compared against. |
| 76 | +- **Treatment(s)** — The change(s) you're testing. You can have multiple treatments (A/B/C) if you want to compare several approaches. |
| 77 | + |
| 78 | +For each branch, document: |
| 79 | +- What the user will experience |
| 80 | +- Screenshots or mockups (if applicable) |
| 81 | +- Whether the content needs to be [localized](/workflow/localization) |
| 82 | +- How to trigger/see the change (so it can be QA'd) |
| 83 | + |
| 84 | +### 4. Consider your targeting |
| 85 | + |
| 86 | +Think about who should (and shouldn't) be in this experiment: |
| 87 | + |
| 88 | +| Consideration | Questions to answer | |
| 89 | +| :--- | :--- | |
| 90 | +| **Application & channel** | Desktop? Mobile? Which channel? Avoid targeting multiple channels in the same experiment — each channel has different population sizes and user behavior, which can produce misleading results. | |
| 91 | +| **Version** | What's the minimum Firefox version where the code and telemetry landed? | |
| 92 | +| **Locales & countries** | Does the experiment involve user-facing text that needs translation? | |
| 93 | +| **Advanced targeting** | Do you need to target specific user groups? New users only? Users with a specific preference set? Specific operating systems? | |
| 94 | +| **Exposure conditions** | Does the user need to do something specific to encounter the change (e.g., open a PDF, use accessibility features)? This affects sizing. | |
| 95 | +| **Exclusions** | Should users in other active experiments or rollouts be excluded? | |
| 96 | +| **Sticky enrollment** | By default, users who no longer match targeting criteria will be unenrolled. Enable sticky enrollment if you want users to stay in the experiment even if their targeting attributes change (e.g., locale, version). | |
| 97 | +| **First-run experiments** | Targeting brand-new profiles? Mark the experiment as a first-run experiment and set the proposed release date to align with the Firefox version you're targeting. | |
| 98 | + |
| 99 | +### 5. Create an experiment brief |
| 100 | + |
| 101 | +Bring all of the above together in an [experiment brief](https://docs.google.com/document/d/1_bWn_1y5x1zf6zl7Loj4O1qKnVdxzIMXOawIpf32CsM/edit?usp=sharing). The brief is the single document that captures your hypothesis, success metrics, branch designs, targeting, and risks. It's also where you'll record results and next steps when the experiment completes. |
| 102 | + |
| 103 | +### 6. File a data science ticket |
| 104 | + |
| 105 | +File a [Data Org (DO) Jira ticket](https://mozilla-hub.atlassian.net/jira/software/c/projects/DO/issues/) (click *Create* in the header of the page) so a data scientist can help you with experiment sizing, metric selection, and analysis planning. |
| 106 | + |
| 107 | +### 7. Attend office hours |
| 108 | + |
| 109 | +Come to data science [office hours](https://mozilla-hub.atlassian.net/wiki/spaces/DATA/pages/6849684/Office+Hours) to design and size your experiment. There are several sessions available depending on your needs and where you are in the process. |
| 110 | + |
| 111 | +:::note |
| 112 | +If your experiment includes any in-product messaging, get a [message consult](https://mozilla-hub.atlassian.net/wiki/spaces/FIREFOX/pages/208308555/Message+Consult+Creation) and file an [FXE ticket](https://mozilla-hub.atlassian.net/jira/software/c/projects/FXE/boards/543). |
| 113 | +::: |
| 114 | + |
| 115 | +## Build and de-risk |
| 116 | + |
| 117 | +Once your design is validated: |
| 118 | + |
| 119 | +1. **Enable your feature for experimentation** using the [Nimbus feature API](/technical-reference/feature-definition). If your feature supports it, add an [exposure event](/advanced/feature-variables#recording-exposure-events) so analysis can distinguish users who actually encountered the change from those who were enrolled but never saw it. |
| 120 | +2. **Write your experiment** in [Experimenter](https://experimenter.services.mozilla.com/nimbus/) and link to your experiment brief. |
| 121 | +3. **QA your experiment** by putting it into [Preview](/workflow/testing) and either self-testing or filing a [QA Jira ticket](https://mozilla-hub.atlassian.net/secure/CreateIssueDetails!init.jspa?pid=10212&issuetype=11290). |
| 122 | +4. **Review risks** — experiments make remote changes to the experience of live users, often millions of people. Experimenter will ask you to assess risk in several categories: brand risk, messaging risk, partner-related risk, revenue impact, and AI/ML risk. Review and mitigate [risks](/workflow/risk-mitigation) before you launch. |
| 123 | + |
| 124 | +## Launch, monitor, learn |
| 125 | + |
| 126 | +1. **Add sizing** information to your experiment if you haven't already. |
| 127 | +2. **Launch** by clicking [Launch](https://experimenter.info/launching) and requesting a reviewer in [`#ask-experimenter`](https://mozilla.slack.com/archives/CF94YGE03). |
| 128 | +3. **Monitor** using [Live Monitoring](/workflow/monitoring) to verify your experiment is enrolling well. Check that you've hit your expected enrollment target before the enrollment period ends. |
| 129 | +4. **Wait for results** — Analysis begins automatically about a week after enrollment ends. Results will appear on the experiment's page in Experimenter with both overall and weekly breakdowns. |
| 130 | +5. **Record results** — Log your results and next steps in the experiment brief: |
| 131 | + - Was your hypothesis correct? |
| 132 | + - Were any changes statistically significant? |
| 133 | + - **Ship it?** If it's a win, how do you get it out? [Promote to a rollout](/advanced/rollouts#promote-from-an-existing-experiment)? |
| 134 | + - **Kill it?** Have you already iterated enough? |
| 135 | + - **Iterate?** Are there positive signals that suggest you can turn this into a win with further refinement? |
| 136 | + |
| 137 | +## Iterating on experiments |
| 138 | + |
| 139 | +If your results suggest further refinement, you can **clone** your experiment in Experimenter to create a new iteration. Cloning preserves your branches, feature configuration, targeting, and outcomes, but resets dates, population percentage, and risk assessments so you can start fresh. |
| 140 | + |
| 141 | +You can also **promote a winning branch to a rollout** directly from the experiment's Summary page — see [Creating a rollout from an experiment](/advanced/rollouts#promote-from-an-existing-experiment). |
| 142 | + |
| 143 | +## Workflow diagram |
| 144 | + |
| 145 | +For a visual overview of the full experiment workflow, see the [live Miro board](https://miro.com/app/board/uXjVOJ3IYRA=/). |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | +## Next steps |
| 150 | + |
| 151 | +Once your experiment design is validated, continue to [Configuring](/workflow/configuring) to set it up in Experimenter. |
0 commit comments