Google Analytics Content Experiments: Possible to setup Variations for Multiple Pages at once?
Asked Answered
D

5

23

I've recently learned about the new Google Analytics Content Experiments which looks interesting. ( http://analytics.blogspot.nl/2012/06/helping-to-create-better-websites.html )

The standard usecase seems to be that for a certain page, say a product detail page, you supply variations (different urls) and select a percentage of users that are included in the test. Such a user will be presented a variation of the product-detail page (and will continue to be presented the same variation over and over for continuation/ux reasons, based on cookies presumably) .

All fine and good.

However, say I have 100 products on my site. Just testing a variation on 1 of those products has imho the following disadvantages:

  • slow progressing tests because of lower nr of visitors.
  • the test isn't isolated. I.e: since other product detail pages aren't included in the test, displaying a variation-page for 1 product-detail page while all other product-detail pages show the original can (will) lead to a confusing experience (and thus skewed conversion statistics) for the user that browses multiple products, which most of them do.

To me it seems far better to be able to dynamically include all products of a certain type into the same test (e.g: all TV's) , for example by enabling to set some regular expression or other filter on urls to include in the test.

Is such a thing possible currently, scheduled, useful, or completely missing the point?

EDIT

Part of the solution seems to be "relative urls" https://support.google.com/analytics/bin/answer.py?hl=en&answer=2664470

Taking the previous example one step further, we can see how the use of relative URLs lets you easily run an experiment on a set of different original pages, and test visual alternatives across that group of pages (e.g., the product pages in an e-commerce site).

Remaining question: How to dynamically tag which pages belong to the experiment (e.g: based on regex)

Thanks.

Dilapidate answered 7/8, 2012 at 8:49 Comment(4)
I'm having a similar issue. Relative urls work except that experiment visits only seem to be logged if an exact match with the placeholder url is made.Herrenvolk
Raised a question in the Google Analytics group productforums.google.com/forum/#!msg/analytics/dkWBOKLiRDU/…Herrenvolk
OK, I was wrong about the exact urls. It all seems to 'just work' for me. Will update answer.Herrenvolk
I voted to close this question because it is not a programming question and it is off-topic on Stack Overflow. Non-programming questions about your website should be asked on Webmasters. In the future, please ask questions like this one there rather than here.Lucialucian
I
28

The solution is to use relative url for the variation page.

E.g. you have a number of product pages:

www.mysite.com/products/eggs.html
www.mysite.com/products/cheese.html
www.mysite.com/products/bread.html
etc.

For each page you have a matching variation page:

www.mysite.com/products/eggs.html?var=bigpicture
www.mysite.com/products/cheese.html?var=bigpicture
www.mysite.com/products/bread.html?var=bigpicture
etc.

You want to use all the product pages in 1 experiment.

Go To google Analytics Content Experiments: For the orginal page choose ONE of the many product pages (e.g. www.mysite.com/products/eggs.html) (This is just to get the experiment code and provide GA with an example page)

For the variation page choose relative url and put ?var=bigpicture

Then place the javascript required for the experiment on ALL the original product pages you want in the experiment

Google Content experiments Dynamic URL product pages

For more information see: http://support.google.com/analytics/bin/answer.py?hl=en&answer=2664470&topic=1745208&ctx=topic

Ichthyolite answered 22/1, 2013 at 17:57 Comment(5)
Would be great if that worked (not tried yet). Hoewever I'm a abit sceptic since you still only mention a hardcoded url as 'web page to experiment' being www.mysite.com/products/eggs.html. How would Google Experiments know to test www.mysite.com/products/* instead?Dilapidate
It does work. Google experiments just needs to know of 1 original page to set up the experiment, as long as you have set the variation page to 'relative' then you can add the experiment code to multiple 'original pages'. if you are still having problems just let me know.Ichthyolite
alright thanks for the confirming this explicitly. Testing out later. ThanksDilapidate
the reason this works (and I agree it seems like it wouldn't at first) is that the conversion code doesn't check or validate (or even care) that the page the customer visited is the same as the original page URL exactly as you initially entered it. the experiment ID is hardcoded into the javascript so if it's triggered (from whatever URL or dairy product you may sell) it adds the relative URL (for your variation) to the current URL to form the new variation page. THE ONLY REASON GOOGLE NEEDS THE URL FOR THE INITIAL PAGE IS TO VALIDATE YOU PUT THE JS ON IT CORRECTLYCallison
thank you! I was almost ready to dive into server-side implementation because I needed to test all my product pages - but seeing this answer saved my day :) Thanks again!Jelle
D
2

Use the Javascript API as described here:

https://developers.google.com/analytics/devguides/collection/gajs/experiments#pro-server

You can set the experimentid programmatically in your code, on every page. Of course you need first to create the experiment in GA, in doing so provide GA fake urls for each variation, discard the GA generated code, ignore the validation errors. And just use the experimentid as described in the link above.

Delrosario answered 14/5, 2014 at 21:51 Comment(0)
H
1

OK, so a solution to this is:

  1. Create experiment.
    Chose a placeholder url for your original url. Something like www.example.com/products/eggs. Set variations as relative urls eg ?var=large_heading, ?var=small_price

  2. Have some mechanism on the server-side which determines if the current user is part of the experiment. A simple cookie is good enough. If this cookie is present show a variation of the page.

  3. If the user visits a product page but isn't in an experiment then show the javascript given when you created an experiment.

  4. Add something to your product page which checks for the querystring var=[something]. When detected show the appropriate variation as well as setting the cookie which tells marks the user as being in an experiment.

You can hack around the JavaScript that Google gives you to make this a bit easier. Something like:

var variation = utmx('variation_code', 'A/B');
if (variation) { set_a_cookie(variation); }
utmx('url', 'A/B');

This is largely cribbed from the GWO Techie Guide. http://static.googleusercontent.com/external_content/untrusted_dlcp/www.google.com/en//websiteoptimizer/techieguide.pdf

Herrenvolk answered 20/8, 2012 at 17:23 Comment(3)
So the above experiment will only work for 1 product that is "eggs" right?Evenings
Nope. www.example.com/products/* will work as long as you've got the JavaScript on those pages. At least it has for us although we rewrite the page url sent to GA to be /product/overview for each product page. I don't think that affects this method but I may be wrong.Herrenvolk
@KuldeepDaftary no - the reason this works (and I agree it seems like it wouldn't at first) is that the conversion code doesn't check or validate (or even care) that the page the customer visited is the same as the original page URL exactly as you initially entered it. the experiment ID is hardcoded into the javascript so if it's triggered (from whatever URL or dairy product you may sell) it adds the relative URL (for your variation) to the current URL to form the new variation page. THE ONLY REASON *GOOGLE* NEEDS THE URL FOR THE INITIAL PAGE IS TO VALIDATE YOU PUT THE JS ON IT CORRECTLYCallison
D
0

There is also a way to the A/B testing with GA without experiment API if you really want to keep things simple. The idea behind it is to create your own split parameter and than you can pass it to GA as a custom variable. So you can yous your own development tools to differentiate the content in the groups and you don't have to use redirect. Here is a simple tutorial how to do this: link.

Denary answered 13/8, 2013 at 21:24 Comment(0)
Q
0

I recently implemented a GA experiment to test out different text on a nav bar across many pages. This is what worked for me:

  • Set up the experiment in GA for a single page. E.g. index.html and index.html?var=menu2.
  • Implement the solution across multiple pages. Specifically, insert the GA experiment code in all the pages that you want to run the test. Then ensure that your page(s) can render the page variation based on the parameter passed. My php code went something like this: If var=menu2, display page with menu2; otherwise, display original menu.
Quintana answered 12/11, 2013 at 21:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.