--- title: "A/B testing" slug: "ab-testing" description: "Easily A/B test Userflow content with random attributes, optimizing user experiences and analyzing performance for better results." tags: ["Userflow Analytics"] updated: 2026-11-13T16:29:34Z published: 2026-11-13T16:29:34Z canonical: "help.userflow.com/ab-testing" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.userflow.com/llms.txt > Use this file to discover all available pages before exploring further. # A/B testing You can A/B test flows, buttons, checklist tasks and other Userflow content with a random attribute. Userflow gives each user a random value for that attribute, such as “A” or “B”, and you show each version only to users with the matching value. ## How do I create a Random A/B attribute? 1. Go to **Settings → Attributes**. 2. Click **New attribute**. 3. Enter a **Display name** such as “A/B Test Group”. 4. Click **Create attribute**. Random attributes are regular user attributes. See [Standard Attributes](/userflow/docs/standard-attributes) for how attributes work. ![Create Random A/B attribute](https://cdn.us.document360.io/9697557a-eb5d-476f-9b09-062b0f7bdcbd/Images/Documentation/create-random-ab-attribute.png) All users will now randomly be assigned an “A” or “B” value for their “A/B Test Group” attribute. You can see this attribute on users’ profile page. ![User with A/B attribute](https://cdn.us.document360.io/9697557a-eb5d-476f-9b09-062b0f7bdcbd/Images/Documentation/user-with-ab.png) This is a regular attribute, so you can of course use it anywhere else you can use attributes, such as filters in segments, filtering the Analytics page and in flow conditions. ## How users are assigned to an A/B group Userflow gives each user an “A” or “B” value for a Random A/B attribute at random. A user’s group is set once and never changes, so someone in group B stays in group B. ## Running more than one A/B test at the same time A Random A/B attribute keeps each user in the same group, so every experiment that uses that attribute splits users the same way. If two A/B tests both use “A/B Test Group”, the same users see version B of both. To keep experiments independent, create a new Random A/B attribute for each one, such as “Checklist test group” and “Welcome tour test group”. For more than two groups, use a Random Number attribute. See [Split-testing with more than 2 groups](/docs/ab-testing#split-testing-with-more-than-2-groups). ## How do I A/B test a flow? Here’s how to A/B test a flow that’s set to auto-start for specific users. 1. Start with the flow you already have. Rename it “Flow A” so it’s easy to tell apart (click the name at the top of the builder). 2. Click **Add condition** under **Auto-start flow**. 3. Choose **Attribute** in the popover menu. 4. Pick your Random A/B attribute, for example “A/B Test Group”. 5. Select **A**. 6. Create Flow B. The quickest way is to duplicate Flow A with the three-dot button in the top right of the builder, but Flow B can be any flow. For example, Flow A could be a modal and Flow B a speech bubble. 7. Name it “Flow B”. 8. In Flow B, set the “A/B Test Group” auto-start condition to **B**. If you duplicated Flow A, the condition is already there: click it and switch from **A** to **B**. If not, add it the same way as steps 2 to 4. 9. Make whatever variations to Flow B that you’d like. 10. Publish both flows. ![Flow builder](https://cdn.us.document360.io/9697557a-eb5d-476f-9b09-062b0f7bdcbd/Images/Documentation/flow-builder-a.png) Once the flows have been seen by enough users, you can use the [**Analytics** page](/userflow/docs/analytics) of each flow to decide which one performs best. Or use your analytics provider. When you pick a winner, unpublish the other flow, remove the “A/B Test Group” condition from the winner, and publish it again. ## A/B test buttons, checklist tasks and other content You can use a condition for the “A/B Test Group” attribute the same way in other places. For example, one flow can have two buttons, one for each group. Add a “Hide button if” condition on each button using the “A/B Test Group” attribute. ![Button testing](https://cdn.us.document360.io/9697557a-eb5d-476f-9b09-062b0f7bdcbd/Images/Documentation/button-testing.png) The same condition works in [checklist](/userflow/docs/checklists) tasks, [Resource Center](/userflow/docs/resource-center) blocks and [launchers](/userflow/docs/launchers). ## How do I split users into more than two groups? For more than two groups, create a **Random number** attribute instead: 1. Go to **Settings → Attributes**. 2. Click **New attribute**. 3. Enter a **Display name** such as “Split-test Group”. 4. Under **Between**, enter the number of groups you want. If you want 3 groups, then enter 3, which will make Userflow assign a random number between 1 and 3 (both included) to each user. 5. Click **Create attribute**. ![Create Random Number attribute](https://cdn.us.document360.io/9697557a-eb5d-476f-9b09-062b0f7bdcbd/Images/Documentation/create-random-number-attribute.png) Use the “Split-test Group” attribute in conditions the same way as a Random A/B attribute, with each flow set to a different number. ![Split test 3](https://cdn.us.document360.io/9697557a-eb5d-476f-9b09-062b0f7bdcbd/Images/Documentation/split-test-3.png) ## Send A/B groups to your analytics tool When a random attribute is assigned to a user, we also track an event containing the name of the attribute and the specific value that was randomly chosen. For **Random A/B** attributes, we track an event named `random_ab_assigned`. For **Random Number** attributes, we track an event named `random_number_assigned`. ![Events](https://cdn.us.document360.io/9697557a-eb5d-476f-9b09-062b0f7bdcbd/Images/Documentation/events.png) These events will be streamed into your analytics provider, such as Mixpanel, Heap, or Amplitude. If you have not set up your analytics provider yet, then see [Integrations](/userflow/docs/integration-old). Both events are listed with their attributes in [Userflow-generated events](/userflow/docs/userflow-generated-events). You can use these events in your analytics provider to filter users.