Do you have a product with a consistent user base and you are releasing new features? Then you need to decide whether it’s enough to just test these features in- house. This decision is always tricky, because sometimes it really is useful to receive feedback from a wider audience without the risk of imposing the new feature on your more important or so-called “sensitive users” (major companies that were pleased with your facilities and services up to the present, and you cannot risk the collaboration with them).
If you are facing this dilemma, ConfigCat‘s feature flags for targeting might provide you with a solution.
Let’s say you have a product like Instagram, and the company decided to add new poll-boxes, quiz types and options for embedding links in the stories while removing some of the older ones.
Using feature flags you will have the opportunity to enable certain features to certain group of users. Let’s say you would like to enable a feature only for the users within your company or only to a small percentage of your users (maybe in one country only) before releasing it to the entire world. In addition, you might want to exclude big companies, like H&M or Victoria’s Secret until you have received the favourable feedback from your employees, “friendly users” and a small percentage of app-users or even users from a selected area (country).
Even though in this article it’s exemplified with ConfigCat, targeting works just fine with other feature flag tools as well — for example with Unleash-hosted. The process of targeting special users goes down in the following way:
First step: you need to enable the feature:
- Log in to access the Management Console
- Go to Feature Flags & Settings
- Select TARGET SPECIFIC USERS after clicking the actions icon
After you turned on the feature flag, you will be able to target specific users.
By adding a rule you can specify a group of your users whom a new feature will be enabled or a different value will be served. A rule consists of an Attribute of a user in your application, a Comparison value (e.g. a list of email addresses) and a Comparator. ConfigCat evaluates the targeting rule every time your application requires and decides what value to serve.
A property of the user is considered as an attribute, and it can vary between e-mail address, country, and identifier or custom (you can add highly specific attributes such as eye colour).
The comparison value is any string, number or comma separated list to be compared with the selected attribute using the comparator. It can be a list of e-mail addresses, companies or users in a specific country.
The comparator has four different setting options and it marks the selection of the users with a specific attribute from the list (comparison value).
The term ‘served value’ mentioned before refers to the exact value that will be served to the users that fall into that fraction. Depending on the kind of your setting this could be:
In our example the On/Off Toggle is relevant because that is the usual state of a feature flag, but ConfigCat offers a range of different setting kinds and types.
You actually have multiple options in choosing the served value of the feature flag, for example, it can be the On/Off Toggle presented above (note: here the number of options must be 2), but if you decide to use Text and/or Number the maximum number of your options entirely depends on your subscription plan. You can add/remove options by clicking the Actions icon.
Once you’ve enabled your feature for the list of your employees for instance, you can add multiple targeting rules and ordering by clicking on the Actions icon; thus you can create more complex rule sets.
- Rule sets are evaluated one by one, from top to bottom direction.
- Change the order of targeting rules by drag n’ drop.
Enable a feature only to users within your company except the PR team (Connor and Natasha) by adding two targeting rules:
To all other uses serve: OFF
This value will be served as a fall-back if none of the above rules apply or a User Object was not passed to the ConfigCat correctly within your application.
You can also target a percentage of users. If you enable a new feature on a platform like Instagram, you might want to be granted public feedback by including a randomly selected fraction of your users whom a feature will be enabled, or a different value will be served. The sum of all % values must be equal to 100.
- Select TARGET % OF USERS after clicking the actions icon.
To sum up, targeting can prove to be great help in experimenting with new features while offering you and your company a risk-free path to gather feedback from the targeted users. Feature flags provide you with a safe environment with the option of changing your mind.
Posted on Nov 14 '19 by: