# A/B/n Split

<YouTube id="hYiwYBOLu64" playlabel="Youtube Video: Learn how to set up and analyze A/B/n tests in Pushwoosh Customer Journey Builder"/>


Use the **A/B/n Split** element to test which message sequences perform best for your [Conversion Goals](/product/customer-journey/journey-settings#conversion-goals). Optimize communications by finding the most effective approach for your audience.
<img src="/journey-elements-running-a-b-n-tests-1.webp" alt="A/B/n Split element on the journey canvas"/>

## Configure A/B/n split settings

After placing the **A/B/n Split** element on the canvas, double-click it to configure test settings.

### Set the number of branches

Use the **Branches** dropdown to choose how many variations you want to test (up to 4). By default, Branch A is the control group.

#### Define user distribution across branches

Set the percentage of users to be routed to each branch, ensuring the total adds up to 100%. To evenly split users between branches, click **Reset Distribution**.
<img src="/journey-elements-running-a-b-n-tests-14.webp" alt="Configure branches and define user distribution across branches"/>

### Choose how the winner will be selected

You have two options:

##### You select the winner manually

You will review results and manually choose the winning branch later. This requires ongoing monitoring and manual deactivation. [Learn more](/product/customer-journey/journey-elements/flow-controls/abn-split/#analyze-the-results)
<img src="/journey-elements-running-a-b-n-tests-16.webp" alt="Manual winner selection setting in A/B/n Split test configuration"/>
##### The winner is selected automatically by goal

The system monitors the campaign goal and deactivates weaker branches once statistical significance is achieved. New users are then directed to the winning branch.

When automatic winner selection is enabled, choose how the system should evaluate the winner:

* **First goal to achieve significance**. The system monitors all assigned goals and selects the first to reach statistical significance.  
    
* **Select a specific goal** (for example, `CheckoutSuccess`). This goal will be used to evaluate which branch performs best.
<img src="/journey-elements-running-a-b-n-tests-17.webp" alt="Automatic winner selection by goal in A/B/n Split settings"/>  

Once configured, click **Save** to apply your test settings.

## How to set up and run A/B/n tests
### Set up a test
#### Pause the journey
If you want to set up A/B/n testing in an active journey, pause it first. To learn more about editing an active journey, [read this article](/product/customer-journey/journey-editing/#editing-an-active-journey).
#### Define at least one Conversion Goal
Set at least one Conversion Goal that will be used for calculating test results. For example, if you want to test which of two push notifications is the most effective, you can set the _PW\_InAppPurchase_ Event as the Conversion Goal.

<img src="/journey-elements-running-a-b-n-tests-2.webp" alt="Set a Conversion Goal for the A/B/n test"/>

If you specify several Conversion Goals, the results are calculated for each goal separately.
#### Add the A/B/n Split element
Place the **A/B/n Split** element to the canvas after any other element and double-click it to configure the test.

<video src="/journey-elements-running-a-b-n-tests-3.webm" title="Add the A/B/n Split element to the journey canvas" autoplay loop muted playsinline />
#### Set branches and user distribution
Select the number of branches. You can add up to four branches to your test. The first branch is always considered a control group against which results in other branches are compared. Keep following this guide to learn how to set up this branch depending on your needs.

<img src="/journey-elements-running-a-b-n-tests-4.webp" alt="Set the number of branches for the A/B/n test"/>

Next, set the percentage of users going to each branch. The total of all branches should be 100%. According to the percentage you set, users in the journey who reach this step will be split randomly into the specified number of branches.

Please note that users assigned to Branch A will be considered a control group against which results in other branches will be compared. The next step describes how to set up Branch A for different cases.

<Aside type="note">
You may want to set a higher percentage for Branch A (the original version) to carefully test a new campaign version without risking lower conversions.

However, we recommend setting up an **even distribution**. In this case, you will get statistically significant results faster.
</Aside>

<img src="/journey-elements-running-a-b-n-tests-5.webp" alt="Set user distribution across branches"/>
#### Select winner evaluation mode
Choose how the winner is determined:

- **Automatic selection by goal.** The system tracks a defined goal, detects the best-performing branch using statistical significance, and routes new users to the winner automatically.
- **Manual selection.** You will review the test results and manually decide which branch performs best. This option requires you to monitor the test and deactivate underperforming branches manually. [Learn more](/product/customer-journey/journey-elements/flow-controls/abn-split/#analyze-the-results)
#### Configure content for each branch
Now you can set up communication flows for each branch. Since Branch A is a control group, you need to configure it in a certain way depending on your case:

* **Test the existing communication flow against new versions.** In this case, the existing version should be in Branch A. Also, ensure the Conversion Goal can be completed in any branch, including Branch A.
* **Test only new versions against each other.** Since there is no old communication flow, one of the new versions will be marked as a control group (the one presented in Branch A). Make sure the Conversion Goal can be completed in all branches.
* **Test an existing version without any communication against new communication flows.** For example, you want to add one more push at the end of a journey to see if the campaign performance increases compared to the original version without this push. In this case, the ‘empty’ version should be presented in Branch A. To get reliable results, add an equal [Time Delay](/product/customer-journey/journey-elements/#time-delay) to each branch:

<img src="/journey-elements-running-a-b-n-tests-6.webp" alt="Configure branches with different communication flows for testing"/>
#### Launch the journey
If everything is ready, launch the journey.

### Analyze the results

As soon as the test is launched, you can see real-time statistics on it.

On the journey canvas, see the number of users who pass through each branch:

<img src="/journey-elements-running-a-b-n-tests-7.webp" alt="View user count for each branch on the journey canvas"/>

To view the test results, double-click on the **A/B/n Split** element. You will see the statistics for each branch, including the conversion to the selected goal and the metrics used to calculate statistical significance.

<img src="/journey-elements-running-a-b-n-tests-8.webp" alt="A/B/n test statistics for each branch" width="563"/>

If you have set several Conversion Goals, you can view the results for each of them by selecting the required Goal from the list:

<img src="/journey-elements-running-a-b-n-tests-9.webp" alt="Select a Conversion Goal to view specific test results" width="563"/>
<Aside type="tip" title="Automatic mode">
If you enabled automatic winner selection, Pushwoosh will continuously monitor the selected goal. Once one branch reaches statistical significance, it will be marked as the winner. Weaker branches will be automatically deactivated, and new users will be routed exclusively to the winning branch. No manual action required.
</Aside> 
If your test has a statistically significant winner and you are using manual winner selection, you can instantly turn off less-performing branches by clicking **Keep only winner**. New users in the journey will be directed to the winning branch. Users who already went to deactivated branches will continue going through them until they complete the journey.

<img src="/journey-elements-running-a-b-n-tests-10.webp" alt="Keep only winner option in manual winner selection"/>

<Aside type="note">
You can also [deactivate branches manually](#deactivating-branches), but this requires pausing the journey.
</Aside>

You can view test results for a specific period of time. To do this, select the desired period on the left panel and double-click on the **A/B/n Split** element. You will see the statistics for the specified time.

<img src="/journey-elements-running-a-b-n-tests-11.webp" alt="View test results for a specific time period"/>

The test results are calculated as follows:

* The **conversion** is calculated based on the number of users in the branch and the Conversion Goals completed. Branch A will be marked as the Baseline, as it represents the control group.
* When calculating **statistical significance**, _Z-Score_ and _P-Value_ are taken into account. If the result is valid, it will be marked as _Significant_.
* A branch is considered the **winner** if it has the highest conversion, and this result is marked as _Significant_.

<Aside type="note">
If the result is marked as _Significant_, it means that its confidence level is 90%. If this percentage is not enough for you, you can calculate the result by specifying a different confidence level. For example, you can use this [calculator](https://abtestguide.com/calc/).
</Aside>

### Deactivate branches
<Aside type="tip" title="Automatic mode">
In Automatic mode, if a statistically significant winner is identified, Pushwoosh will automatically disable underperforming branches, route all new users to the winning branch, and allow existing users to continue in their assigned branch until they complete the journey. No manual action is required.
<img src="/journey-elements-running-a-b-n-tests-18.webp" alt=""/>
</Aside>

If Pushwoosh has identified a statistically significant winner, you can instantly turn off less-performing branches by clicking **Keep only winner** in the test statistics window. In this case, you don't need to pause the journey.
If some branch performs poorly, you can deactivate it. New users will no longer get into the deactivated branch.

To deactivate a branch, pause the journey first:

<img src="/journey-elements-running-a-b-n-tests-12.webp" alt="Pause the journey to deactivate a branch"/>

After that, double-click the **A/B/n Split** element. Set 0% for this branch and redistribute the percentage of users going to the remaining branches:

<img src="/journey-elements-running-a-b-n-tests-13.webp" alt="Deactivate a branch by setting its user distribution to 0%"/>