Dellanave

How to Split Test Your Wordpress Theme (w/ Plugin)

Posted July 15th, 2009 by david & filed under Blog, Code, Haxor, SEM, SEO.

Here is a rudimentary solution that allows you to split test all metrics on your Wordpress blog.  If there is legitimate usage of this, I will make changes and improvements but at this point I am just throwing together a 15 minute SOLUTION not a complete idiot-proof package.  Please, give me feedback, I appreciate it.  This was created in response to this, so you can go there to read about why Google Website Optimizer is not the right solution for testing metrics across an entire site.

Download plugin.

First thing you need to do is create 2 theme folders.

theme1 is your original theme

theme2 contains the same theme, but with the changes you want to test

Set up 2 Google Analytics accounts.  This seems easiest to do with 2 different email addresses, and 2 browsers so that you can load both at the same time, and it doesn’t complain about the URL being the same.

  1. Open theme1/footer.php and insert the GA code from one account into the footer before the </body> tag.
  2. Open theme2/footer.php and insert the GA code from one account into the footer before the </body> tag.

That’s about it.  The plugin will drop a cookie on the user telling them which theme file to load.  If you want to completely change the themes, you can edit the plugin and change the cookie name to something new.  The cookie lasts for 30 days by default.

PS. I’m gonna admit right now that I almost always make mistakes the first time around.  If this doesn’t work for you – let me know.  If this doesn’t work for you and you figure out why – PLEASE hit me up and let me know so I can update this post.

P.P.S This could be pretty easily made so much better, easier to install, easier to use, and more flexible.  We’ll see if the demand warrants it.

If you like what’s here, please follow me on twitter here.

Posted by: David Dellanave

Check Out David's Website.

9 Responses to “How to Split Test Your Wordpress Theme (w/ Plugin)”

fthead9 | July 15th, 2009 at 4:47 pm

Well I’m not sure if Header 1 or Header 2 is going to change my mind about much ;) but I do think the premise is a good one to be testing. Hope you get enough feedback to make developing the plugin worthwhile.

Joni Solis | July 15th, 2009 at 10:46 pm

I can see the words, “Header 2″ should that text be showing? Looks like an error on the page.

By the way, I too hope that you get people to try this out and give your feedback and maybe develop it more.

There was a wordpress plugin that allowed one to split test posts/pages, I think, but I don’t know if it was updated for WordPress 2.8.

Amit Savyon | July 16th, 2009 at 9:45 am

Great idea. Haven’t downloaded or installed yet. But here’s the first thought that comes to mind:

How about, instead of using two different google analytics accounts, you leverage Google Website Optimizer.

That works by calling two (or more) different files. To leverage GWO, this plugin could have certain urls which can be gien to GWO in order to initiate the switch.

Something like splittester.php?id=1
Splittester.php?id=2
Etc, etc.

Just throwing ideas out there…

Cheers
Amit

metafever | July 16th, 2009 at 11:48 am

Brilliant Plugin mate!

I am going to get started split testing some campaigns right now . . . if the plugin gives any hicups I will let you know.

John | July 19th, 2009 at 9:21 am

Great plugin – few questions. Is it true in my understanding that the cookie determines which page the users sees?

How does the cookie determine which to show, and is each theme shown equally?

I am looking at a google analytics profile that shows a lot more traffic than what is shown in the 2 google analytics accounts that I applied to footer 1 and footer 2