How do I run an experiment on a page template that generates thousands of pages (and URLs)?
When I setup a new experiment, I am prompted for the URL I want it to run on.
What if I want to run an experiment on a page template, that powers thousands of pages and URLs?
There are two settings: Editor URL and URL Targeting. The Editor URL is what you're asked when starting a new experiment, and it has to be an existing page. You can choose any page of the thousands that have the same template.
The URL Targeting is where you'll define on which pages the experiment will run. There, you can use substring match or Regex match to run the experiment on any number of pages, as long as they match your settings. Here's more on URL Targeting: https://help.optimizely.com/hc/en-us/articles/2000
For example, if your pages follow this pattern:
You can enter site.com/products/1 as the Editor URL just to load an individual page, and then set URL Targeting to substring match for site.com/products/ or regex match for site\.com/products/([0-9]+)
As a result, even though you are seeing and editing an individual page, the experiment will run on all product pages (as long as they meet the URL Targeting conditions).
Hope that makes sense.
In addition to Grigoriy there is also an option in the targeting for tests to make sure that it passes a JS variable. For example what you could do is add a variable which tells Optimizely what template the page is using. From time to time this also works well if your test is running on a lot of diferrent URL structures on your site.