Use mutual exclusion
In Optimizely Feature Experimentation, experiments can overlap—a single user may be exposed to multiple experiments at the same time. Mutually exclusiveMutually exclusive experiments prevent this by ensuring a user only enters one experiment from a given group. By default, Feature Experimentation hashes a unique, random value per experiment to determine user entry, and these values are independent across experiments. If you need to guarantee that a user only participates in one of several experiments, use an exclusion group. For information, see How bucketing worksHow bucketing works.
Exclusion groups implementation
In Optimizely Feature Experimentation projects, you can make two or more experiments mutually exclusive using exclusion groups. Exclusion groups do not require any SDK changes. The Decide method automatically evaluates whether an experiment is in a group and assigns users to the appropriate experiment and variation.
If you want to implement exclusion groups using the Feature Experimentation UI instead, see Mutual exclusion overviewMutual exclusion overview.
Create an exclusion group
Note Start all experiments in an exclusion group at the same time. Do not add or remove running experiments from an exclusion group because it may have unintended effects on your results. For more best practices, see Best Practices - Mutually Exclusive ExperimentsBest Practices - Mutually Exclusive Experiments.
Use the Create an Exclusion GroupCreate an Exclusion Group endpoint.
Add an experiment to an exclusion group
- Get your experiment rule's ID – Use the Fetch the Rule for a Ruleset in an EnvironmentFetch the Rule for a Ruleset in an Environment endpoint to retrieve your experiment rule's ID.
- Update the exclusion group – Find the exclusion group you want to update, add the stringified rule ID to the group's rules object, then use the Update Exclusion GroupsUpdate Exclusion Groups endpoint to save the change.
Remove an experiment from an exclusion group
- Get your exclusion groups – Use the List Exclusion GroupsList Exclusion Groups endpoint to view all exclusion groups in your project.
- Update the exclusion group – Remove the experiment rule's ID from the rules object, then use the Update Exclusion GroupsUpdate Exclusion Groups endpoint to save the change.
Archive and unarchive an exclusion group
Archive
Use the Archive Exclusion GroupsArchive Exclusion Groups endpoint.
Unarchive
Use the Unarchive Exclusion GroupsUnarchive Exclusion Groups endpoint.
Bucketing
The following table shows how exclusion groups can interact with other bucketing methods. For more detail, see How bucketing worksHow bucketing works.
Bucketing | Comment |
|---|---|
Exclusion groups evaluate _before_ this user bucketing method: |
|
Exclusion groups evaluate _after_ these user bucketing methods: |
|
Important If multiple bucketing methods apply to the same user, the method evaluated first takes priority. For information, see the end-to-end bucketing workflow in How bucketing worksHow bucketing works.