A/B Testing With Google Analytics

rakafor-2Once you have a better picture on the current state. It’s time to try and improve it. A good way to do it is by using the option to serve different pages to unique visitors and measure the differences.

Following our e-Commerce site example, there are few options to test:

  • Create few versions of your ‘buy’ page.
  • Change modules on a certain page.
  • Change the landing pages.
  • Change the funnel: number of pages, modules, steps etc’.


Few guidelines to gain more reliable results:

  • Test a few elements at a time – If you change multiple elements on each page, it can be difficult to figure out which element or combination of elements was responsible for the best results. For example, create multiple pages but change only the main image on each page, and keep the same layout and text to ensure that any difference between the page results is due to the image.
  • Use high-volume pages – The more often that people see a page or complete a goal, the less time it takes to gather data.
  • Make bold changes – Users can miss small changes and you can end up with inconclusive results.
  • Keep testing – With follow-up testing, you can build on the success of your experiment. Did one headline encourage a lot more purchases? If so, test it alongside a product image or an image of a spokesperson.

Types of goals

You can set up different type of goals:

  • URL Destination goals – An experiment that uses a URL Destination goal focuses on getting users to view a specific web page. Use this kind of goal to find out things like how well your test pages encourages users along a path to a product page, a page that includes the location of your business, or pages on which you’re selling ads.
  • Event goals – An event goal focuses on getting users to perform a specific action on a page. Use this kind of goal to find out things like how well your test pages encourages users to sign up for a newsletter, view a video, or click “Pay With Card” for a product.
  • Session Duration goals – Use this kind of goal to see how well your test pages encourage users to spend time on your site. For example, if you’re running a news site, you want to see that users are spending enough time to read the articles, and enough time to validate the rates you charge for advertisements.
  • Pages per Session goals – These goals help you understand whether users are consuming the amount of content you want. In many cases, you will want to combine this metric with the time they spent on your page. This is a good proxy to ‘consuming’.


How to (t)set

The first step is to define the original version, the variations to test, and any other relevant parameters. This experiment will test changes to the banner image and button to determine whether a particular variation outperforms the original version. The goal in this example is simply to get the user to click on the button. This example shows how to run an a/b testing without redirects. This is accomplished by modifying the page in-place, using JavaScript. But don’t worry, its all being done for you with the GA’s Javascript  snippet.

Step 1
  1. Sign-in to the Google Analytics and select the view (profile) in which you want to create the experiment.
  2. Click the Reporting tab – It’s located on the top left of the screen.
  3. Expand the Behavior section (on the left menu), then click Experiments.
  4. If this is your first experiment, the page will look a bit empty (just like in the image below). Click ‘Create Experiments’ button in the image below and get ready.
step-1 all experiments

Step 1 – Click on the image to see it in full size

Step 2

Name your experiment and set an objective. The objective should be a goal we define in section Set Up Goals. There are other options to configure: percentage of traffic to this experiments. If you are running a more risky test you might want to limit the percentage of users that will get the new version. However, if you wish to see results faster, make the percentage higher.

step 2 - Content experiment

Step 2 – Click on the image to see it in full size

Step 3

In this step we will fill the two versions of the testing elements.
You can have more than two versions.

step 3 - content experiment

Step 3 – Click on the image to see it in full size

Step 4

In this step we have the option to get the new JS code. If you are working in a company that got a team that run operations, you can also mail it to them (e.g. webmaster of the site) so they could add it to production.

step 4 - set

Step 4 – Click on the image to see it in full size

Step 5

This is the last step in the process. We review the test we are going to run. You can see in the picture below that GA found our code on one page and not on the other. It’s important to check it against your production servers so you will know for sure that data is being collected.

step 4 - content experiment

Step 5 – Click on the image to see it in full size


Only after you fixing all the issues, click on ‘Start Experiment’.
You should check the results after the first few hours to see that there isn’t any mistake in the definitions.



One thought on “A/B Testing With Google Analytics

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s