You created a new software feature, put it behind a feature flag, and deployed it to production. Now, you want to enable this new feature to some of your users, so you get early feedback, before releasing the new feature to your whole userbase.
But whom to release the new feature first? How to choose the first user segment? And how to target them with feature flag rules?
Lets see some typical real world examples how big companies do it.
Release based on Company, or Email address
A great first step is to enable the new feature to your colleagues, while keeping it hidden from the rest of the world. This enables you to get early feedback from users inside of your company. You'd be surprised how much bug they'll catch on the first day!
Here is how you can segment and target your colleagues with one simple rule in ConfigCat:
The example above assumes that everyone in your organization has an email address in the form of
Note how we used the
CONTAINS operator to target only those users who work for your company.
This is what needs to be done in your application at the code level:
Please note, how we used the
god_mode_enabled key and the
user object here to check whether God Mode is enabled for
The example above is in
C#, but you can do the same in
PHP etc. See examples in other languages.
Release on a Country basis
Another typical strategy is to release new features to users from a specific country only. This strategy enables you to get feedback from a lot of users, while still avoiding a global impact.
The image above shows how to target all users in Germany. This is a large segment of users, and this partial release is probably a good indicator of what would happen if you'd release the new feature to the whole world!
Note how this targeting rule is similar to the one we used for dogfooding. It makes use of the
Country property, and the
IS ONE OF operator.
In order to enable your Product Manager to segment users based on their country, just fill the
Country property of the
user object in your code:
Let me show you a trick.
You can achieve the same results in an alternative way:
Here we targeted everyone NOT in Germany with an OFF value, while enabling the feature to the rest of the world (which is Germany).
After the basic examples lets see a few more powerful ones.
Platform, Country and Version
This is how you release a feature to Android app users in Germany, and only for users who are using version 5.3 and above.
At the code level, add the keys
AppVersion to the
Custom property of your
Everyone in My Company, plus Android users from Germany, above v5.3
I'm sure you get it now:
First we target our own colleagues with an ON. Then we make sure non-Android users will not get the feature. Then we ensure not to release the feature to anyone under version 5.3. And exlude everyone except Germany. And finally enable the new feature to the rest of the world (which is everyone with apps > 5.3 in Germany).
This is the code:
Yes, but what if?
Do you have any other scenario in mind? If you find ConfigCat is not powerful enough for you, just drop us an email at firstname.lastname@example.org. We will help you. Either by adding a new feature to ConfigCat, or showing you how you can use ConfigCat's existing features to reach your goal.