Targeting
Step 1 of the experiment builder is Targeting. This is where you tell A vs B which pages the experiment should run on and which visitors should be eligible. Getting targeting right is crucial — too broad and you may run the experiment on irrelevant pages; too narrow and you may not collect enough data.
URL targeting rules
URL targeting rules define which pages trigger the experiment. You can add as many rules as you need. If a visitor's current page URL matches any of the rules, the experiment is eligible to run (rules use OR logic).
Each rule has two parts: a match type and a condition.
Match types
Simple match
The visitor's URL path starts with the value you enter. This is the most commonly used match type.
- Value
/— matches every page on your site (because every URL starts with/). - Value
/blog— matches/blog,/blog/my-post,/blog/category/news. - Value
/products— matches all product pages.
Exact match
The visitor's URL path must exactly equal the value. Nothing before or after.
- Value
/pricing— matches only/pricing, not/pricing/enterpriseor/pricing-old. - Useful for experiments on a specific landing page.
Substring match
The visitor's URL path must contain the value anywhere.
- Value
checkout— matches/checkout,/checkout/confirm, and/store/checkout/payment. - Useful for matching URLs that could appear in different positions in the path.
Regex match
The visitor's URL path must match a JavaScript regular expression. This is the most powerful but most complex option.
- Value
^/product/\d+$— matches/product/123and/product/9999but not/productsor/product/abc. - Value
^/(pricing|plans)$— matches/pricingand/plansbut nothing else.
https://example.com/products?sort=price#reviews, the pathname is /products.Conditions
Each rule has a condition that is either Matches or Does Not Match.
- Matches — the URL must match the rule for the experiment to be eligible.
- Does Not Match — the URL must NOT match the rule. Use this to exclude specific pages from an otherwise broad experiment. For example: simple match on
/(all pages) combined with does-not-match exact on/adminwould exclude the admin page.
Multiple rules and OR logic
When you add multiple URL rules, the experiment is eligible to run if the current URL matches any rule (OR logic). For example:
- Rule 1: Simple match on
/pricing - Rule 2: Simple match on
/plans
With these two rules, the experiment would run on both the pricing page and the plans page.
/. Since all URLs start with /, this matches every page.Audience selection
Below the URL rules, you can optionally add one or more audiences. Audiences further narrow who is eligible for the experiment beyond URL matching. For example: only show the experiment to visitors on mobile devices, or only to visitors from specific countries.
If you don't pick an audience, the audience picker shows an Everyone tag and the experiment runs for every visitor who matches the URL rules. If you add audiences, a visitor must match at least one audience to be eligible.
Audiences are created separately in the Audience Builder and then referenced here. You cannot create audiences directly from the experiment builder — create them first, then come back and select them.
Saving and continuing
Your targeting configuration is saved automatically as you make changes. When you are ready, click Next to proceed to Step 2 (Variations). You can always click Back from any subsequent step to return and edit targeting.