Skip to main content
Rules decide which variant to use for a particular client and user at a given time. A/B tests and rollouts create rules to assign users to the different treatment groups when you launch them. You can’t change these rules directly in the list of rules. If no rule matches, the client uses the default value of the flag defined in the client.
Avoid rules that overlap. For example, if you have a rule that matches all users, and another rule that matches a subset of users, the second rule never matches.

Types of Rules

You can create rules directly on a flag, or through A/B tests and rollouts.

Individual Targeting Rules

Use individual targeting rules to force a specific variant for a set of users. For example, use individual targeting rules for testing and debugging. Individual targeting rules let you:
  • Select a variant to serve
  • Choose an attribute to match against (such as user ID)
  • Specify a list of values that should receive the variant
Place individual targeting rules at the top of the list of rules. This ensures they evaluate first and override other rules. Putting them at the top also increases their visibility, and lets you quickly turn them off when they are no longer needed.

Conditional Targeting Rules

Conditional targeting rules are the most flexible type of rule. Use when you want to assign a variant to a set of users based on conditions and percentage allocation. Conditional targeting rules let you:
  • Select a variant to serve
  • Set what percentage of traffic should receive the variant
  • Choose an attribute to use for randomization
  • Define matching conditions based on context attributes
You can optionally enable sticky assignments to make variant assignments persist for targets even if the rule changes.

A/B Test and Rollout Rules

When you create an A/B test or rollout, Confidence automatically creates rules to assign users to treatment groups. These managed rules appear in the rules list but you can’t edit them directly. Instead, manage them through the A/B test or rollout interface.
  • A/B test rules: Created when you launch an A/B test. The A/B test manages traffic allocation between control and treatment variants.
  • Rollout rules: Created when you launch a rollout. The rollout manages the gradual increase of traffic to the new variant.

Enable Rules

Rules are inactive when you create them. To enable a rule, click the slider button in the top left corner of the rule card.

Order of Rules

The order of the rules defines in what order to evaluate them. The first rule that matches a client and a user decides the variant to use. You can reorder the rules by dragging them up and down in the list. Newly created rules are at the bottom of the list to not impact already running tests and rollouts.
Changing the order of rules can potentially have a big impact on the behavior that users experience. It may also impact the results of A/B tests and rollouts.Rules for A/B tests and rollouts are always added to the end of the list to not impact already running tests and rollouts.