Feature flags and A/B tests
A flag turns part of a website on for some visitors. Give it a goal and it becomes an A/B test that compares each version’s visits on that goal.
- On the Experiments tab, make a flag: its Key (used in the site’s code), the share of visitors who get it, and its Variants and their share.
- Optional: Only these countries, a device, or Only on pages (with
*wildcards). - For a test, tick Make it an A/B test and pick the goal: an event or a page visit.
- Use it on the website:
nq.ready(function () {
if (nq.flag('new-checkout') === 'b') { /* show version B */ }
}); Or without code, shown only to visitors in variant b:
<div data-k-flag="new-checkout" data-k-variant="b" hidden>…</div> - Turn it on from the list when the site is ready.
Results show each variant’s visits and conversion rate. Until each has about a hundred visits the page says Too early to tell. A flag keeps a random id in the browser’s local storage, so a visitor keeps their version.

Was this helpful?
Thanks for your feedback!
✓ Feedback received. Thank you!



