How to Split Test Your WordPress Theme (w/ Plugin)
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.
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.
- Open theme1/footer.php and insert the GA code from one account into the footer before the </body> tag.
- 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.




