Google Content Experiments for whole part of the site

I want to run an A/B-test or an experiment for whole part of the site. For example on my /blog/ page, where one variation would have a newsletter form and other variation a free ebook download button.

The problem is that I have to use a full URL path for the experiments, for example /blog/2013/article/1?var=1 and /blog/2013/article/1?var=2 With this method I would need create a new experiment for each blog post. This is impossible.

Any tips on how to approach this?

Best Answer

It's possible, but the documentation is lacking.

When you choose your variation URLs, you need to use relative instead of http://. This let's you use query parameters to define the variations, instead of the full URL. In your example, you would define your original page as:

http: //

and your variation URLs would be ?var=1, var=2, etc. using relative as the option in the dropdown (instead of http:// or https://).

Here's the not-so-clear documentation on using relative URLs for your variations:

One important thing to remember is that if you're doing it this way, you need to include the content experiment code on every "original" page.

There's also another way to have even more control over serving the variation pages and controlling the experiment using the Content Experiments JavScript API. This is a relatively new feature - you can see the developer documentation about this here:


My problem is that I want all pages after http: // to get a var-parameter. It's not specific to or So I want to place the experiment code in the main blog-template and based on the value of the var-parameter the colors of my buttons will change (server side).

Other Answer1

I am not sure this is possible. You might look at a more robust yet simple to use tool like Visual Website Optimizer or Optimizely.