Skip to main content
Version: 2.0.0

Targeting Features

Targeting lets you control which users see which variants based on user attributes. You can target by any attribute you pass from your application — user role, subscription tier, region, signup date, and more.

How Targeting Works

When evaluating a feature, you pass a user object containing a unique ID and any attributes. Featureflow evaluates rules from top to bottom and returns the variant for the first matching rule.

The Failover Rule

Every feature has a failover rule — the catch-all "else" rule at the bottom. If no other rules match, users receive the variant defined in this rule.

Failover Rule

Creating Rules

  1. Click Add Rule — a new rule panel appears above the failover rule
  2. Select a target attribute (e.g., tier, user_role, country)
  3. Choose a comparator — options vary by data type (text, number, or date)
  4. Enter the value(s) to match against
  5. Select the variant or split to return when the rule matches
  6. Click Save Targeting
Create targeting rule

Multiple Conditions

Use the + and - buttons to add multiple conditions to a rule. All conditions within a rule are evaluated with AND logic — all must match for the variant to be returned.

Rule Order

Rules are evaluated top to bottom. The first matching rule wins. Drag rules to reorder them.

Multiple Rules

Passing User Attributes

To use targeting, pass user attributes when evaluating features in your application:

JavaScript
var user = {
id: 'user-123',
attributes: {
name: 'john',
tier: 'gold',
user_role: 'pvt_tester'
}
}
Java
FeatureFlowUser user = new FeatureflowUser(userId)
.withAttribute("user_role", "pvt_tester")
.withAttribute("tier", "gold")
.withAttribute("tenure_years", 10)
.withAttribute("signup_date", new DateTime());

The attributes you pass become available as targeting options in the dashboard.