Skip to end of metadata
Go to start of metadata

Overview

Split testing (or A/B testing) is a method to compare multiple variations of web page design or user-website interaction, in order to find out which version achieves the largest profit. You can test phrases, page elements (their appearance, layout, etc.), and even entire website themes against each other.

Set up split tests

  1. Download the file ABTest.php and place it inside any folder on the server.
  2. Create the tests.php file and list all your A/B tests there. Place it inside the folder where the ABTest.php file is located. 

See an example of the tests.php file below:

 

3. Add the library for A/B testing at the beginning of the page file:

WARNING

In case the code isn't included at the beginning of the page, errors may occur if any other php code is located above yours.

Single-page website

4. E.g. you wish to evaluate all the changes occurred after a heading on the website is replaced by a new one. In this case:

Multi-page website

4. If different pages are to run different tests, all the tests are to be marked as inactive by default. To do this, set ‘active’ => false in the tests.php file:

 

5. Then, you should manually enable all the necessary tests for each page:

Compare two variations of the website

When your goal is to compare two website variations, e.g. two landing pages, you should follow theses 2 steps:

1) To store the original referrer in a cookie;

2) To redirect from the first page to the second one without losing any link labels.

Two pages under one domain

If you wish to compare two website variations available under one domain, e.g. site.ru/lp1 and site.ru/lp2, follow these steps:

1) Configure the variant to test in the tests.php file:

tests.php

 

2) Insert the following code in the first page (this version is the original one):

Two pages under two domains

If you wish to compare two website variations available under two different domains, e.g. lp1.site.ru and lp2.site.ru, or site1.ru and site2.ru, follow these steps:

1) Configure the variant to test in the tests.php file:

tests.php

 

2) Insert the following code in the first page (this version is the original one):

 

3) Insert the following code in the very beginning of the redirection page:

View the results

To view the results, open the project and go to the Split testing page.

The results screen will help you to understand which version is more profitable.

  • No labels