I would like to know what is the best way the run a/b testing with Google analytics between two different themes.

Google analytics a/b testing tool requires too different url's . Which means that the solution must be based on

  1. domain/ -> this is old current theme url.

  2. domain/new/ OR domain/?new=true -> this is new theme Google requests to put a JS code within page A which makes a redirects half traffic to page B. Thanks

  • Actually new urls or domains are now required, but are default. There are other ways to accomplish similar tasks.
    – philwinkle
    Nov 15, 2013 at 4:31

1 Answer 1


Disclaimer: this was previously done with Google Website Optimizer. I'm not sure if it's possible with the new GA feature.

The way that I've accomplished this in the past is to use GWO to issue a <script> tag that set a cookie with a store value on the client, which would identify to Magento which store view to render.

It then issued a redirect immediately (via javascript) which refreshed the page. If a flag cookie was already present it would not issue the redirect, which assumes that Magento already loaded the correct store.

The store views have separate themes configured and thus they delivered differing looks.

Via CSS override:

If the theme isn't dramatic and it's styling only or showing/hiding blocks you could instead just add a CSS file that is an override using GA/GWO. This is much less invasive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.