Skip to content
MocklyDocs

Test

Automatic allocation

Let an experiment move its traffic toward the variant that's doing best, with results that stay fair while the split moves.

Paid traffic costs money. A test split 50/50 sends half of it to whichever variant is losing, for as long as the test runs. With automatic allocation, an experiment moves its split toward the variant that's doing best, so fewer visitors see a losing variant on the way to a verdict.

It's a choice for each experiment, and off to begin with. An experiment keeps the split you gave it until you turn this on.

Turn it on#

  1. Open the experiment on the Experiments page.
  2. Under Setup, click Edit beside Traffic.
  3. Choose Automatic in place of Fixed split. The editor says what it will do before you save: what the split moves toward, how often, the least a variant gets, and what it costs.
  4. Click Save…, then Turn on.

The split starts from where it is now. Turning it on doesn't restart the results, and everyone keeps their variant. While it's on, the Traffic row carries an Automatic badge, and the split isn't yours to set: to set it yourself, go back to a fixed split.

It moves traffic between the variants that have some. A variant at 0% was turned off by hand, and stays off. With only one variant left, the editor says why it can't be turned on, and to give a second one some traffic first.

How the split is set#

Each variant's share of new visitors is the chance it's the best one on the experiment's goal, given the results so far. For most experiments that's by conversion rate; for one with metric="revenue", by revenue per visitor. The rule is called Thompson sampling.

A variant that's probably the best gets most of the visitors. One that still might be keeps enough to find out. With two variants, if bold is 80% likely the best, it gets 77% of new visitors and control gets 23%.

  • The chance is worked out, not drawn at random, so the same results always give the same split.
  • Only new visitors are placed by it. Visitors who already have a variant keep it, as with any change of split. See Sticky assignment.

Every variant keeps a minimum share#

About one visitor in ten stays spread evenly over the variants, whatever the results say. So no variant goes below 5% with two variants, or 3% with three, and never below 1%. The rest is shared out by each variant's chance: in the example above, 5% each, and the other 90% by 80 and 20.

No variant is dropped. One that falls behind after an unlucky start can still catch up, and every variant is measured in every period, which is what keeps the results fair.

When it moves#

  • At most once a day, so each stretch with one split covers every hour of a day.
  • Only once every variant has had 100 visitors since the split last moved. A quiet site's split moves less often than daily.
  • Not while the experiment is paused, or shipped.
  • Not while the traffic split doesn't match the weights. Numbers that can't be trusted don't move traffic. See The traffic split check.
  • A revenue experiment waits until there's revenue to compare the variants by.

Mockly looks at each experiment about every hour, so a split that's due moves within the hour. No email is sent for a move: the experiment's change history records each one.

Results stay fair#

A move doesn't restart the results. Each stretch with one split is a period, and once the split has moved, the results are weighted by period.

They have to be. Automatic allocation sends more traffic to a variant when it looks good, and a lander has days when everything converts better: a sale, a weekend, a new ad. Count all the visitors together, and a variant gets credit for the days it had the traffic. Here, two variants convert exactly the same, and the split moved before a weekend sale:

PeriodSplitcontrolbold
Weekdays50 / 5030 of 1,000, 3.0%30 of 1,000, 3.0%
Weekend sale23 / 7746 of 460, 10.0%154 of 1,540, 10.0%
Counted together76 of 1,460, 5.2%184 of 2,540, 7.2%
Weighted by period6.5%6.5%

Counted together, bold looks 39% better, only because more of its visitors came during the sale. Weighted, each period's rates count by the period's share of all the visitors, the same share for every variant: half and half here, so both come to 6.5%. Within a period the split is fixed, so its variants are compared fairly, and no variant gets credit for when its visitors came.

In Mockly's simulations, with two variants that don't differ and a conversion rate that rises over two weeks, counting together named a false winner about 70% of the time. Weighted by period, it was 2 to 3%, under the 5% the intervals promise.

What's weighted, and what isn't:

  • As counted: each variant's visitors and conversions.
  • Weighted: each rate and its interval, the lift, the difference, the verdict, secondary goals, guardrails, each day of the charts, and each segment.

A few things follow:

  • A variant whose visitors came mostly in a few periods is known less well than their number suggests, and its intervals are as wide as that.
  • A period counts on its own once every variant has 100 visitors in it. A shorter one is counted with the periods next to it.
  • With one period, the numbers are exactly as counted. An experiment whose split never moved reads as it always did.
  • The traffic split check reads each period against its own split.
  • There's no "How long to run" for an experiment with automatic allocation on, or whose split it moved. That estimate assumes the split stays.

The periods start over, with the results, whenever the results restart: a split you set by hand, a change to the audience, the personalized groups, or the exclusive group, Restart results, or a publish that starts a new revision. A finished run keeps its periods in Past runs.

What the studio shows#

  • The Automatic badge beside the split, under Setup.
  • Automatic allocation, a card under the results. It has each variant's chance, such as "80% likely the best", with its share, "77% of new visitors". It says what the split is waiting for, such as a variant that hasn't had 100 visitors since the last move, or the split it's moving to within the hour. Once the split has moved, it lists the split period by period, newest first, each with its visitors.
  • The results table. Once the split has moved, a variant's share of traffic says "now 77%" where a fixed split says "target 50%", and a note under the table says the rates and lifts are weighted, and why.
  • Change history records turning it on and off, with who did, and each move as Traffic moved: the split before and after, and the variant it favored, by "Automatic allocation".
  • How these are calculated says how the results were weighted, in place of the plan.

A client report shows the card too.

What it costs#

A verdict takes longer than at a fixed split. The variant that's behind gets fewer visitors, so it takes longer to measure. In exchange, fewer of the visitors you paid for see it.

Keep a fixed split when you want the answer as soon as possible. Turn this on when the traffic is expensive, and what a losing variant costs you along the way matters more than a few more days.

It never ships a winner#

Automatic allocation moves traffic and nothing else. It doesn't ship a variant, and it doesn't stop a test when one variant is all but certain: that variant gets most of the traffic, and the others keep their minimum. Shipping is still yours. See Shipping a variant.

A guardrail that's hurt still alerts you, or pauses the experiment, as you set it. See Guardrails.

Going back to a fixed split#

Click Edit beside Traffic, choose Fixed split, click Save…, then Use a fixed split. The split stays where automatic allocation left it, until you change it. The results don't restart, and they keep their periods.

Moving the sliders to a split of your own in the same edit turns automatic allocation off too, and restarts the results, as a new split always does.

The setting belongs to the studio, like the split itself. A publish never changes it. A publish that starts a new revision keeps it on, and starts again from the weights in your code.

Exports#

Export, on an experiment, has what you need to work the results out again elsewhere:

  • Daily totals (CSV) and One row per visitor (CSV) each have a phase column: the split that placed the row's visitors. Summed, the rows are the results as counted. Grouped by phase, they're the periods the results weight.
  • Results (JSON) has each period's split, when it began, and its visitors, and says how the results were weighted.

Limits#

  • The pace is fixed. You can't choose how often the split moves, the minimum share, or how many visitors a period needs.
  • One split for everyone. There's no split per device, source, or ad.
  • No chart of the split over time. The card lists the periods.