How to choose an A/B test primary metric and who to count

Choose one A/B test primary metric close to your change and define who is counted. A table by page type gives the metric, the group and what to watch.

· 9 min read

An A/B test primary metric is the one number that decides the test. Choose the result your one change is meant to move, measured as close to the change as you can. Then define who is counted: the people assigned to the test who reach the page with the change, the same group in both variants.

Agree on both, the metric and its denominator, before the test starts. The table further down gives a starting metric for each common page type, with who to count and what to watch.

What the primary metric decides

The primary metric is the number you agree to act on before launch. Amplitude’s experiment docs put it this way: “A primary metric determines whether to accept or reject your hypothesis, and whether your experiment succeeded or failed.” The same role applies whatever tool runs the test.

One test gets one primary metric. Other numbers can explain the result, but they don’t overrule it. If you watch five metrics and pick the one that moved, the test no longer has a decision rule.

The primary metric is also not the click on the thing you changed. Optimize Peak’s help page says it is “the result the change should improve, such as orders per visitor, not clicks on the changed element.” A bigger button can draw more clicks on itself while the same number of people take the next step. What you want to know is whether more people take the step that matters.

Pick the metric closest to the change that still matters

Pick the action your one change targets, at the closest point where that action becomes valuable. Two vendors give this advice in their own docs. Amplitude warns against defaulting to revenue when the change has little to do with revenue. Optimizely’s guide to primary metrics says: “Consider setting a primary metric on the same page as your change.”

The reason is signal. In Optimizely’s words, “The measurable impact is bigger when an event is closer to the change.” Each step down the funnel adds visitors who arrived by other paths, and their behavior blurs the effect.

Microsoft’s experimentation team reaches a similar view from the other side. Its article on the properties of a good metric says broad metrics such as days active are hard to improve quickly. It calls them “poor indicators of success, but they are good guardrails.”

Close to the change is not the same as trivial, though. A metric right next to the change can rise while nothing good happens. Three checks settle the choice.

First, Variant B should aim at this action. If the change is a warranty line on a product page, the action is adding to cart, not reading the line. Second, the action should happen on the page or one step after it. Five pages later can mean a long test or an unclear result.

Third, a rise should be good for the business if nothing else gets worse. If more clicks could mean less qualified people, move one step further down.

Sometimes one ratio is not enough. For a bulk-discount test, Optimizely’s guide picks revenue per visitor. It explains that revenue per visitor “equals the conversion rate (how often customers purchase) multiplied by the AOV (how much they spend).” A discount that changes both how many people buy and how much they spend needs a metric that holds both.

Who is counted: the denominator of your metric

Who is counted is the group your primary metric divides by. “Add-to-cart rate” means nothing until you say per whom: per visitor to the site, per visitor to the product page or per session. Optimize Peak’s help page gives the rule: “It has to be the same group in A and B, or the comparison isn’t fair.”

An Optimize Peak test's details: the one change, and who is counted, written as shoppers assigned to the test who open the cart.
Who is counted, written into a test: shoppers who open the cart, the same in both arms. From Optimize Peak's example tests.

Four decisions define the group:

  • Who enters. Count people assigned to the test who reach the page where the change appears. People who never see that page can’t be affected by the change. They add noise to both arms and make a real difference harder to detect.
  • The same rule in both arms. In Variant A the change doesn’t exist, so you can’t count “people who saw the new element.” Count people who reached the place where it would have been.
  • The unit. Count people, not sessions or page views, unless the change works per visit. A returning visitor who counts three times weighs three times as much.
  • The window. Say when the clock starts and stops, for example from the first page view in the test to 7 days later. Compare the arms only once both have had the same full window.

Microsoft’s guide to diagnosing sample ratio mismatch shows the second point with a checkout example. For a new coupon code field, “it might be valuable to analyze only the users that actually visited this page.” For a faulty setup, its fix is to count visitors of the page, not users of the new field. The new field exists only in the treatment, so counting its users makes the two groups different by design.

The team’s post-experiment guide explains how to count a control user correctly. With the right logging, “we can determine whether a user in control would have seen the change if they were in the treatment.” In practice, log the page view or the moment the change would appear, in both arms.

Testing tools make the denominator explicit too. GrowthBook’s metrics documentation says its mean metrics always divide by the number of users in the experiment variation. Its ratio metrics take a custom denominator, such as orders for average order value. Check which one your tool uses before you read a result.

The unit also changes what a result can show. Microsoft’s metrics article notes that a “proportion of users with a click” metric rises when non-engaged users start clicking. When already-engaged users engage more, “it may not show an increase.” Choose the unit that matches the behavior your hypothesis expects to change.

