ADVANCED TARGETING

Precision Control Over Feature Access

Target users with surgical precision using contexts, attributes, and flexible rules. Deliver personalized experiences based on user properties, behavior, location, and custom business logic.

The Problem with Basic Feature Flags

Simple on/off switches aren't enough when you need to deliver personalized experiences

High Impact

One-Size-Fits-All Features

Traditional feature flags treat all users the same, forcing you to choose between serving power users or beginners—never both effectively.

Critical Impact

No User Context Awareness

Without understanding who your users are, you can't personalize their experience or test features with the right audience segments.

High Impact

Hardcoded User Lists

Managing user targeting through code deployments or static configuration files is brittle, error-prone, and impossible to update quickly.

The Solution

Understanding Contexts: The Foundation of Targeting

A context represents any entity you want to target—users, organizations, devices, or custom business objects. Each context carries attributes that describe its properties, enabling powerful and flexible targeting rules.

What Are Contexts?

Contexts are the entities you evaluate feature flags against. Instead of just "users," you can target organizations, API clients, devices, or any custom entity type your business needs.

Flexible entity types beyond just users

Attributes: Context Properties

Attributes are key-value pairs that describe a context. Use built-in attributes like userId, email, and country, or define custom attributes like plan type, signup date, or feature usage count.

Standard and custom attributes supported

Multi-Context Targeting

Flagpool supports evaluating multiple contexts simultaneously. Target based on user properties, their organization's plan, and the device they're using—all in a single flag evaluation. This enables sophisticated targeting scenarios that match real-world business requirements.

Powerful Targeting Capabilities

Everything you need to target the right users at the right time

Flexible Rule Operators

Equals, not equals, in list, contains, starts with. Build simple or complex conditions that match your exact business logic.

Target Lists

Create reusable lists of users, organizations, or entities. Reference them across multiple flags without duplicating targeting logic.

Rule Priority & Ordering

Control evaluation order with explicit priorities. Ensure the most specific rules are evaluated first, with fallbacks for broader targeting.

Custom Attributes

Define any attribute your application needs. Target based on plan type, feature usage, signup date, or custom business properties.

How Targeting Rules Work

From context to evaluation: understanding the targeting flow

1

Pass Context

Your application sends context data (user, org, device) with attributes to Flagpool during flag evaluation.

2

Evaluate Rules

Rules are evaluated in priority order. First matching rule determines which variation the context receives.

3

Check Attributes

Each rule checks specific attributes (userId, email, country, custom) against conditions using operators.

4

Return Variation

The matched rule returns its assigned variation. If no rules match, the default variation is returned.

Target Lists: Reusable Targeting Logic

Create lists once, reference them everywhere

What Are Target Lists?

Target lists are reusable collections of values for a specific attribute. Instead of repeating the same list of user IDs or email addresses across multiple flags, create a target list and reference it wherever needed.

Centralized Management

Update a list in one place, changes apply across all flags using it

Semantic Naming

Name lists like "beta-testers" or "enterprise-customers" for clarity

Any Attribute Type

Create lists for userIds, emails, organizations, or custom attributes

Common Use Cases

Beta Testers

Maintain a list of early adopters who get access to experimental features. Add or remove users without touching flag configurations.

Internal Team

Keep a list of employee emails to test features internally before releasing to customers. Useful across dozens of flags.

Premium Customers

Target enterprise or premium plan customers with advanced features. Reference the same organization list across multiple feature flags.

Blocked Users

Maintain an exclusion list for users who shouldn't see certain features, useful for access control or abuse prevention.

Rule Operators Reference

Flexible operators for every targeting scenario

Equals (=)
eq
Example
userId equals "user123"
Use Case

Target a specific user, organization, or value

Not Equals (≠)
neq
Example
plan not equals "free"
Use Case

Exclude specific values, show features to all paid plans

In List
in
Example
userId in ["alice", "bob", "charlie"]
Use Case

Target multiple specific values or use with target lists

Not In List
nin
Example
country not in ["CA", "US", "MX"]
Use Case

Exclude specific regions or groups

Contains
contains
Example
email contains "@company.com"
Use Case

Match partial strings like company domains

Starts With
startsWith
Example
organizationId starts with "ent_"
Use Case

Match prefixes like enterprise customer IDs

Combining Rules

Create sophisticated targeting by combining multiple rules with priority ordering. Rules are evaluated top-to-bottom—the first matching rule wins. This allows you to create specific exceptions before broader targeting.

Priority 1:userId in [beta-testers] → show new UI
Priority 2:plan equals "enterprise" → show new UI
Priority 3:country in ["US", "CA"] → show old UI
Default:all others → show old UI

Advanced

Master-level targeting capabilities for complex use cases

Complex Rule Combinations

Combine multiple conditions with AND/OR logic. Create sophisticated targeting rules that match your business requirements.

Multi-Environment Targeting

Define different targeting rules per environment. Test with internal users in staging, then roll out to customers in production.

