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.
    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
    No rules 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.

Operator

Property Value Type

Possible Number of Property Values

Is any of

String

Multiple selections possible

Is none of

String

Multiple selections possible

Starts with any of

String

Multiple selections possible

Starts with none of

String

Multiple selections possible

Ends with any of

String

Multiple selections possible

Ends with none of

String

Multiple selections possible

Contains any of

String

Multiple selections possible

Contains none of

String

Multiple selections possible

=

Number

Multiple selections possible

Number

Multiple selections possible

=

Number

Single selection allowed

<=

Number

Single selection allowed

Number

Single selection allowed

<

Number

Single selection allowed

When True

Boolean

Unselectable (operator includes property value 'True')

When False

Boolean

Unselectable (operator includes property value 'False')

version =

Version

Single selection allowed

version ≠

Version

Single selection allowed

version >

Version

Single selection allowed

version ≥

Version

Single selection allowed

version <

Version

Single selection allowed

version ≤

Version

Single 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.

Setting up targeting rules on the dashboard

Click on the Target button to the right of the Audience Targeting area of the feature flag page to set your audience targets or edit the content.

If this is the first setting, you can set the first condition of the first rule.

18821882

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.

18661866

If you press the + Add New Rule and then the + Add an AND condition button within the newly created rule, you will see the following screenshot.

18721872

The newly added rule is titled "else if" because it checks whether the current rule is satisfied with regards to whether or not the previous rule is satisfied.

  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. In the example above, we flagged a feature for only 75% of the target subjects.

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.

View settings in dashboard

You can view setting information in the audience targeting section of the feature flag detail screen.

No target rules set (0 rules)

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.

24422442

① indicates that there are no rules set.
You can see an example rule in ②. This isn't a real rule, just an example to show you what it would look like when you set up a rule.
You can save the settings with the ③ button.

Set target (1 or more rules)

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

24362436

①means the first rule. The first rule always has an if the title.
②If the else if title is attached as shown in, it means the second or subsequent rule.
①,② You can check the status of the set conditions and rules.
③You can change the target settings through the Set button in.


Did this page help you?