---
title: Target URLs to choose where your experiment runs
slug: performance-edge/docs/target-urls-to-choose-where-your-experiment-runs
docTags: 
createdAt: 2026-08-05T21:01:07.159Z
---

- Optimizely Web Experimentation
- Optimizely Performance Edge
- Optimizely Personalization

Choose the URLs for an experiment or campaign to determine where it runs on your site. You also can use the URL match types available in Optimizely Experimentation or Optimizely Personalization to target a specific URL or a group of URLs.

Ensure the [Optimizely snippet](docId\:jR-pX5bKreBi8ctWNBOko) is implemented on all pages you target.

:::hint{type="info"}
**Note**

Optimizely Performance Edge handles URL targeting the same way, so the following information applies to experiments created with either version of Optimizely Experimentation.
:::

## Find URL targeting

### Optimizely Web Experimentation and Performance Edge

1. Select your experiment from the **Experiments** or the **Optimizations&#x20;**&#x70;age.
2. Click **Target > Activation**.
3. Select **Target By URL**.
4. Configure URL targeting for your experiment.
5. Click **Save**.

![Target - Activation.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/c9lG2V9lYnqAgbw08jNfW-20260720-150157.png)

### Optimizely Personalization

1. Go to **Optimizations** and select your experiment.
2. Click **Activation**.
3. Select **Target By URL**.
4. Configure URL targeting for your experiment.
5. Click **Save**.

![Personalization - Targeting.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/z2XGmtcLH06QJANMD2BFr-20260720-150157.png)

## Test URLs to check targeting

Expand **Test URL(s)** to check your targeting conditions and ensure that your experiment runs on the expected pages. **Test URL(s)** determines that an experiment will run if the entered sample URLs match the URL targeting conditions. A non-match means the experiment will *not* run.

![mceclip3.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/eCmD1pRxRywPpeeejW-NP-20260720-150157.png)

**Test URL(s)** confirms whether a URL targeting condition or [pageview goal](docId\:puGm9z4XkEG5PDkyaNmlA) correctly targets your intended URLs. Click **Add (+)** to add a URL to validate. Try checking for URLs that you expect and do *not* expect to match in your experiment or campaign.

## URL match types

Enter the URL you want to use and add URL match specifications that tell Optimizely where the experiment or campaign should run.

![mceclip1.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/1Y_fgjigI9q4vDRVZwqgK-20260720-150157.png)

You can use one of the following URL match types:

- **Simple match&#x20;**– Use for testing a single page. This is the default match type.
- **Exact match&#x20;**– Use only if the URL significantly changes how the page displays due to added query parameters or hash parameters. To target visitors using a certain query parameter, use an [audience condition](docId\:lQFY_WXMJojQTnBgQ-PAe) instead of an exact match.
- **Substring match&#x20;**– Use to match specific strings of text within a URL. It is useful for experiments and campaigns that change the same element site-wide or on multiple pages.
- **Regular expression&#x20;**– Use to target complicated URL structures that are not easily captured by the other URL match types.

:::hint{type="info"}
**Note**

Regular expressions are case-sensitive. Simple, exact, and substring matches are *not* case-sensitive.
:::

### Simple match

Simple match is ideal for running experiments and campaigns on single pages. A simple match runs when visitors land on a URL, even if it has the following variations:

- Add or change a **query&#x20;**&#x70;arameter
  `http://www.atticandbutton.us/?utm_campaign=january`
- Add or change a **hash&#x20;**&#x70;arameter
  `http://www.atticandbutton.us#about`
- Change **protocol** between http\:// and https\://
  `http://www.atticandbutton.us` and `https://www.atticandbutton.us`
- Add or remove a **trailing slash** at the end of your URL
  `http://www.atticandbutton.us` and `http://www.atticandbutton.us/`
- Add or remove **www** from your URL
  `http://www.atticandbutton.us` and `http://atticandbutton.us`

Simple match ignores these changes (because they usually do not change the way your page displays) and runs your experiment and campaign on the page.

To use simple match, enter the full URL of the page you want to target—the absolute URL, not a relative URL like `/products/general.html`. The following examples show common variants that pass a simple match:

![mceclip4.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/6cYsWMB2X_mHPB3J4PL9O-20260720-150157.png)

