feature-flags

Targeting Rule

A targeting rule decides which users a feature flag serves by matching attributes like plan, region, or user ID. It turns a simple on/off flag into precise control over who sees a feature.

What it means

A targeting rule is the logic a feature flag evaluates to decide what value to serve a given user. Instead of a flag being simply on or off for everyone, targeting rules match against a context of attributes - user ID, email, subscription plan, country, device, or any custom property you pass to the SDK. Rules are evaluated in order: the first one that matches wins, and a default value serves anyone who matches nothing. This is what lets a single flag serve different variations to different segments at the same time.

Why it matters

Targeting is what makes flags powerful beyond a basic switch. Percentage rollouts, beta programs, plan-based entitlements, regional launches, and A/B test bucketing are all just targeting rules. Good targeting is deterministic - the same user always lands in the same bucket via consistent hashing - so a person’s experience does not flicker between page loads. It also keeps sensitive logic like premium gating out of scattered if-statements and in one auditable place, where product managers can adjust who gets what without a code change.

In practice

You might write a rule that serves a new dashboard to all internal emails, then 10 percent of users on the Pro plan, defaulting everyone else to the old view. LaunchDarkly offers a rich rule builder with segments and prerequisites, while GrowthBook ties targeting to its experimentation and analysis layer. Keep rules readable and audited - our feature flags best practices and implementation guide cover attribute design and avoiding rule sprawl.

Related Terms

Learn More

Related Articles

Free Newsletter

Get the Feature Flags Newsletter

Platform benchmarks, real pricing data and progressive delivery practice. No spam.

Free. Unsubscribe any time. See our privacy policy.