Rich-text Reply

Goals: Pageviews: Regular Experssion on Query and Hash parameters

hv 06-02-16
Accepted Solution

Goals: Pageviews: Regular Experssion on Query and Hash parameters

[ Edited ]

I have problems tracking pageviews on a (single-page app) URL that contains query and hash parameters.

So my Goal would look somehting like this:

 

What to track: Pageviews

URL to track: www\.mydomain.com\/\?sourceType\=mobile_web\#\/viewer\/.*

URL match type: Regular Expression

 

A matching URL could look like this:

www.mydomain.com/?sourceType=mobile_web#/viewer/thisCategory/page-1

 

Is it possible?

It seems to me as if Optimizely was ignoring the Query and Hash parameters...

hv
Level 2

AllisonR 06-06-16
 

Re: Goals: Pageviews: Regular Experssion on Query and Hash parameters

Hi there,

 

The issue here is that with a single page application, each view is dynamically rendered without a page refresh. So at the time the hash parameter is appended to the URL, the whole page does not refresh and therefore Optimizely does not re-revaluate. More information about using Optimizely on a single page app is here

 

The way around this is to conditionally activate the experiment each time the view changes. This section of our support article specifically goes over some examples of different methods you might use to conditionally activate your experiment. Instructions for setting up conditional activation are here

 

Does this help? 

 

Best,

Allison
Sr. Technical Support Engineer
Optimizely | EMEA

Allison
Sr. Technical Support Engineer
Optimizely | EMEA
Optimizely