Controlling experiment populations
Read time: 3 minutes
Last edited: Oct 21, 2021
This topic explains what an experiment population is, and how to use LaunchDarkly's features to show experiments only to a specific group of users.
You can get accurate results more quickly if you only expose some of your user base to experiments. You have the option to only include a subset of users in your experiments. This subset of users is referred to as your experiment population.
You can create a custom experiment population by selecting specific flag targeting rules to include in your active experiments.
For example, imagine you are testing alternate copy for your checkout button. You're currently targeting all your Canadian and US users with the 'true' variation for the alternate button, which shows your new copy, but you only want to run an experiment measuring click conversions for users in the United States. To accomplish this, you select the user targeting rule that affects US-based users and de-select the rule that targets users in Canada.
You may want to refine your experiment population for any of the following reasons:
- Running targeted experiments for a subset of your flag-targeted users.
- Excluding user groups whose events you do not need to measure. For example, users affected by 'Default' rules.
- Reducing the events volume an experiment generates in order to manage billing costs.
If you can't see the feature described below, your SDKs may be out of date. To solve this problem:
- Update your SDKs to the latest version.
- Contact email@example.com to enable the feature.
If you have experiment allocation enabled, customizing your experiment populations works differently than described below. To learn how to customize your experiments with experiment allocation enabled, read Allocating experiment traffic.
You can refine your user base into a specific experiment population by following the procedure below.
To learn how to configure which user data LaunchDarkly sends to Data Export destinations, read Customizing which data LaunchDarkly exports.
To customize your experiment population:
- Identify which flag is associated with the experiment you wish to modify.
- Navigate to that flag's Settings tab.
- Click N of N targeting rules in the "Exporting events from" line. The "Configure event settings" screen opens:
- Click the Custom selection radio box to modify the users who can see an experiment. When you click Custom selection, you can choose which targeting rules you wish to include or exclude from an experiment. If you use controlled populations and choose Custom selection, the experiment excludes all users who return a
PREREQUISITE_FAILEDevaluation reason. To learn more about flag prerequisites, read Prerequisite checks.
- Select the checkboxes of rules you wish to include in the experiment. This refines the experiment's population down to the group you choose:
- Click Save Changes. A confirmation dialog appears.
- Type the name or key of the environment in the text box and click Confirm.
The modified list of users you created is now the experiment's population.
You can customize your experiment's population at will without your flag targeting rules changing. Flag targeting controls which variation of a flag a user sees. An experiment's population determines which of your users contribute to Experimentation results or Data Export streams. To learn more, read Targeting users.
If you update a feature flag's targeting rules while an experiment is running, a user who previously saw one variation may then see a different variation. Data for that user is recorded twice, because LaunchDarkly deduplicates user data only at the variation level, not the flag level. To prevent the experiment from recording user data twice, restart it after you make any changes to a flag's targeting rules. This clears all existing data from the experiment.
To restart the experiment:
- Find the feature flag associated with your experiment.
- Click on the flag's Experimentation tab.
- Click on the overflow menu in the relevant experiment.
- Click Reset data.
The data from the experiment is now cleared.