Skip to main content
Targeting in ABTestly is three separate questions.

Where does it run

URL rules. Applies to the page.

Who sees it

Visitor rules. Applies to the person.

When does it fire

On load, on click, when visible, or manual.
An experiment includes a visitor when all three match. Pages that do not match a Location are silently skipped. Visitors who do not match an Audience are silently skipped. If the Activation trigger is On click and they never click, the exposure never fires.

Where it runs (Locations)

A Location is a set of URL rules. The visitor’s current URL is tested against them. A rule can match on:
  • Full URL, hostname, path, or query string, with equals, contains, starts with, ends with, or regex, plus their negations.
  • Case sensitivity is per-rule. New URL rules default to case-insensitive. See URL rules for the details and the migration story.
You can define rules inline on an experiment, or you can save a Location once and attach it to many experiments. Saved locations live under Site → Locations and are the right pick as soon as you have more than one test on the same set of pages.

Who sees it (Audiences)

An Audience is a set of visitor rules. Rules can match on:
  • Device, browser, operating system.
  • Geo, country from a curated list, plus region and city (both case-insensitive text).
  • Language the browser prefers.
  • Visitor history, new vs returning, visit count, days since last visit, pages viewed this session, whether they have completed a specific goal already.
  • Traffic source, referrer, and UTM source, medium, campaign, term, content.
  • Time of day and day of week in the site’s project timezone.
  • Cookie value or a custom JavaScript condition you write.
Like Locations, an Audience can be inline or saved. Saved audiences live under Site → Audiences.

When it fires (Activation)

Activation decides the moment the exposure event fires and the variant applies. That timing matters for two reasons: it is the number that lands in your funnel, and it is the point at which the variant’s JavaScript runs. The modes are:
  • On load (default), fires immediately as soon as the page’s other targeting rules match.
  • On click, waits for a click on a CSS selector, then fires.
  • When visible, waits until an element is at least 1 % on-screen, then fires.
  • Manual, waits for your own code to call abtestly.activate("your-key").
If you have never picked a non-default mode, you have been using On load. See Activation triggers for when to reach for the others.

Mutual exclusion groups

Two experiments that touch the same button in different ways would be a mess if a visitor could enter both at once. Exclusion groups solve that. Members of a group are partitioned so that any visitor can enter at most one. This has to be opt-in per experiment; ABTestly will never quietly bucket one of your tests out of another.

The mental picture

If your experiment never seems to fire, walk that diagram. Nine times out of ten the answer is one of the first three diamonds.