Target URLs as an alternative to pages

  • Updated
  • Optimizely Feature Experimentation
  • Optimizely Full Stack (Legacy)
  • Optimizely Web Experimentation
  • Optimizely Performance Edge

Set up URL targeting for your Optimizely Experimentation experiments without using pages.

URL targeting specifies the pages where an experiment or campaign should run. You can use reusable pages to set up URL targeting.

Pages are useful for reusing targeting conditions across multiple experiments. An alternative only requires a URL when you do not need a reusable URL targeting solution.

Targeting menu and options

To find the targeting menu for an experiment:

  1. Go to Experiments and select the experiment you want to target.

  2. Click Targeting. The targeting menu (formerly called “Pages”) lets you edit URL targeting settings for an experiment: Editor URL, pattern matching, exclude URLs, test URLs, and activation modes. You can click Save as Page to save your URL targeting settings as a page for future reuse.

  3. Select Target By > Saved Pages.

  4. To create a one-time instance of a page for an experiment, select Actions > Use Page as URL Target.targeting-1.png

Event tracking with URL targeting

You can select pre-defined events in the metrics builder or create click events for your URL targeting experiment.

If you do not want to use an event in more than one experiment, you can create a single-purpose click event by enabling click tracking on elements from the Visual Editor.


Optimizely Experimentation creates a pageview event for the URL you used for URL targeting. The name is listed as Visit Page: URL Targeting for [experiment name] and you can find the associated event ID in the API Names menu.

URL targeting with custom snippets

If you use custom snippets, you can also use URL targeting for your experiments. Make sure that the URL —to which you want to target your experiment—is included in the custom snippet definition. Defining a custom snippet by pages alone will not include experiments targeted using URL targeting. You should add a URL pattern in your custom snippet definition to include experiments that use URL targeting:


Debug URL targeting

Targeting by URL creates a page in the Optimizely Experimentation data model, so debugging an experiment using URL targeting is very similar to debugging an experiment with saved pages.


The URL targeting condition is listed as a page in the API Names menu. The name of the “page” is “URL Targeting for [experiment name]” and the associated ID is listed. These values are based on the information our JavaScript API returns, and you can use it when you debug an experiment using URL targeting.