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:

www.example.com/lipstick-crush-5677

www.example.com/blueberry-citrus-1234

www.example.com/Super-candy-for-him-9876

Gary 09-17-14
 

Re: More experiments

Hi Hbaecklund,

This is a great question, and similar to one I just answered here, albeit different:
http://community.optimizely.com/t5/Using-Optimizely/Element-changes-on-multiple-pages/m-p/5180

In your case, I'd strongly recommend using custom tags (see here: https://help.optimizely.com/hc/en-us/articles/201876450#custom_tags) 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 -->
​&lt;script&gt;
window['optimizely'] = window['optimizely'] || [];
window['optimizely'].push(["customTag", "article type", "sports"]);
&lt;/script&gt;

<!-- Optimizely Snippet -->
&lt;script src="//cdn.optimizely.com/js/xxxxxxxx.js">

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

Re: More experiments

hbaecklund,

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.

 

https://help.optimizely.com/hc/en-us/articles/201876450#custom_js

https://help.optimizely.com/hc/en-us/articles/201876450#custom_tags

bw
Optimizely