Skip to main content


Optimizely Knowledge Base

Set up a page in Optimizely Web


  • Set up a new page where experiments and campaigns will run on your site


Pages are URL patterns that you'll use to tell Optimizely where to run campaigns and experiments on your site. Use them as templates, or for a single experiment or campaign.

Set up a new page


Here's how to create and set up a new page, with step-by-step instructions below:


  1. Navigate to Implementation Pages.

  2. Select New Page.

  3. Name your page. 

  4. In the Editor URL field, type the URL you'd like displayed in the Visual Editor while you're editing your variation.

  5. Choose the trigger type (this controls when the page targeting conditions should be evaluated by Optimizely), and specify if any or all conditions need to be valid for a page to activate.

  6. Enter your page targeting conditions:

  • URL match - specify URL targeting for your page.

  • Element is present - enter a selector/selectors to activate a page only if a certain element is present on the page.

  • Javascript Condition - enter a function that is called after the page is triggered. It should return true when the page is ready to activate.

  1. Click Save Page

Under the Advanced tab, you can select the option to automatically de-activate the page when the trigger is called and the conditions are not valid anymore, and potentially also undo the variation changes in that case.

Under the Test URL(s) tab, you can check sample URLs to make sure they match the URL pattern(s) you specified in step 6 under the Test URL(s) tab.

Trim unused pages from the Optimizely snippet

Because snippet size may impact page performance, users may choose to exclude unused pages from the snippet. This is called Automatic Page Trimming. When enabled, it excluded all pages that are not involved in targeting or metrics (both pageview & click events linked to the particular page) for at least one running experiment.

To enable automatic page trimming, follow these steps:

  1. Navigate to Settings > Implementation.

  2. Click the action-button.png icon for the appropriate snippet. If your account uses custom snippets, you might see more than one snippet listed. Choose the one that's relevant to this part of your experimentation program.

  3. Select Settings from the drop-down menu.

  4. Check the box labelled Trim Unused Pages.

Screen Shot 2018-10-17 at 11.20.14 AM.png

You can also enable automatic page trimming for an experiment, but still include specific pages that are not involved in targeting or metrics. For example, you may choose to include pages that are used for behavioral targeting audiences or in your raw data export. Be sure to check with your team to see if there are any pages you should force the snippet to include. 

To override automatic page trimming for a specific page, follow these steps:

  1. Navigate to Implementation > Pages.

  2. Click the action-button.png icon for the appropriate page.

  3. Select Settings from the drop-down menu.

  4. Check the box labelled Override Page Trimming.

Screen Shot 2018-10-17 at 11.47.11 AM.png

Best practices for pages

  • Pick a descriptive name for your pages, like "Home" or "Product Pages." This clarifies the purpose of the page and makes it easy to add to other experiments in the future, without having to look at its targeting.

  • If the page you want to target is part of a funnel that has no unique URL and is session-based, set the Editor URL to be the nearest URL possible. To open it in the Editor, navigate to that stage of the funnel in a separate tab before reloading it in the Editor.

Some of the triggers—specifically, "When the DOM changes" and "When the URL changes"—are only available after you enable Support for dynamic websites in your project.

Congratulations! You created a page you can add to any experiment or personalization campaign.