What Are Metrics?
A metric is how A vs B turns a tracked event into a winning-variation signal — the analysis layer that says "count unique visitors who fired this event," "measure their average value," or "take the 95th-percentile duration." Metrics turn "we showed different designs to different visitors" into "this design caused 23% more sign-ups."
Primary vs secondary metrics
Every experiment in A vs B has exactly one primary metric. This is the single measurement that determines which variation wins. When A vs B calculates a winning probability and declares a winner, it uses only the primary metric.
You can also add secondary metricsto any experiment. These are additional measurements that provide supporting context. For example, your primary metric might be "purchases," and your secondary metrics might be "add to cart clicks" and "product page views." Secondary metrics help you understand the full picture — they show you what else changed as a result of your experiment — but they do not affect which variation is called the winner.
The three metric types
A vs B offers three types of metrics, each designed for a different kind of conversion event.
Click metrics
Click metrics fire when a visitor clicks on a specific element on your page. You identify the element using a CSS selector — the same syntax you use in stylesheets. This is the simplest way to measure button clicks, link clicks, or any other interactive element.
Example use cases: clicking a "Sign up" button, clicking an "Add to cart" link, clicking a navigation item.
Pageview metrics
Pageview metrics fire when a visitor navigates to a URL that matches a pattern you define. You can match by path prefix, exact URL, substring, or a regular expression. This is useful when a conversion is represented by reaching a specific page — like a thank-you page after checkout, or a confirmation page after signing up.
Example use cases: visiting /thank-you, reaching /order-confirmation, landing on any page under /account/.
Custom events
Custom events fire when you call avsb.track.event()from your own JavaScript code. You decide exactly when a conversion happens by placing this function call at the right moment in your application — for example, inside a form's submit handler, after an API response succeeds, or when a user reaches a specific scroll depth. Custom events also support passing a revenue amount, which unlocks Revenue Impact calculations in your results.
Example use cases: form submissions, purchases, video completions, subscription upgrades.
Metrics are defined at the project level
Metrics belong to a project, not to an individual experiment. You create a metric once in the project's Metrics page, and then you can attach it to any experiment within that project. This means you do not have to recreate the same "Purchase completed" metric for every experiment — you define it once and reuse it everywhere.
If you edit a metric (for example, changing its CSS selector), that change takes effect immediately across all experiments using it. Use caution when editing metrics that are attached to running experiments.
One conversion per visitor
Each metric records at most one conversion per visitor. If a visitor clicks a button three times, A vs B counts that as one conversion, not three. This prevents power users from skewing your results and keeps the conversion rate calculation meaningful.
Live 30-day preview in the picker
When you pick a measure inside the experiment builder, the picker shows a small Last 30 dayscard alongside the per-measure configuration. The card calls the project's historical event store, debounces by 300ms as you tweak inputs, and renders what the metric would have been across the rolling 30-day window: a percentage for conversion rates, a count for total events, a per-visitor value or a percentile snapshot otherwise. If no events have fired in the last 30 days, the card says so explicitly so a zero result is never mistaken for a broken read. Composite and rate measures don't expose a single-measure preview — the picker falls back to a small explainer in those cases.