Audience targeting

Last updated: September 12, 2026

By default, a test runs against every visitor on every page that contains its markup. Audience rules let you narrow that.

A visitor only enters a test if they pass all of its audience rules. Visitors who fail any rule see the unchanged page (data-split-variant elements stay in place, classes and styles are not applied) and are not counted in the test’s results.

Audience targeting is available on Growth and above. Clearing rules so a test applies to everyone works on any plan.


Supported rules

RuleTypeValues
Pages to includeList of stringsEach is a substring of pathname + search. A * stands for any run of characters: /collections/* covers every collection page, /products/*-strap every product whose handle ends in -strap
Pages to excludeList of stringsSame matching, but any match rejects the visitor
Page templatesList of template namesproduct, product.moonswatch, product.mission-*. See below
Product tagsList of product tagsThe page’s product must carry at least one of them. Only product pages can match
CountriesList of ISO-2 codesCountry is read from the visitor’s IP address, not from the browser, so it cannot be changed by page scripts
Devicedesktop / mobile / tabletClassified from the browser’s user agent
Visitor typeNew / Returning / Logged inNew means the store has not seen this browser before. Returning means it has. Logged in means the visitor is signed in to a customer account

All rules combine with AND. Each list within a rule combines with OR: one match in the list is enough.

Text is compared without case, so Gift Guide and gift guide match the same pages, templates and tags.


Page templates

Use the template your theme renders the page with. Shopify writes it as a name, optionally followed by a suffix for an alternate template.

You want to matchUse
Every product page, whatever template it usesproduct
Only products on the moonswatch alternate templateproduct.moonswatch
Every alternate template starting with mission-product.mission-*
Every collection pagecollection

A bare name matches the template and all of its alternates. A trailing * matches everything that starts with the text before it. A name with a suffix and no asterisk matches only that exact template.

URL rules take the same *; product tags and countries do not.


Product tags

List the tags a product must carry for its page to be in the test. Any one of them is enough.

Pages without a product, such as the homepage or a collection page, never carry tags, so a product tag rule on its own already restricts the test to product pages.

Tags are matched in full, not as a substring. sale does not match flash-sale.


URL matching is substring, not glob

The URL matcher is a plain substring check, not a wildcard or regex match.

You want to matchUse
Every product page/products/
Every collection page/collections/
One specific collection/collections/winter-sale
Visitors arriving from a UTM sourceutm_source=newsletter
Just the cart page/cart (also matches /cart/anything, so narrow it with an exclude rule if that matters)

Do not use * in a URL rule. A pattern like /products/* only matches a URL that literally contains the string /products/*, which essentially never happens. Drop the asterisk, or use a page template rule, which does support *.

There is no way to anchor a URL rule to the start of the path. If /cart matches both /cart and /cart-recovery, exclude the unwanted one with a “Pages to exclude” rule.


Country targeting

Country comes from the visitor’s IP address. It works without an IP geolocation library on your side and cannot be changed by page scripts.

Country codes are ISO 3166-1 alpha-2 (DE, US, SE, GB). Case does not matter.

If the country cannot be resolved, which is rare and mostly bots and some VPNs, the visitor is rejected whenever country targeting is set.


Page rules decide when a visitor starts counting

Country, device and visitor type describe the visitor, so they decide whether someone enters the test at all. That is settled the first time they load any page of your store, and their variant is fixed from then on.

URL, page template and product tag rules describe pages, so they decide something different: when a visitor starts counting. A visitor who enters the test on a page outside those rules keeps their variant but is not counted yet. The first time they open a page that matches, they are counted from that moment. Orders they placed before that moment do not count for any variant.

Page rules decide where a visitor counts, not what they see. A visitor gets the same variant on every page that carries the test’s markup, whether or not that page matches the rules, and their assignment does not reset and is not re-drawn. If the variant should only render on certain pages, put the test’s markup only on those pages.

The rules themselves stay in the app. Nothing about which pages, templates or tags a test targets is sent to the storefront.


What “rejected by audience” means for results

A visitor who fails any rule is not logged as a participant for that test. They are not in any variant’s denominator, they do not affect conversion rates, and they do not contribute to sample size calculations.


Common patterns

Run a test only on the homepage. Pages to include: leave empty if / is the only path, otherwise add / (which matches everything). Pages to exclude: /products/, /collections/, /pages/, /cart, /account, /blogs/.

Test only US visitors on product pages. Page templates: product Countries: US

Test one alternate product template. Page templates: product.moonswatch

Test only the products in a campaign. Product tags: the tag those products share, for example Omega x Swatch

Test only new mobile visitors on a campaign landing page. Pages to include: /pages/spring-sale Device: mobile Visitor type: New

Avoid testing during checkout flow pages. Pages to exclude: /cart, /checkout


Preview bypasses audience rules

Audience rules are bypassed for preview links so you can verify a variant from any URL, template, country, device, or visitor type.