---
title: "Assign traffic to headless A/B/n test variants"
slug: "assign-traffic-to-headless-abn-test-variants"
abstract: "Learn how to assign traffic across variants in a headless A/B/n test."
---

# Assign traffic to headless A/B/n test variants

> [!important]
> Feature availability is part of a phased rollout. Your organization may not see this functionality yet. It will become available when your environment is included in the rollout.

Before you start a headless A/B/n test, decide how participating visitors are split across the variants.

For example, in a test with two variants, you can assign:

- 50% to the control
- 50% to the other variant

SitecoreAI keeps the assignment consistent, so returning visitors continue to see the same variant.

Variant assignment happens server-side, which helps avoid visible flicker when the experience is rendered.

To assign traffic to variants:

1. Open the A/B/n test you want to [edit](https://doc.sitecore.com/sai/en/users/sitecoreai/headless-personalization-and-abn-testing/edit-a-headless-experience.html).

2. In the **API response** section, click **Edit traffic**.

   > [!note]
   > By default, a test with two variants assigns 50% of traffic to Variant A (Control) and 50% to Variant B. Additional variants are initially assigned 0% traffic.

3. Set the percentage assigned to each variant. 

   Each variant must have at least 1% of traffic assigned, the total must equal 100%, and percentages must be whole numbers.

4. Optionally, if the test has more than two variants, click **Assign traffic equally to all variants** to distribute traffic as evenly as possible.

   For example, for Variants A, B, and C, SitecoreAI assigns 34%, 33%, and 33%, respectively.

5. Click **Save**.

The updated traffic assignment is applied to the test.

## Next steps

After you configure traffic assignment, you can:

- [Edit advanced options](https://doc.sitecore.com/sai/en/users/sitecoreai/headless-personalization-and-abn-testing/edit-advanced-options-for-a-headless-abn-test.html).
- [Set automated actions](https://doc.sitecore.com/sai/en/users/sitecoreai/headless-personalization-and-abn-testing/set-automated-actions-for-a-headless-abn-test.html) to define what happens based on the test outcome.