Google Experiments on Page that Redirects

181 Views Asked by At

I have a site that has a several page offer form. The offer information is stored in a session, and I keep track of what step the customer has completed. If the customer has not completed all previous steps in relation to the page they are on then they are redirected back to the start of the process. In this way I prohibit users from accessing step 3 by simply typing in it's URL. This is done because information on steps after 1 depend on valid information from previous steps.

The problem is that when I set up my content experiment through Google Analytics it cannot validate my original or variation pages since when it hits those pages (which is step 4) the sever recognizes that they are not allowed on that page and returns step 1 to them.

I attempted to proceed anyways, but it seems that when I arrive at step 4 it is not pushing me to my variation page (I have it set so that everyone that arrives at step 4 should go to the variation.) I'm assuming the problem is because of the redirect.

Any ideas?

1

There are 1 best solutions below

0
On BEST ANSWER

The perceived problem was that GA could not ping my page because of the redirect I have on it. The actual problem was that my GA experiments code was not the very first thing after my opening HEAD tag. GA Experiments only scan the first 256 characters of a page, so if the beginning of the experiments code is not within that, then it won't work.

Also, I had my GA code in a js file and was linking it on the page for cleanliness....this also does not work. GA Experiments scans the first 256 characters of the page and cares not for links, I needed to have the exact code, with comments, that GA gave me on the page for this to work.