> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abtestly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Audiences

> Every visitor rule ABTestly ships. Device, geo, source, history, and a handful of custom escape hatches.

An Audience is a set of visitor rules. Rules combine with AND. Leave
the Audience blank on an experiment to include everyone.

![Audiences list](https://mintcdn.com/abtestly/pnpJFDTFa50Ks6SL/images/audiences-list.png?fit=max\&auto=format\&n=pnpJFDTFa50Ks6SL\&q=85\&s=6e6ed97b998a9ba149b076e4d50efdb1)

Saved Audiences under Site → Audiences.

## Visitor category

* **Device**, Desktop, Mobile, Tablet. Multi-select.
* **Browser**, Chrome, Safari, Firefox, Edge, Opera, others.
* **Operating system**, Windows, macOS, iOS, Android, Linux, others.
* **Language**, the visitor's preferred `Accept-Language`.

Device/browser/OS are derived server-side at ingest from the user
agent. Client-side spoofing does not fool the categorization.

## Geo

* **Country**, multi-select from the ISO list.
* **Region**, case-insensitive text match.
* **City**, case-insensitive text match.

Geo is looked up at the edge (`GET /g`) once per session, cached, and
served from Cloudflare's country/region/city data. Bounded wait of
250 ms, if the lookup times out, the visitor is treated as
"unknown country" and geo-dependent rules do not match. See
[Geo](https://docs.abtestly.com/targeting/geo.md) for the failure-mode details.

## Visitor history

* **New vs returning**, a 30-minute gap defines a new session.
* **Visit count**, how many sessions this visitor has had on your
  site.
* **Days since last visit**.
* **Pages viewed**, this session.
* **Has completed goal X**, whether the visitor has ever converted on
  a specific goal in your library.

History rules require the site to have the
[behavioral substrate](https://docs.abtestly.com/developer/spa-lifecycle.md) turned on. It is on
by default for sites created after mid-2026.

## Traffic source

* **Referrer**, the `document.referrer` header.
* **UTM source** / **medium** / **campaign** / **term** / **content**.

Referrer is bucketed into a friendly source ("google", "facebook",
"direct") for the picker, but you can also match on the raw hostname.

## Time

* **Day of week**, Mon through Sun, multi-select.
* **Hour of day**, 0–23, multi-select.

Both are evaluated in your **project timezone**. Set the timezone
under [Settings → General](https://docs.abtestly.com/settings/general.md).

## Custom

* **Cookie value**, read a cookie by name, match on its value.
* **JavaScript condition**, a boolean expression you write. Evaluated
  on the page each time the audience is checked.

> [!WARNING]
>
> JavaScript conditions run in the same context as your other page
> scripts, and are evaluated with `new Function`, so they need
> `unsafe-eval` in your CSP if you have one. So does variation
> JavaScript, so avoiding these conditions does not on its own keep
> `unsafe-eval` out of your policy. See
> [Content Security Policy](https://docs.abtestly.com/install/snippet.md#content-security-policy).
> Prefer a cookie or a data attribute where you can anyway, they are
> easier to reason about.

## Location vs Audience

If your instinct is "match on URL", that is a Location rule, not an
Audience rule. See [URL rules](https://docs.abtestly.com/targeting/url-rules.md).

If your instinct is "match on the visitor", it is Audience. Everything
else on this page.

## Saved audiences

You can define an Audience inline on an experiment, or save one under
**Site → Audiences** to reuse. See
[Saved lists](https://docs.abtestly.com/targeting/saved-lists.md) for when to reach for a saved
Audience.

## Silent rule failures

An Audience that never matches, because a rule references a cookie
that does not exist, or a JavaScript condition that always throws.
silently excludes every visitor. The experiment then looks like it
"is not running". If yours seems to have zero exposures after a
sensible amount of time, walk the audience rules one by one against a
[preview link](https://docs.abtestly.com/preview/preview-modal.md). When an experiment does not match
the page you are on, the preview badge says so directly. Nothing today
breaks an audience down rule by rule, so narrow it by disabling rules
until the experiment starts matching.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.