A/B testing: let your users decide what works

Experiments in datacub show half your users the current version and half a new one, then tell you which one got more people to the goal you chose, and how sure that result is.

Why A/B test

Every team has the same argument: should the button say "Start free" or "Try it now"? Is the shorter sign-up form better? Instead of going with the loudest opinion, an A/B test tries both on real users and lets the numbers decide. You know the result before you give the change to everyone.

It also protects you from changes that feel better but are not. A redesign that the team loves can still get fewer people to check out. An experiment catches that while only half your users see it.

How experiments work in datacub

You create one with New experiment on the Experiments page:

  1. Say what you are testing, in your own words, such as "Sign-up button text". Users never see this name.
  2. Describe the two versions. A is what people see now. B is your change.
  3. Choose what counts as success: the goal event you want more people to reach, such as signup_completed. Pick one of your events or type its name.
  4. Add both versions to your code. The page gives you a ready prompt to paste into your AI coding tool, or you call it yourself:
const version = await datacub.experiment('signup_button')
showButton(version === 'B' ? 'Try it now' : 'Start free')

datacub.experiment returns 'A' or 'B' and records that this visitor saw that version, so call it where the version actually shows. Results appear on the Experiments page as users arrive.

Reading the result

For each version, datacub shows how many users saw it and how many of them reached the goal. Then it gives one of three verdicts:

VerdictMeans
Still collectingtoo few users so far
No clear difference yetA and B look alike so far
Clear differencedatacub is sure enough that one does better

datacub starts comparing once each version has at least 100 users and 10 of them reached the goal. With a clear difference, it tells you how much more or less often B gets people to the goal than A, and the range the real difference most likely sits in.

Each user is counted once, in the first version they saw, so you can check the results whenever you want without spoiling them.

When you are done, stop the experiment. Everyone sees version A again and the results are kept. A stopped experiment does not restart, so for a new idea, start a new one.

Good experiments to start with

  • Button text on your main call to action.
  • A shorter sign-up form, with signup_completed as the goal.
  • The order of plans on the pricing page, with checkout_completed as the goal.
  • A new onboarding step, with your first moment of value, such as project_created, as the goal.

Test one change at a time, and pick a goal your code confirms after the action succeeds, not a button click. Our event tracking page explains how to send events like these.

Experiments, flags and funnels

  • Use an experiment when you need to know whether B beats A. Use feature flags when you already decided and just want to roll a feature out gradually.
  • Look at the step before your goal in a funnel to find the best place to test.
  • After the experiment, check retention: a version that gets more sign-ups is only better if those people come back.

Experiments are part of the same product analytics platform as your traffic and events, with the dashboard in Arabic and English. For code details, see feedback, flags and experiments in the web SDK and the product guide.

Frequently asked questions

How does datacub decide which version won?

It compares how many users who saw A and who saw B reached the goal event you chose. It shows "Clear difference" only when it is sure enough that one does better.

How many users do I need?

datacub starts comparing once each version has at least 100 users and 10 of them reached the goal.

Can I check the results while the test is running?

Yes. Each user is counted once, in the first version they saw, so checking whenever you want does not spoil the numbers.

What happens when I stop an experiment?

Everyone sees version A again and the results are kept. A stopped experiment does not restart.