These examples match because they run on the same page as the original URL and adding query (?) or hash (#) parameters does not generally change the page.

Simple match does *not* ignore changes in subdomain (aside from www), adding .html or other extensions, or adding or changing subdirectories.

The following examples will *not* pass a simple match:

![mceclip5.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/wdFlHnXf3tELhJWey7jAC-20260720-150157.png)

These examples will *not&#x20;*&#x6D;atch the original URL because they are not the same page:

- `https://www.atticandbutton.com` does not have the same extension as `https://www.atticandbutton.us`
- `https://www.atticandbutton.us` does not have the same subdirectory as `https://www.atticandbutton.us/about`
- `https://www.blog.atticandbutton.us` does not have the same subdomain as `https://www.atticandbutton.us`

**Example – User account page with many dynamic/unique query string values**

You want to run an experiment on a **My Account** page for all of your customers. However, every account URL includes query parameters that are unique to a particular user’s information. A sample account URL is:
`www.atticandbutton.us/myaccount?account_id=1234&location=san_francisco`

To set it up:

1. Identify the static and dynamic portions of the account page URL.
   In this case, the URL to the left of the “?” is always the same (static), and the parameters to the right of the “?” are unique to each user (dynamic).
2. In URL targeting, select **Simple Match** from the drop-down list. Add the account URL, excluding query string parameters (in this case, `www.atticandbutton.us/myaccount`).
   A simple match ignores anything to the right of the question mark in the URL (all query string parameters). In this case, `?account_id=1234&location=san_francisco` is ignored, which is what you want since this is the dynamic portion of the account page URL.

This setup ensures that your experiment runs on account pages, regardless of the unique user who is viewing the page.

![mceclip6.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/gZCbdCju_WO2eW6ThQ4qy-20260720-150157.png)

**Example – Visitors who land on only two of many landing pages**

You have about 10 live landing pages, and you want to run an A/B test on only two of these pages. You know there are unique UTM/query parameters added to the URL from paid search traffic, but you want the experiment to run regardless of which campaign a visitor comes from.

To set it up:

1. Identify the two specific URLs you want to test and how they differ from other landing page URLs on your domain.
2. Select **Simple Match** from the drop-down list on the **Activation** page and add the URL of the first landing page.
3. Click **Add (+)** and add the URL of the second landing page as a **Simple Match**.

Because a simple match ignores anything to the right of the question mark in the URL (all query string parameters), this setup ensures the experiment runs only if a visitor lands on the first landing page URL or the second landing page URL.

![mceclip8.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/un3aqBcqX7BxQF9TfoEke-20260720-150157.png)

Simple match may also be useful for excluding certain URLs from a substring match that targets many pages at once.

![mceclip9.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/UQSzOViLaNLk2bBJOXeUn-20260720-150157.png)

In these examples, those that include `www.atticandbutton.us/about` are excluded because the targeting is set to exclude that URL as a simple match.

### Exact match

Exact match runs an experiment only when users load the exact URL.

Like simple match, exact match ignores trailing slashes at the end of your URL, http and https protocols, and [www](http://www). Also, like simple match, exact match does *not* ignore subdirectories, extensions, or changes in subdomains (`www.atticandbutton.us` compared to `blog.atticandbutton.us` or `www.atticandbutton.us/blog`).

Unlike simple match, exact match does *not&#x20;*&#x69;gnore changes to query or hash parameters.

Enter a full URL when using exact match—the absolute URL, not a relative URL like `/products/general.html`.

![mceclip10.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/lFWbCB6Igah2GCytIWwBQ-20260720-150157.png)

In this example, `www.atticandbutton.us`, `http://atticandbutton.us/`, and `https://www.atticandbutton.us` are included because exact match accepts these common variations.

The following URLs are excluded:

- `http://www.atticandbutton.us?query=true` because it includes a query parameter.
- `http://www.atticandbutton.us/cart` because it is not the same subdirectory.
- `http://blog.atticandbutton.us` because it is not the same subdomain.

If you specify a query or hash parameter, exact match allows only that exact parameter into the experiment.

![mceclip11.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/yrMv5CsGnOvn6aSD_Duw8-20260720-150157.png)

Exact match may be useful when you want to exclude specific query or hash parameters from a simple match.

![mceclip12.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/4IO4rct-mhuqmiVK_lf0P-20260720-150157.png)

### Substring match

Substring match runs an experiment when the URL contains a set of characters that you specify. This set of characters is called a substring and can be present anywhere in the URL. 

For example, if you want to target an element on all product pages, look for a part of your URL that is consistent across all product pages. If the substring `/products` is in every product page, run a substring match on `/products`.

Substring match ignores trailing slashes that display at the end of your URL, and http and https protocols, but it does *not* ignore subdomains (including www), subdirectories, extensions, or changes to query or hash parameters. To match a substring that includes a trailing slash (if you have a page like `/example` and need to match `/ex/` instead), use a regex match instead of substring.

Unlike simple and exact match, substring match does *not* need a full URL to match. You can substring-match on a word, query parameter, subdirectory, or any other substring that might display somewhere in the URL. This makes substring match ideal for targeting entire categories of pages or your entire site (for example, to make a change to your global navigation menu).

The following image shows how a substring match targets the experiment when you include www (or another subdomain):

![mceclip13.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/-9Y5t3It4NZqIlGovxcZQ-20260720-150157.png)

In this example, only the URLs that include the string `www.atticandbutton.us` are included.

But when you remove the subdomain or www, the substring match targets any page on your domain where the snippet is implemented:

![mceclip14.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/vedsom4Nz7d7A30VnhtW6-20260720-150157.png)

You can target an entire category of pages by including the directory that displays in their URL:

![mceclip15.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/IVRMwW1cRuCFyI9MsgbEo-20260720-150157.png)

In this example, all strings that include the string `accessories` are included.

With substring match, you can also target a certain parameter anywhere it displays:

![mceclip16.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/Gaiho7yOhPM6oetW3FoDy-20260720-150157.png)

In this example, all the URLs that include the string `utm_campaign=springpromo` are included.

**Example – Testing on categories of pages**

You want to run an experiment on all product detail pages, but you want to be sure that your changes do *not* also show up on other pages of the site. You know that all product detail page URLs look similar (for example, `http://www.atticandbutton.us/product/scarf?p=4673`, where everything after `product` is dynamic).

To set it up:

1. Identify a common URL structure for all of your product pages that is unique to those pages.
2. Select **Substring Match** from the drop-down list on the **Activation** page and enter the portion of the URL that is guaranteed to be the same across the desired set of pages (for example, `atticandbutton.us/product`).

This ensures that the experiment runs on any URL with the string `atticandbutton.us/product` in the full URL. The substring match applies even if values are added before or after this string.

![mceclip17.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/0UJwMKdvV93lP2HY-Anb4-20260720-150157.png)

**Example – Run site-wide, except for a certain subset of pages**

You want to run a site-wide navigation bar change across all the main pages on your site. However, a subset of news pages do not follow your site’s standard layout, so you want to exclude these news pages from the experiment.

You know that the news pages all have a URL that begins with `www.atticandbutton.us/news`. The dynamic topic and article name are appended after `news/`.

For example, a full URL might be: `www.atticandbutton.us/news/home-improvement-projects`

To set it up:

1. Start with the bigger group of pages that you want to include in the experiment. In this case, set a substring match to `www.atticandbutton.us` to ensure the experiment runs site-wide.
2. Identify a common URL structure for all of the pages that you want to exclude from the experiment.
3. Add another condition on the **Activation** page and select **Substring Match** from the drop-down list. Enter the portion of the URL guaranteed to be the same across the set of pages you want to exclude (in this example, `www.atticandbutton.us/news` works).

The experiment runs on pages on your domain that have the substring `www.atticandbutton.us`, but *not* pages that have the string `www.atticandbutton.us/news`.

When you exclude URLs in URL targeting, both positive and negative conditions must be met. In other words, to be included in the experiment, a visitor must land on a page that matches the included condition and does *not* match the excluded condition.

![mceclip18.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/mgufV9nYXFRvhgwtdKiCY-20260720-150157.png)

### Regular expression match

Expert users can use [regular expressions](http://www.w3schools.com/jsref/jsref_obj_regexp.asp) (RegEx) to specify a set of pages on which an experiment should run. For example, to target pages on your site where the snippet is implemented, use a regular expression match and enter `.*` as your match condition.

You cannot cover all of the possibilities that regular expressions allow. For example, suppose that you want to target your experiment to pages in your `/products/shoes`, `/products/hats`, and `/products/shirts` sections, but no others. You might write a regular expression that looks like this: `/products/(shoes|hats|shirts).*`.

![mceclip19.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/dLr1hm1Dgcv27bm4wks1N-20260720-150157.png)

Regular expression matches are evaluated using JavaScript's built-in regular RegEx module. Your expression is matched against the full page URL and is evaluated as a substring match up until an escaped character in your expression. Alternatively, you could write the regular expression in this example entirely in RegEx: `\\/products\\/shoes|hats|shirts.*`.

Your expression does not need to match the full URL to trigger your experiment. For example, the regular expression `x=y` will match the following pages:

- `http://www.atticandbutton.us/blog/january?x=y`
- `https://atticandbutton.us/blog/january?a=b&x=y&c=d`

**Query parameters**

When Optimizely evaluates a URL using the RegEx match type, Optimizely strips the Optimizely Experimentation query parameters. For example, if you are trying to create a RegEx to match `http://www.atticandbutton.us`, the added Optimizely Experimentation query parameters might look like this:

`http://www.atticandbutton.us/? optimizely_token=b0a1ff184499db5eba13276b436f7a9c04422c85ed08ac7cb83b8214768b37be& optimizely_x=7961690747& optimizely_x_audiences=& optimizely_preview_layer_ids=7597420149& optimizely_snippet=s3-7428110562& optimizely_preview_mode_CAMPAIGN=7597420149`.

The stripped URL Optimizely evaluates would be `http://www.atticandbutton.us/?`. Optimizely does not remove the `/?` when stripping the Optimizely Experimentation query parameters due to inconsistent behavior among browsers.

To match the URL `http://www.atticandbutton.us`, you may want to include matching for the trailing `/?`. You could use `example\\.com\\/?\\??$` to match with and without the trailing forward slash and question mark and to not match if there is an actual query parameter in the URL, like a UTM campaign.