Primary metric by page type

Each page type has a job, and the primary metric follows that job. Each row gives a starting metric, the group it divides by and the second number to keep an eye on. Adjust them to the one change you’re testing. For the test ideas themselves, see A/B testing ideas by page type.

Page type Primary metric Who is counted What to watch
Landing page Form submissions per visitor Visitors who open the landing page Share of qualified leads
Homepage Visits to the next key page per visitor Visitors who land on the homepage Orders or sign-ups per visitor
Sign-up form Completed sign-ups per visitor Visitors who open the form page Accounts that activate
SaaS pricing page Trial or plan starts per visitor Visitors who open the pricing page Refunds or downgrades
Product page Add-to-cart rate Visitors who open the product page Return rate
Comparison page Add-to-cart rate from that page Shoppers who open the comparison page Return rate
Cart Average order value or orders per shopper Shoppers who open the cart Checkout completion rate
Checkout Orders per shopper who starts checkout Shoppers who reach the first checkout step Payment errors
App screen Users who complete the target action Users who reach the screen Week-one retention

The pattern is the same in every row. The metric sits at the page or one step after it, and the group starts where the change can first be seen. The last column is the number that must not get worse while the first one improves.

Two rows need care. A homepage often has no action of its own, so its metric is the next page it sends people to. A cart test aimed at order value uses a ratio whose denominator is orders, which the change itself can move.

Hypothetical example: when the change moves the denominator

This hypothetical example uses invented numbers for a cart test. Variant B adds a free-shipping progress bar above the item list. The primary metric is average order value (AOV), and 8,000 shoppers per arm open the cart.

AOV divides revenue by orders. If the bar sends some shoppers back to browse and a few never return, the order count falls. AOV can then rise even if the shop earns less. Revenue per shopper who opens the cart catches this, because its denominator is fixed by who is counted.

Arm Orders AOV Revenue per shopper
Variant A 2,400 $60.00 $18.00
Variant B, case 1 2,250 $66.00 $18.56
Variant B, case 2 2,100 $66.00 $17.33

Variant B’s AOV is 10.0% higher in both cases. Only the order count changes between the two cases, while shoppers, AOV and Variant A stay fixed.

Bar charts: average order value is $60 for A and $66 for both B cases; revenue per shopper is $18.00, $18.56 and $17.33.
The same AOV gain earns more in case 1 and less in case 2. Only the order count changed.

In case 1, orders fall 6.3% and revenue per shopper rises 3.1%, so the shop earns more.

In case 2, orders fall 12.5% and revenue per shopper drops 3.8%. The same AOV gain now costs money.

Figures are rounded half up, rates to one decimal place and money to the cent. The example shows arithmetic only, not significance. A real test also needs enough shoppers for the difference to be distinguishable from noise.

Two setups handle this case. You can keep AOV as the primary metric and set checkout completion as what to watch, with a limit agreed before launch. Optimize Peak’s example tests do this for the same free-shipping bar.

The other setup makes revenue per shopper who opens the cart the primary metric. Either way, write the denominator down before launch.

What to watch next to the primary metric

What to watch, often called a guardrail metric, is the second number that must not get worse while the primary metric improves. It catches a win that costs you somewhere else, such as more orders with more returns. Set it and its limit before launch, like the primary metric. Choosing guardrails by page type and setting their limits is covered in guardrail metrics for A/B testing.

Write the metric into the hypothesis before launch

Choose the primary metric before any data comes in, and write it into the hypothesis together with who is counted. One line is enough:

If <the one change>, then <primary metric> rises among <who is counted> over <window>, because <reason>, while <what to watch> stays within <limit>.

For a product page, it could start: “If the first screen states the warranty, add-to-cart rate rises among product page visitors over two full weeks.” The reason and what to watch complete it. Filled examples for other page types are in A/B test hypothesis examples.

Before you launch: a five-line metric check

Run this check on your next test plan before anyone builds Variant B:

  • The primary metric is one number, chosen before launch.
  • It measures the action the one change targets, on the page or one step after it.
  • Who is counted is written down: who enters, the same rule in both arms, the unit and the window.
  • If the metric is a ratio, its denominator can’t be moved by the change, or what to watch covers that risk.
  • What to watch has a limit agreed before launch.

For a first draft of these lines, Optimize Peak turns a screenshot of your page into up to four single-change tests. Each one lists the primary metric, who is counted and what to watch. It sees only the screenshot, not your traffic, so check the metric against your own data. The first scan is free at Optimize Peak.

More from the blog