# Running an A/B experiment

URL: https://kywi-docs-production.up.railway.app/targeting/running-an-ab-experiment
Type: docPage

What it takes for a wrapped section to really split traffic: an experiment created in Admin, named on the container, matching arm keys, and started.

Wrapping a section into **A/B Test (weighted split)** mode does not create an experiment. It creates a container with a placeholder experiment id in it, and until that id names a real experiment and the arms carry that experiment's variant keys, every visitor sees the Default arm.

## Wiring the container to a real experiment

Three things have to line up, and only the first is done for you:

1. The experiment itself exists — created under **Admin → Audience → Experiments**, with its arms and their traffic splits.
2. The container's **Experiment id** field names it. That field is free text and starts life holding a generated placeholder, so it will look filled in when it is pointing at nothing.
3. Each arm's **Variant key** matches the **Variant key** of a variant on that experiment. In A/B mode this field is free text rather than an audience picker, because what the renderer matches against is the key the visitor was assigned.

When a page renders, the ids on its containers are looked up among the site's running experiments. An id that finds nothing is not an error and produces no warning — the container simply renders its Default arm, exactly as it would with no test at all.

## The splits have to add up — and the admin will not let them not

Each arm's share is a *whole-number* percentage, and the arms on one experiment must sum to exactly 100 with none negative. You will not discover this by saving: the experiment form keeps a running **Total: N%** beside the arms that turns red the moment it leaves 100, shows *"Traffic splits must sum to exactly 100% (currently N%)"*, and disables Save until it does.

## The weights on the container are a different number

The arm weights in the section container's own panel are not the experiment's traffic splits. They are an *advisory* description of the intended division, checked loosely enough to accept 33 / 33 / 34, and nothing enforces them at save time. The authoritative split — the one that actually decides who sees what — is the one on the experiment record. When the two disagree, the experiment wins; see [Personalizing or A/B testing a section in place](/editing/personalizing-or-ab-testing-a-section-in-place/) for the container side.

## How a visitor lands on an arm

Assignment hashes the experiment's id together with the visitor's id and takes a bucket from 0 to 9,999, then walks the arms' cumulative splits in a fixed order. Including the experiment id in the hash means the same visitor buckets independently across concurrent experiments, so two tests running at once do not correlate. There is no stored assignment anywhere — the same two ids always produce the same arm.

## Stickiness is only as durable as the visitor id

Stickiness rests entirely on the `kywi_visitor` cookie, a **personalization** cookie a non-consenting visitor doesn't keep, so their arm re-draws on every page view — see [What consent does to your targeting](/targeting/what-consent-does-to-your-targeting/).

## Draft and paused mean Default, not control

A draft or paused experiment loads no assignment, so the container falls back to **Default** — see [The default arm is the real page](/targeting/the-default-arm-is-the-real-page/) for why that isn't the same as control.

## Assigned and counted are two decisions

Every visitor is assigned an arm regardless of consent; only the exposure gets gated by it.

## Who can do which part

Creating, starting, pausing or completing an experiment needs **site admin**; reading results needs only **editor** — see [Roles and the capability matrix](/governing/roles-and-the-capability-matrix/).
