Audience Targeting in Feature Flags

User targeting is the ability to turn feature flags on and off to users with specific properties. For example, it is possible to apply a feature flag to all users who use Android among mobile operating systems.

However, users who are individually targeted users (via device ID or user ID) cannot be a part of audience targeting.
Additionally, users who have been individually targeted and targeted to users cannot be a part of the overall traffic allocation for the feature flag.

📘

Check your SDK conditions

  • Supported languages for targeting: Android, iOS, JavaScript, React, React Native, Java/Kotlin, Python, Node.js
  • Supported versions for targeting: iOS and React Native are 2.0.0 or higher, others are 2.1.0 or higher
  • For more information about SDK versions and their functions, refer to the What is a SDK? document.

Check your plan

  • Targeting is only available for paid plans (Pro plan and above).

Targeting Policies

  1. When to set
    You can set up your targeting settings whenever you want. All users are returned to [False] when the feature flag status is off.

    However, keep in mind that if you set the feature flag when it is on, targeting will be applied to that user immediately after the settings are saved.

  2. Default
    All users is the default. This means that all users, except for the targeted individual, are eligible for traffic allocation.

  3. Environment
    Possible in both the Production Environment and Development Environment.

  4. Rules
    If you want to limit your audience to specific users, you need at least 1 rule.
    You can have up to 10 rules for each target. Each rule is independent. Therefore, if only one of the rules is satisfied, the user becomes a target.
    For example, if you want to target consumers who have purchased a new product, define a rule of "users who purchased a product belonging to the 'new product' category" and a rule of "users who purchased a product with the word 'new' within the product name". As long as one of the rules is satisfied, they will become a target.

  5. Conditions
    A target group will have at least 1 condition from the point that it is created, and you can have up to 10 conditions for each target rule.
    Each condition will have the AND operator applied and the targeting will only occur for a user that has all of the conditions satisfied. For example, if you target Android users among mobile operating systems and users in their 30s, both the conditions "users with Android mobile operating systems" and "users in their 30s" must be satisfied. Hence depending on your needs, you will either add a target rule or a target rule condition within a target rule.

  6. Properties
    Conditions act on properties. Therefore, you should first integrate with the Hackle SDK and be able to collect the property keys and values to use.
    For more information about properties, see the Properties document.

Composition of target rules and conditions

📘

Important!

Both the target rules and conditions consist of a combination of property name + operator + property value.

For example, if you want to target Android users among mobile operating systems in a situation where users' operating systems are being collected via the property key osName, you can create the following combination.

  • Property Key: osName
  • Operator: One of the following
  • Property Value: Android, android

The first combination created becomes the first (target) rule. Depending on whether you add another combination as an AND or an OR to these rules, you can create a target for a completely different user.

Let's take a closer look at the operators and AND/OR below.

Operator

Operators are used when setting conditions and serve to describe the relationship between property names and property values.
Hackle provides a total of 22 operators, you must select an appropriate operator according to the type of property value of the selected property name.

Please refer to the table below for more details.

OperatorProperty Value TypePossible Number of Property Values
Is any ofStringMultiple selections possible
Is none ofStringMultiple selections possible
Starts with any ofStringMultiple selections possible
Starts with none ofStringMultiple selections possible
Ends with any ofStringMultiple selections possible
Ends with none ofStringMultiple selections possible
Contains any ofStringMultiple selections possible
Contains none ofStringMultiple selections possible
=NumberMultiple selections possible
NumberMultiple selections possible
>=NumberSingle selection allowed
<=NumberSingle selection allowed
>NumberSingle selection allowed
<NumberSingle selection allowed
When TrueBooleanUnselectable (operator includes property value 'True')
When FalseBooleanUnselectable (operator includes property value 'False')
version =VersionSingle selection allowed
version ≠VersionSingle selection allowed
version >VersionSingle selection allowed
version ≥VersionSingle selection allowed
version <VersionSingle selection allowed
version ≤VersionSingle selection allowed

Example

If you want to target a user who resides in Dallas city, you can define the following rule like this:

👍

Creating a rule for [users residing in a metropolitan city]

  • Property key: Region (The property value of the region is String type)
  • operator: one of the following
  • Property values for 'next' spoken by the operator: "Dallas Metropolitan City", "New York Metropolitan City", "Los Angeles Metropolitan City", "Chicago Metropolitan City", "Houston Metropolitan City", "Washington Metropolitan City"

AND and OR

The two AND and OR operands have the following meanings:

  1. AND
    Both operands must be satisfied to be included in the targetted users.
    For example, if 'Android users among mobile operating systems AND users with addresses in Seoul', only users with addresses in Seoul ** among users using mobile devices with Android operating systems are targeted.

  2. OR
    If only one of the operands is satisfied, it is included in the targetted users.
    For example, if 'Android users OR address in Seoul among mobile operating systems', users who use mobile devices with Android operating system or users whose address is in Seoul are targeted.

📘

AND and OR operands in Hackle's targeting

  • The AND operator is used when adding conditions to a rule. Since multiple conditions must be satisfied to be included in the target, the more AND operator is used, the narrower the target's scope.
  • The OR operator is used when adding a rule. The more you use the OR operator, the wider the target, because if only one of the rules is satisfied, it is included in the target.

No target rules set (All Users)

If you don't set a target, i.e. no rules specified, then all users, except those who are individually targeted, will be a part of the allocated traffic.

2310

Drag the button or type in percentage to allocate traffic.

2170

Click on Save button on the top right corner to apply changes.

Setting up targeting rules on the dashboard

2288

When setting, the values to be input or selected and the description of each button are as follows.

  1. Property key
  2. Operator
  3. Property value
  4. Delete rule
  5. Add an andconditions.
  6. Set the traffic of the rule.
  7. Add New Rule
  8. Set the percentage for the feature flag for the remaining amount of traffic that does not fall under the above rules.

If you click the + Add an AND condition button in 5, a condition is added to Rule 1 as shown in the screenshot below.

2170
  1. You can change the order of the rules if you have more than one rule, you can change the order. Use the dotted icon to the left of the rule name.

  2. You can also customize the percentage directly (%) after determining the state of a rule.
    Once you customized the percentage for the rule, the feature flag will only be applied that specific percentage of the target users that satisfy all the conditions of the rule.

As mentioned earlier, a single target rule can have up to 10 conditions, and your actual targeting can have up to 10 rules.
Don't forget that it's the AND operator when adding conditions, and the OR operator when adding rules.

After entering the necessary information to create the test and setting the targeting settings, click the Save button to complete the setup.

Set target (1 or more rules)

If you set a target, it will have one or more rules.

2172

SDK Configuration

Refer to the links below for User Identifier and Property of each SDK types.

Java/Kotlin →
Python →
Node.js →
JavaScript →
React →
React Native →
Android →
iOS →
Unity →