Feature flags for gradual rollouts
Feature control in datacub lets you turn a new feature on for a share of your users, raise it once you are confident, and switch it off in one click, without a new release.
Why roll out gradually
Every release is a small bet. A new checkout page might convert better, or it might have a bug that only shows up with real customers on real phones. Shipping it to everyone at once puts all of them in the blast radius.
A feature flag splits shipping the code from turning the feature on. You deploy the new code switched off, show it to 10% of users first, watch what happens, and raise it to everyone when all is well. If something breaks, you switch it off from the dashboard, and your users are back on the old version in seconds, no deploy needed.
How feature flags work in datacub
You create a flag on the Feature control page:
- Say what you are launching, such as "New checkout page". datacub suggests a key for your code, like
new_checkout, which you can edit. - Pick how many of your customers see it: a share of users, from nobody to everyone.
- Connect it in your code. Your site asks datacub whether the feature is on for this user.
if (await datacub.flag('new_checkout')) {
showNewCheckout()
}datacub.flag returns true or false. Flags load as a separate small file, next to the datacub script, only on sites that use them, so a site without flags downloads nothing extra. If you prefer not to touch the code yourself, the Feature control page gives you a ready prompt to paste into your AI coding tool, and it connects the feature to the switch for you.
Rules that keep rollouts safe
- Each user keeps the same answer. Someone who gets the new feature keeps getting it, so nobody flips between versions from one visit to the next.
- Raising the share only adds users. Going from 10% to 30% keeps the first 10% and adds more. Whoever has the feature keeps it.
- Off means off. A feature that is switched off reaches nobody, whatever the share.
- A flag is never a permission check. It decides what people see, not what they are allowed to do. Keep access rules for paid features or admin pages on your server.
Measure what the rollout changed
Turning a feature on is half the job. The other half is knowing whether it helped. Because flags live in the same product as your analytics, you can:
- Watch your funnels while the share grows: does conversion through checkout hold, or drop?
- Open the user profiles and journeys of people who got the feature and see how they used it.
- Ask a short in-product feedback question after the new feature is used, and read the answers on each user's timeline.
When you want a clear answer to "is version B better than version A?", use an A/B test instead. An experiment splits users between two versions and compares how many reached a goal you choose, with a verdict on whether the difference is clear.
Who it is for
Feature control is built for product teams, not only engineers. The dashboard is in Arabic and English, with right-to-left done properly, and the words are plain: "Who gets it", "Switch it off in one click". It is part of the same product analytics platform as your traffic and events, so there is one script and one bill in SAR.
For the developer details, see feedback, flags and experiments in the web SDK and the product guide.
Frequently asked questions
What is a feature flag?
A switch in the dashboard that decides whether a feature is shown to a user. You ship the code once, then turn the feature on for a share of users, raise it, or switch it off without a new release.
Does a user see the feature every time once they get it?
Yes. Each user keeps the same answer, and raising the share only adds users, so whoever has the feature keeps it.
Can I use a flag to protect a paid feature?
No. A flag decides what is shown, not who is allowed. Keep permission checks for paid or private features on your server.
Does using flags make my site heavier?
Flags load as a separate small file, only on sites that use them. A site without flags downloads nothing extra.