Manage rules

  • Updated
  • 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.

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.

When you create a flag, Feature Experimentation automatically assigns you the Admin role for that flag using granular permissions. This ensures you can immediately manage rules associated with that flag.

Start a rule

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

From the ruleset

  1. Click More options (...) on the rule.
  2. Select Run. 7cfb0ed-image.png

From the rule details

  1. Click on the rule.
  2. Click Run. 966b41d-image.png

Rule in a draft or paused ruleset

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

ecdc9e3-image.png

Click Ok.

Your rule's status is updated to Ready to Run, like in the following screenshot: 

5610995-image.png

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

Rule in a running ruleset

If the ruleset is already running, clicking Run immediately updates the rule to Running. The rule does not enter Ready to Run status, and no confirmation page is shown. 

c1331d7-image.png

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

    a9273dc-image.png

From the rule details

  1. Click on the rule.
  2. Click More options (...).
  3. Click Pause

    1845e94-image.png

Conclude rule

Setting a rule to Concluded ends the experiment and removes it from the datafile. Feature Experimentation stops serving variations unless you choose Conclude and deploy.

When you conclude a rule, you can select the outcome of your rule and add a summary of what you learned from your hypothesis. This helps track whether the experiment had a positive, negative, or inconclusive result.

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

    9b092df-image.png
  3. Select an option for the Results Outcome.
  4. (Optional) Add a brief conclusion about what you learned about the experiment
  5. (Optional) Toggle Conclude and deploy on. See the Conclude and deploy section for information.
  6. Click Conclude.

    3ba579e-image.png

From the rule details

  1. Click on the rule.
  2. Click Conclude.
  3. Follow steps three through six from the previous From the ruleset section.

Conclude and deploy

If you toggled Conclude and deploy, complete the following:

  1. Select which variation to direct traffic to from the Variation drop-down list.
  2. (Optional) Adjust the Traffic allocation percentage.
  3. Click Deploy

    b43eb61-image-2.png

Duplicate rule across environments

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

fd476f4-copy_rule.png

Collaborators outside of your organization cannot create multiple experiments per flag.

Manage flag rules

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

You can configure the following for each rule:

  • Rule name.
  • Rule description.
  • Targeted audiences.
  • Traffic ramp percentage.
  • Associated metrics.
  • Traffic distribution mode.
  • Variations.
  • Exclusion groups.

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

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 the experiment or variation if you use a key not referenced in your code.

To edit a flag rule, complete the following:

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

Your project’s datafile updates within a few seconds. Depending on how often your application fetches the datafile, the update may take time to reflect in production.

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

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

For information, see How bucketing works.