Rich-text Reply

I want to exclude pages with the same substring

Nicole 12-23-14

I want to exclude pages with the same substring

My website has product pages that fall in to four very different categories.  The site's structures gives these products the same substring in thier urls.

 

To better target my testing I want to figure out a way to exclude the different product categories so that when I test one the other three will not be affected. 

 

The pages'  code contains information that notes which category the pages fall into.   I would like to know if there is a way optimizley can use this to help me exclude certain pages.

Level 2

Amanda 12-23-14
 

Re: I want to exclude pages with the same substring

Hey @Nicole 

 

Just to make sure I'm understanding you right, you want to target only certian categories on your page, but the URL targeting does not allow you to differntiate the different products since they have the same substring. Correct?

 

In your case, I'd recommend using custom tags (see here:https://help.optimizely.com/hc/en-us/articles/201876450#custom_tags) to specify each 'category'  and then set up an Audience to include or exclude a certain category. You can be as general or specific as you want with the custom tags, and you'll only need to add them once so they can be used for any experiment. 

 

Typically, using code that already exists on the page doesn't work for targeting because the Optimizely snippet executes before this code is actually loaded onto the page, so Optimizely can't determine if it is or is not present. The custom tag (linked above) is added above the snippet so Optimizely can access the values. 

 

Here are another couple discussions you might want to reference:

Optimizely
JDahlinANF 12-23-14
 

Re: I want to exclude pages with the same substring

[ Edited ]

Depending on your service contract, "Conditional Activation Mode Configuration (Enterprise plans)" may be an option too!

https://help.optimizely.com/hc/en-us/articles/200040225

 

(the condition being that the element that indicates it is of the category you are looking for exists on the page (e.g., window.$('.categoryTypehere').length > 0)