Page 1 of 1

Warning! Website Optimizer A/B Testing and Analytics

PostPosted: Wed Sep 16, 2009 10:43 am
by jondyer
A word of warning with A/B tests with Google Analytics running on a site.

The GWO control script (at the very top of the original page), sends a predefined amount of traffic to the variation page. This will cause visits to the variation page to be seen as a direct visit within analytics reports rather than the actual source that has brought a visitor to the site! The reason is because the GA code has not been allowed to run, since it is at the bottom of the original page.

The quick fix is to put the GA tracking code above the GWO control script at the very top of the original page

I wonder how many websites running optimizer A/B tests are seeing skewed data by this happening!

Re: Warning! Website Optimizer A/B Testing and Analytics

PostPosted: Wed Sep 16, 2009 11:08 pm
by elan
Jon, its great to know that we are into GWO now!

But Jon, If the GA code is not allowed to run for variation page, how the visits for those pages will be calcuated as direct visits? Instead it shouldn't count those visits, right?

Correct me if I am wrong.

Re: Warning! Website Optimizer A/B Testing and Analytics

PostPosted: Thu Sep 17, 2009 4:04 pm
by jondyer
A visit to the original page does not write a cookie... the control script passes the visitor to the variation page (e.g. index2.php) which runs the GA code and reads the source as a type in "direct".

The rest of the visit (and return visits) use a direct source.

Hope that clarifies! :)

Re: Warning! Website Optimizer A/B Testing and Analytics

PostPosted: Thu Sep 17, 2009 10:04 pm
by elan
yes it does. thanks Jon!

Re: Warning! Website Optimizer A/B Testing and Analytics

PostPosted: Thu Sep 17, 2009 10:23 pm
by latha
Placing the GA code in the header section might solve the issue. I think it is suggested GA code is placed right at the very bottom is to ensure that the whole page loads and then this code at the bottom gets executed.

The aim might be ensure that if there are Javascript errors or any other breaks in the page (which prevent the GA code from being executed), it should not be treated as a valid visit, either direct or revisit.
Is this the only solution?

Re: Warning! Website Optimizer A/B Testing and Analytics

PostPosted: Fri Sep 18, 2009 10:39 am
by Mike
Placing the GA code anywhere except right before the closing HTML tag is not advisable.

JS includes and to some degree functions are blocking calls - they are required to execute before anything after the call is permitted. A failure in the JS will result in the rest of the page not displaying at all. If you do it in the head or right after the opening body tag that will be a nice white page.

Mike

Re: Warning! Website Optimizer A/B Testing and Analytics

PostPosted: Sun Sep 20, 2009 10:22 pm
by elan
Using GA code in head part is not advisable. A note from Google.

"By placing the script at the end of the page body, you ensure that the tracking code is executed as the last element of the DOM. If a given page load is interrupted for some reason, it is possible that the GIF request for that page view will not be executed. However, should you place the tracking code at the top of the page, any load interruptions might result in incomplete or inaccurate reporting anyhow, since the tracking code relies on page data for its reports."

But I see many sites using GWO have GA tracking code in their head part. Lets digg deep into this to find a solution.

Re: Warning! Website Optimizer A/B Testing and Analytics

PostPosted: Tue Dec 15, 2009 9:35 pm
by jondyer