Percentage Splits

Combine targeting rules with percentage rollouts. Target specific user segments, then gradually increase within that segment.

Dynamic Context Updates

Update user context at runtime. Change targeting without restarting your application or forcing users to refresh.

Coming Soon

Attribute Inheritance

Define attributes at organization or team level. Users automatically inherit properties, reducing duplication.

Real-Time Evaluation

Targeting rules are evaluated instantly. Changes take effect immediately across all connected clients.

Implementation Guide

Get started with targeting in minutes

1

Pass Context Data

When evaluating a flag, pass context objects containing the attributes you want to target. Each context has a kind (user, organization, device) and key-value attributes.

Include standard attributes: userId, email, name
Add custom attributes: plan, signupDate, featureUsage
Pass multiple contexts: user + organization + device
const context = {
  kind: "user",
  key: "user-123",
  attributes: {
    email: "alice@company.com",
    plan: "enterprise",
    country: "US",
    signupDate: "2024-01-15"
  }
};

const variation = await flagpool
  .evaluate("new-checkout", context);
2

Create Target Lists

In the Flagpool dashboard, create reusable target lists for common groups. Specify which attribute the list targets (userId, email, etc.) and add values to the list.

Name your list semantically: "beta-testers", "vip-customers"
Choose the attribute: userId, email, organizationId, etc.
Add values: one per line in the dashboard
List Name
beta-testers
Attribute
userId
Values
user-123
user-456
user-789
3

Configure Targeting Rules

On each feature flag, add targeting rules that check attributes and return specific variations. Order rules by priority—most specific first.

Use target lists or manual attribute checks
Combine operators: equals, in list, contains, starts with
Set priorities to control evaluation order
Priority 1Variation: NEW
userId in [beta-testers]
Priority 2Variation: NEW
plan = "enterprise"
Priority 3Variation: OLD
country in ["CA", "MX"]
DefaultVariation: OLD
All other users
4

Test & Monitor

Test your rules with real context data before deploying. Use the dashboard to preview which variation different users will receive and monitor targeting performance.

Use the rule tester with sample context data
Check evaluation logs to see which rules matched
Adjust rule priorities or conditions as needed
Rule Evaluation Test
user-123 (beta-tester)NEW
user-999 (enterprise)NEW
user-555 (CA, free)OLD
user-888 (US, basic)OLD

Real-World Targeting Scenarios

How teams use advanced targeting to solve real business challenges

Beta Testing Program

Scenario

Rolling out a redesigned dashboard

Challenge

Need to test with internal team and select customers before broader release

Solution

Create a 'beta-testers' target list with userId attribute. Add internal team emails and select customer IDs. Configure rule: userId in [beta-testers] → new dashboard

Result

Seamlessly add/remove beta testers without code changes. Gathered feedback from 50 users before full release, caught 3 critical bugs early.

Enterprise Feature Access

Scenario

Premium analytics only for enterprise customers

Challenge

Multiple enterprise customers across different organizations need access to advanced analytics

Solution

Create 'enterprise-orgs' target list with organizationId attribute. Configure rule: organizationId in [enterprise-orgs] → premium analytics enabled

Result

Controlled feature access at organization level. Easy to add new enterprise customers to the list without deploying code.

Geographic Rollout

Scenario

New payment provider launching region by region

Challenge

Need to enable new payment system by country, with ability to quickly disable if issues arise

Solution

Configure rule: country in ['US', 'CA'] → new payment system. Add countries progressively: US → US+CA → US+CA+UK → global

Result

Smooth geographic rollout over 3 weeks. Caught currency conversion bug in CA before expanding to UK. Zero downtime.

Plan-Based Features

Scenario

Different features for free, pro, and enterprise tiers

Challenge

Show advanced features only to paid customers, with different capabilities per tier

Solution

Multiple rules with priorities: plan='enterprise' → full features, plan='pro' → standard features, plan='free' → basic features

Result

Clear feature differentiation across plans. Easy to adjust which features appear in each tier without code deployment.

A/B Testing Segments

Scenario

Testing new onboarding flow with specific user segments

Challenge

Want to test with recent signups only, not existing power users

Solution

Rule: signupDate >= '2024-11-01' AND plan != 'enterprise' → new onboarding flow. Track conversion metrics by segment.

Result

Targeted testing with relevant users. Measured 23% improvement in activation rate without disrupting enterprise onboarding.

Internal Tool Access

Scenario

Admin panel and debugging tools for team members

Challenge

Enable special features for employees without exposing them to customers

Solution

Create 'employees' target list with email attribute. Add all @company.com emails. Rule: email in [employees] → admin features

Result

Simple employee identification. New hires automatically get access when added to list. Can quickly revoke access when someone leaves.

Start Managing Feature Flags Today

Join teams who trust Flagpool to deliver features safely and efficiently.

No credit card required • Cancel anytime

Flagpool | Simple Feature Flag Management for Teams