The availability of features may depend on your plan type. Contact your Customer Success Manager if you have any questions.

Dev guideRecipesAPI Reference
Dev guideAPI ReferenceUser GuideLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev guide

Manage rules

How to update rules in Optimizely Feature Experimentation.

Rules contain the experiment and targeting logic within a flag. Rules describe what variation the flag should deliver to a given user. A ruleset is the collection of rules associated with a flag.

📘

Note

There is a limit of 100 rules per ruleset (100 rules across a particular flag and environment).

Rules can be in one of the following states:

  • Draft – Rule recently created and never enabled.
  • Ready to Run – Rule is enabled and ready to be delivered, but the associated ruleset is in Draft or Paused state.
  • Running – Rule is enabled and running.
  • Paused – Rule was running and is now paused.
  • Concluded – Rule has concluded, and no further action is necessary beyond reporting progress and delivering a winning variation. See Conclude rule.

See New flag and rule lifecycle management FAQs for information.

Start a rule

Go to Flags > select your flag. Select the environment.

From the Ruleset:

  1. Click More options (...) on the rule.

  2. Select Run.

    Click run from the more options menu in the ruleset

From the rule details:

  1. Click on the rule.

  2. Click Run.

    Click run from the rule

Rule in a draft or paused ruleset

If your ruleset is not set to running, you see a confirmation page explaining your ruleset is still paused:

Ready to run pop up page

Click Ok.

Your rule's status is updated to Ready to Run.

rule in ready to run status

To update your rule's status to running, set your ruleset's status to Running.

Rule in a running ruleset

If your ruleset is already set to Running, after clicking Run on your rule, your rule is updated to Running. You do not see a confirmation page and your rule will not go into Ready to run status. Instead, your rule will automatically start running.

Running rule and running ruleset

Stop a rule

Go to Flags > select your flag. Select the environment.

From the Ruleset:

  1. Click More options (...) on the rule.

  2. Select Pause.

From the rule details:

  1. Click on the rule.

  2. Click More options (...).

  3. Click Pause.

Conclude rule

The Concluded status changes the experiment status and displays it as Concluded in the experiment list. Concluding a rule removes it from the datafile. Setting a rule to Concluded stops serving the variations unless you select Conclude and deploy.

When concluding a rule, you can select the outcome of your rule to note if the rule had a positive, negative, or inconclusive effect on your hypothesis. Also, you can add a summary of your conclusion to recap your findings.

🚧

Important

After concluding your rule, you cannot modify that rule.

Go to Flags > select your flag. Select the environment.

From the Ruleset:

  1. Click More options (...) on the rule.

  2. Select Conclude.

    Conclude from the drop-down list
  3. Select an option for the Results Outcome.

    Conclude page
  4. (Optional) Add a brief conclusion about what you learned about the experiment.

  5. (Optional) Toggle Conclude and deploy on.

  6. Click Conclude.

From the rule details:

  1. Click on the rule.
  2. Click Conclude.
  3. Follow steps 3-6 from the previous From the Ruleset section.

If you toggled Conclude and deploy:

  1. Select which variation to direct traffic to from the Variation drop-down list.

  2. (Optional) Change the Traffic allocation percentage.

  3. Click Deploy.

    Conclude and deploy page

Duplicate rule across environments

To duplicate a rule across an environment, select Add Rule, click Copy rules from, and select which environment you want to copy the rules from.

copy rule from another environment

📘

Note

Collaborators outside of your organization cannot create multiple experiments per flag. For information, see collaborators.

Manage flag rules

You can add, remove, or update your flag's rules anytime. However, you should turn your flag off before making changes.

❗️

Warning

You should not change your experiment while it is running. For information, see Why you should not change a running experiment.

The following are configurable for rules:

  • Name
  • Description
  • Audiences
  • Traffic ramp percentage
  • Metrics
  • Traffic distribution mode
  • Variations
  • Exclusion groups

After you create a rule, you cannot change its key.

🚧

Important

Be careful when you are changing experiment parameters.

Do not change your rule unless you are making the corresponding changes in your code. No traffic is sent to that experiment or variation if you use a key not referenced in your code.

To edit a flag rule:

  1. Click the rule name to open it.
  2. Change your rule parameters as desired.
  3. Click Save.

Changing your rules updates your project's datafile within a few seconds. Depending on how often you retrieve datafile updates, it may take some time before your experiments are updated in production.

If you want your rules to update in real-time, use webhooks to receive datafile updates.

Warning

Changing traffic allocation or group assignment for a running experiment will impact user bucketing, causing users to be bucketed in or unbucketed from this experiment.

For information, refer to How bucketing works.