michael, October 30, 2008

What if you want to try something completely different ?

What if you want to go beyond single page split testing and test an entirely new website, with new content, sales copy, a different design, the works ?

If you combine the power of Logaholic Web Analytics and a content management system like WordPress, there is a pretty easy way to pull off this magic trick.

If fact, if you are reading this, you are one of my test subjects and you are looking at the new website 🙂 I can now run both websites simultaneously and I’m sending 30% of visitors to my new site, and 70% to the old one as a control group.

Using the Logaholic Split Testing system I can track users to each website version and compare the results. Is the new website better at converting more visitors to trial downloads, subscribers and customers ?

You know the old saying ‘Don’t throw away your old shoes before you have new ones’ (is that a saying in your language?) is very true here. By testing your new site before you destroy your old one, you can be sure you are making the right decision and you have the opportunity to fix any problems without too much ‘damage’.

Step by Step Instructions

  1. Make a copy your wordpress database

    For your new website, I’ll assume you will use your current site as the starting point. Before we can change the content and settings of the new site, we need to make a copy of the wordpress mysql database, so our original site can stay unchanged.

    There are a number of ways you can make a copy of a mysql database, please read this if you are not sure how to do this. In my case, I could just copy the database folder like so:

    > cp -r /var/lib/mysql/wordpress /var/lib/mysql/wordpress_copy
    > chown -R mysql:mysql /var/lib/mysql/wordpress_copy

  2. Create a Split Test in Logaholic

    Open your Logaholic, go to “Test Center” and click “Create a new PHP split test”. Enter a name and description, something like “Website Split”, “This will split test the entire website”.

    Leave the “Import Test URL” field blank and click “Create”. Next, leave the variation fields completely blank, just click “Create” again.

    Now, click the link to save your test file. The file will be named something like this:

    profilename-splittest10.php

    Once published, this file will set a cookie for your visitors with a value of A or B, so we know if we want send them to website A or website B (the new one).

    The cookie variable will be named like this:

    $lgprofilename10

  3. “profilename” will be replaced with the actual name of your logaholic profile and
    “10” will be replaced with the split test ID number, please keep that in mind.

  4. Edit wp-config.php

    Make a backup copy of your wp-config.php file (located in your wordpress directory). Next, open it in your favourite editor. At the top you find a line that looks like this:

    // ** MySQL settings ** //
    define(‘DB_NAME’, ‘wordpress’); // The name of the database

    We are going to replace this with this:

    // ** MySQL settings ** //
    if (@$lgprofilename10!=B) {
    define(‘DB_NAME’, ‘wordpress’); // The name of the old database
    } else {
    define(‘DB_NAME’, ‘wordpress_copy’); // The name of the new database
    }

    This piece of code will load the new database for any user that has a cookie value of “B”, and the old site for anyone else (cookie=A or no cookie at all).

    Save the wp-config.php file and upload it to your server.

    To preview your new site, just open it in your browser and add ?lgprofilename10=B to the url.

  5. Build new website

    To build the new site, you’ll have to set the cookie permanently, so you can log into your wordpress administration area using the new database.

    To do this, create a new file called “manualcookie.php” (or whatever you want to call it) and put this code in there:

    <?php
    if ($cookie==”off”) {
    SetCookie(“lgprofilename10″,””,time() + 8640000,”/”,$HTTP_HOST,0);
    } else {
    SetCookie(“lgprofilename10″,”B”,time() + 8640000,”/”,$HTTP_HOST,0);}
    ?>

    Save the file, upload it to your server and open it in your web browser. Now you’ll be the only person in the world that will see site B when you visit your site.

    You can now log into wp-admin and make your new website.

    If you need to see your old site, you can always open a different browser (like firefox) or you can remove the cookie again by opening manualcookie.php?cookie=off

  6. Add Split Test Code
    When you are finished creating your new website and ready to start testing, copy the logaholic split test file (profilename-splittest10.php) to your wordpress directory.

    Next, open index.php (the one in your wordpress directory) and add this line to the top of the file:

    include(‘./profilename-splittest10.php’);

    Once you save the file, your visitors will automatically get the cookie and be directed to either your old or you new site.

  7. Evaluate Results
    Now, some visitors will start seeing your new website. Open your Logaholic, click Test Center and Click the ‘Website Split’ link to view the Split Test result report.

    Use different KPI’s / target files to evaluate how well each site converts to your most important files, the Split test report will tell you which site is the Winner !

  8. Go live with confidence
    Once you have your results. Just edit wp-config.php again, so it always loads your winning website database.

Pretty cool right ? Please leave your comments below, thanks!