Rich-text Reply

How to target product pages with URLs that do not follow a specific structure

hbaecklund 09-17-14
Accepted Solution

How to target product pages with URLs that do not follow a specific structure

[ Edited ]

If you have thousands of product pages with URLs that do not follow specific structure, what is the best practice to run an experiment on only the pages that contain products related to candy? For reference, here are 3 example product page URLs:

Gary 09-17-14

Re: More experiments

Hi Hbaecklund,

This is a great question, and similar to one I just answered here, albeit different:

In your case, I'd strongly recommend using custom tags (see here: to flag these 'candy' pages and then set up an Audience for the custom tag of 'candy'.

This will require a little dev work to install the custom tag above the Optimizely Snippet on each of these pages, but once done, you can use this custom tag Audience over and over again and again.

On your page, a custom tag would like like the following:
<!-- Optimizely Custom Tag -->
window['optimizely'] = window['optimizely'] || [];
window['optimizely'].push(["customTag", "article type", "sports"]);

<!-- Optimizely Snippet -->
&lt;script src="//">

I hope this helps!
- Gary
Optimizely - Turning the World's data into action
bw 09-17-14

Re: More experiments


You can do this with a javascript variable or Optimizely's custom tag API that will identify these URLs as product pages. Both solutions involve placing code on the page above the Optimizely script so that the condition evaluates as "true" when the snippet executes. In your experiment, setup a Custom Javascript or Custom Tag Audience to target these pages. The following article details this process further, including sample code for your site.