Rich-text Reply

Targeting page groups when url targeting is not possible

auke 06-24-16
Accepted Solution

Targeting page groups when url targeting is not possible

I`m about to start a new project where we want to run a test on just the category pages of the ecommerce store. Url targeting is not possible as all category pages are setup like: domain.com/category-name.

 

I`m looking into using this:

https://help.optimizely.com/Target_Your_Visitors/Custom_JavaScript_audience_targeting#Example:_Runni...

 

Is this correct?

Also one of my worries is that this will create a delay, and a flicker.

 

Alternatively I was thinking of doing this via tag manager, i.e. push a datalayer to with pageCategory variable and fire a tag with the necesarry javascript for optimizely. This because we're already planning on utilizing this for analytics content grouping.

Level 2

CouchPsycho 06-24-16
 

Re: Targeting page groups when url targeting is not possible

Hi,

First: Have you checked if it is not possible to do the url-targeting using a regular expression?

Second: The link you provided needs some kind of reference to detect if you are on a product page or not. Is something like that available? A meta-tag or any custom-js-variable? Or even some schema.org-markup?

How about providing an url? ;-)

Kind regards

Michael



"the essence of the creative act is to see the familiar as strange." (anonymous)
auke 06-24-16
 

Re: Targeting page groups when url targeting is not possible

Hi,
Yeah regex is not possible.
We plan on using this code which we`ll be using for GTM and content grouping in GA:

<script>
dataLayer = [{
'pageCategory': 'ProductCategory'
}];
</script>
Level 2
CouchPsycho 06-24-16
 

Re: Targeting page groups when url targeting is not possible

Ok, i cannot test it, but i suppose this will work:

 

Your audience must be defined by using a custom Javascript condition (like mentioned in your link). The condition you need, based on the little script you posted, is:

 

dataLayer[0]["pageCategory"] === "ProductCategory"

I hope, it works




"the essence of the creative act is to see the familiar as strange." (anonymous)
JasonDahlin 06-24-16
 

Re: Targeting page groups when url targeting is not possible

Can you post some examples of why regex is not possible?

We deal with some tricky URL patterns here all the time and it's rare that it is *impossible*.

(It might be very difficult and not worth the effort, but rarely "impossible")

--Jason Dahlin
Analytics and Testing Guru Smiley Happy
auke 06-24-16
 

Re: Targeting page groups when url targeting is not possible

Thanks! Will test it out.
Level 2
auke 06-24-16
 

Re: Targeting page groups when url targeting is not possible

Because there's no pattern, all categories and subcategories are setup like: domain.com/categoryname or domain.com/subcategoryname. Same for product pages. There's about 10 categories with each about 10 sub categories.

We need to use the code I mentioned earlier anyway so it makes sense to use that.
Level 2