Skip to content

User Segments

Pro Segments are a Pro-only feature.

Segments are reusable user groups that you can reference across multiple targeting rules. Instead of duplicating conditions like “enterprise users in US” in every flag, create a segment once and use it everywhere.

Why Use Segments?

Before Segments

Without segments, you duplicate conditions across flags:

Flag: new-checkout
Rule 1: email ends_with "@acme.com" AND custom.plan = "enterprise" → Enable
Flag: dashboard-v2
Rule 1: email ends_with "@acme.com" AND custom.plan = "enterprise" → Enable
Flag: analytics-feature
Rule 1: email ends_with "@acme.com" AND custom.plan = "enterprise" → Enable

After Segments

With segments, define once, use everywhere:

Segment: Enterprise Users
email ends_with "@acme.com" AND custom.plan = "enterprise"
Flag: new-checkout
Rule 1: In segment "Enterprise Users" → Enable
Flag: dashboard-v2
Rule 1: In segment "Enterprise Users" → Enable
Flag: analytics-feature
Rule 1: In segment "Enterprise Users" → Enable

Benefits

  • Single source of truth: Update segment definition in one place
  • Consistency: Same users match across all flags using the segment
  • Easier management: Name segments for clarity (“Beta Testers” vs complex conditions)
  • Less duplication: Reduce errors from copying conditions

Creating a Segment

Segments are created at the project level and can be used by any flag in that project.

  1. Open your project and click Segments in the navigation
  2. Click New Segment
  3. Configure:
    • Name: Human-readable name (e.g., “Enterprise Customers”)
    • Description: What this segment represents
    • Rules: Conditions that define membership

Example: Beta Testers Segment

Name: Beta Testers
Description: Users who opted into our beta program
Conditions: ANY match
├─ email ends_with "@beta.featsync.io"
└─ custom.beta_opted_in equals true

Example: Enterprise Segment

Name: Enterprise Users
Description: Customers on enterprise plans
Conditions: ALL match
├─ custom.plan equals "enterprise"
└─ custom.account_status equals "active"

Using Segments in Rules

When creating or editing a targeting rule on a flag, you can choose between inline conditions or using a pre-defined segment:

  1. Open a flag and expand the Targeting section for an environment
  2. Click Add Rule or Edit on an existing rule
  3. Under Match by, toggle between:
    • Conditions: Define inline attribute-based conditions
    • Segment: Select a pre-defined segment from the dropdown
  4. Configure the serve behavior (Enable/Disable)
  5. Click Save Changes
Flag: advanced-analytics
Rule 1:
├─ Use Segment: "Enterprise Users"
└─ Serve: Enabled
Rule 2:
├─ Conditions: custom.analytics_beta equals true
└─ Serve: Enabled
Default: Disabled

Segment Evaluation

When a rule references a segment, the segment’s conditions are evaluated as if they were inline:

Request: evaluate("advanced-analytics", {
userId: "123",
custom: { plan: "enterprise", account_status: "active" }
})
Rule 1: Use Segment "Enterprise Users"
└─ Segment conditions: custom.plan = "enterprise" AND custom.account_status = "active"
└─ ✓ Both match → Rule matches
Result: enabled: true, reason: "segment", segmentId: "seg_xxx"

The reason field will be "segment" when a segment rule matches, and segmentId identifies which segment.

Best Practices

1. Name Segments Clearly

Use descriptive names that explain the group:

✓ Good: "Enterprise Customers", "Beta Testers", "Internal Team"
✗ Bad: "Segment 1", "Test Group", "Users"

2. Keep Segments Focused

Each segment should represent a single cohesive group:

✓ Good: "Enterprise US Customers" - clear, specific group
✗ Bad: "Enterprise or Beta" - combines unrelated groups

3. Document with Descriptions

Add descriptions explaining when to use the segment:

Name: High-Value Customers
Description: Customers with >$10k MRR. Use for early access to premium features.

4. Audit Segment Usage

Before modifying a segment, check which flags use it:

  • Segment changes affect all flags referencing it
  • Consider creating a new segment instead of modifying existing ones

Segments vs Inline Rules

Use Segments WhenUse Inline Rules When
Same group across multiple flagsConditions are flag-specific
Group definition might changeSimple, one-time conditions
You want named groups for clarityQuick testing or temporary rules
Team members need to understand targetingPerformance-critical (1 fewer lookup)

Plan Availability

FeatureFreePro
Inline targeting rules2 per flagUnlimited
Segments-Unlimited