Login user name / email: password:
Web Analytics
Customer Login
Have Questions? Call us: +31 20 3373075
  • Home
  • Products
  • Pricing
  • Download
  • Blog
  • Support

Blog

Logaholic News, Web Analytics Tips and Videos.
Get News, Updates and Web Analytics tips via email:

Blog Categories

  • Logaholic News
  • Uncategorized
  • Video Tutorials
  • Web Analytics Guide

Recent Posts

  • Logaholic version 2.6.4 available
  • Logaholic Web Analytics updated to version 2.6.3
  • Logaholic now compatible with German Privacy Laws
  • Logaholic Web Analytics 2.6 Released
  • Learn Web Analytics in 7 steps (Part 7)

How to Split Test a Wordpress site

Posted in: Web Analytics Guide by admin on October 30, 2008 | 7 Comments

Wordpress a/b split test 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!

Share this page:

  • Twitter
  • Facebook
  • del.icio.us
  • Digg
  • LinkedIn
  • StumbleUpon
  • Technorati
  • Google Bookmarks
  • Print
  • email

7 Responses to “How to Split Test a Wordpress site”

  1. Stanford Rosenthal says:
    February 8, 2009 at 7:59 pm

    Thanks for the article, Michael!

    If anyone finds this a bit over their head, there are services that can help you split test your wordpress blog. For example, http://www.wpoptimizer.com.

  2. Edward says:
    May 14, 2009 at 5:23 pm

    I think it’s mindblowing to test my different themes. I’m having some troubles however.

    Instead of a copy of my old database, I’ll use a different database. Somehow I do’nt get to see it, when I add ?lgprofilename10=B to the url I get to see my old design. I’ve switched the databases in my wp-config file, in that case all I see is my new page… In fact, my visitors do to.

    What am I doing wrong? I am using your Logaholic Live hosted service.

  3. michael says:
    May 15, 2009 at 2:41 pm

    The method described above will not work using our Live Edition unfortunately, because that is javascript based and hosted on our servers.

    This only works as described with Logaholic Self Hosted Editions!

    :) Thanks

  4. Jen Kumar says:
    June 27, 2009 at 6:55 am

    Hi, This is really a nice post on Web Analytics. I was using W3Counter

  5. LnddMiles says:
    July 23, 2009 at 12:48 am

    Great post! I’ll subscribe right now wth my feedreader software!

  6. Richard Wright II says:
    May 12, 2010 at 1:14 pm

    This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work.

  7. snawaySaT says:
    May 26, 2010 at 6:45 am

    Just want to say what a great blog you got here!
    I’ve been around for quite a lot of time, but finally decided to show my appreciation of your work!

    Thumbs up, and keep it going!

    Cheers
    Christian, iwspo.net

Leave a Reply

  • Contact Us
  • About
  • Testimonials
  • Customer Login
  • Privacy Policy
  • Affiliate Program
  • Site Map

2010 © Logaholic Web Analytics
prev next