Skip to content

Five targeting patterns you can use today

Targeting rules decide who gets which value. These five cover most needs. Each uses attributes you pass in the user object.

1. Your own team first

email ENDS_WITH "@yourcompany.com"  ->  new feature (100%)

The easiest way to find problems early. Put this rule at the highest priority.

2. Beta opt-in

custom.betaOptIn EQUALS "true"  ->  new feature (100%)

Let customers opt in, store the choice on the user, and pass it as a custom attribute.

3. By plan

custom.plan EQUALS "enterprise"  ->  premium feature (100%)

4. By country

custom.country IN ["US", "CA"]  ->  region-specific feature (100%)

5. By device

custom.deviceType IN ["mobile", "tablet"]  ->  mobile layout (100%)

FlagDiligence does not detect device or country for you. Work them out in your app and pass them as custom attributes.

Make them reusable with segments

If you use the same group across many flags, create a segment once (for example Enterprise customers) and choose it in each rule. Change the segment and every flag that uses it follows.

Order matters

Rules are checked from the lowest priority number up, and the first match wins. Put specific rules before broad ones, and finish with your default rollout.

Full reference: targeting and segments.