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

# Page Targeting

> Choose which pages a template or visual editor test runs on.

Page targeting limits a template test or a visual editor test to the pages you choose. Only those pages show the change, and a visitor enters the test only when they open one of them.

> [!NOTE]
>
> Only template tests and visual editor tests have page targeting. Every other test type runs on every page. For *who* enters, see [Audience targeting](https://docs.abconvert.io/targeting/audience-targeting.md).

## When to use it

* Test a new template on one product.
* Apply a visual editor change, such as CSS, JavaScript, or new content, to every collection page.
* Run a collection page test everywhere except gift cards.

## When NOT to use it

* **You want to limit who enters, not where.** Use [audience targeting](https://docs.abconvert.io/targeting/audience-targeting.md).
* **The test is not a template or visual editor test.** Every other test type runs on every page.

## How it works

1. A new visitor opens a page. If the page does not match the rules, ABConvert decides nothing. The visitor sees the original store.
2. On the first matching page, ABConvert runs the rest of the [targeting flow](https://docs.abconvert.io/targeting/overview.md#how-it-works) and assigns the visitor to a test group.
3. From then on, the visitor keeps their test group on every page. Changes show on matching pages. Other pages show the original store.
4. Once a visitor is in the test, everything they do counts toward the results, on every page. Only the change itself is limited to matching pages.

![Page Targeting card in the Targeting step](https://mintcdn.com/abconvert/nYSloYffhPjbXZQE/images/targeting/pages-card.png?fit=max\&auto=format\&n=nYSloYffhPjbXZQE\&q=85\&s=bb28645770196d6da1404a221ff545e9)

The test runs on one product page only. Check a URL tells you whether a page matches.

## How include and exclude rules combine

* **Include pages** rules choose pages. A page matches if it matches **any** include rule.
* **Exclude pages** rules remove pages. A page that matches **any** exclude rule is out, even if an include rule matches it.
* No include rules means every page, minus any exclude rules.

## Operators

Each rule has an operator and a value.

| Operator | Compares against | Example value |
| - | - | - |
| **Exactly matches** | The path | `/products/blue-snowboard` |
| **Starts with** | The path | `/collections/` |
| **Contains** | The full URL, including the query string | `variant=` |
| **Matches regex** | The full URL | `/collections/(sale\|clearance)` |

Matching is case-sensitive, and a trailing slash matters.

Which URLs match which rule:

| URL | Exactly matches `/collections/sale` | Starts with `/collections/` | Contains `sale` |
| - | - | - | - |
| `/collections/sale` | Yes | Yes | Yes |
| `/collections/sale?sort=price` | Yes | Yes | Yes |
| `/collections/sale/` | No | Yes | Yes |
| `/collections/summer-sale` | No | Yes | Yes |
| `/products/sale-hat` | No | No | Yes |

## Check a URL

Type any path or URL into **Check a URL** at the bottom of the Page Targeting card to see whether the test runs there. Use it before you launch.

## In the visual editor

You can only edit pages the rules cover. If you open a page outside them, the editor tells you and offers to add the page to the test with one click.

![Visual editor banner on a page outside the test](https://mintcdn.com/abconvert/nYSloYffhPjbXZQE/images/targeting/visual-editor-page-banner.png?fit=max\&auto=format\&n=nYSloYffhPjbXZQE\&q=85\&s=f09d646dcf90878a516f2c30cb37f84c)

On a page outside the test, the editor offers to add it.

## Rollouts

When you roll out a winning test group as a [personalization](https://docs.abconvert.io/personalization/overview.md), the personalization keeps the test's page targeting. You cannot change it on the personalization.

## Common mistakes

* **Forgetting the trailing slash.** `/collections/sale/` does not exactly match `/collections/sale`. Use **Starts with**, or add both.
* **Using Contains for a path.** **Contains** looks at the whole URL, so `sale` also matches `/products/sale-hat`. Use **Starts with** for a section of the store.
* **Adding an exclude rule that covers everything.** Exclude **Contains** `/` removes every page.
* **Editing a page the rules do not cover.** The visual editor locks it. Add the page, or change the rule, before you edit.

## FAQ

> [accordion] Can I change page targeting while the test is running?
>
> No. Page targeting is locked once the test starts. End the test and duplicate it with the new targeting.

> [accordion] A visitor joined on a product page. What do they see on the home page?
>
> The original home page. They keep their test group, and the change shows again on the next matching page they open.

> [accordion] Can I use page targeting on a combined test?
>
> Not yet. A combined test runs on every page.

> [accordion] Why is the visitor count lower than my product page traffic?
>
> A visitor only joins when they open a matching page and match every condition in [audience targeting](https://docs.abconvert.io/targeting/audience-targeting.md). A visitor who only opens the home page is never assigned.


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