Skip to content

How to Use Segments for Targeting

Segments are reusable groups of users defined by attribute conditions. Instead of duplicating the same targeting rules across multiple flags, define a segment once and reference it wherever you need it.

  1. Navigate to the Segments page at /segments.
  2. Click Create Segment.
  3. Enter a name (e.g., “Beta Users”) and an optional description.
  4. Add one or more rules. Each rule specifies:
    • An attribute from the evaluation context (e.g., email, plan, country).
    • An operator (equals, contains, in list, etc.).
    • One or more values to match.
  5. Click Save to create the segment.

Multiple rules within a segment are combined with AND logic. A user must match all rules to be included in the segment.

When you create a targeting rule on a flag, you can target a segment instead of a single attribute:

  1. Open a flag and select an environment tab.
  2. Click Add Rule in the targeting panel.
  3. Choose the Segment match type instead of selecting an individual attribute.
  4. Select the segment you want to target.
  5. Choose which variation to serve when the segment matches.
  6. Save the rule.

When a user’s evaluation context matches the segment’s rules, the targeting rule fires and serves the selected variation.

Open a segment from the Segments page and modify its rules. Changes to a segment’s rules immediately affect all flags that reference that segment. This is the key advantage of segments — update the definition in one place and every flag using it picks up the change.

Before deleting a segment, remove it from all targeting rules that reference it. Deleting a segment that is still in use by a flag’s targeting rules will cause those rules to stop matching.

  1. Check which flags reference the segment.
  2. Update or remove those targeting rules.
  3. Return to the Segments page and delete the segment.

Here are common segments teams create:

  • Internal Team — Attribute email ends with @yourcompany.com. Use this to test features internally before rolling out to customers.
  • Enterprise Customers — Attribute plan in list [enterprise, business]. Target premium features to paying customers.
  • US Users — Attribute country equals US. Roll out features by region.
  • Beta Users — Attribute beta_enrolled equals true. Let users opt in to early access features.
  • Name segments clearly. Use names that describe the group, not the feature (e.g., “Enterprise Customers” not “New Dashboard Users”).
  • Keep segments focused. Each segment should represent one logical group. Combine segments by using multiple targeting rules on a flag.
  • Document segment purpose. Use the description field to explain what the segment is for and who maintains it.