A/B Testing WP With Google Website Optimizer: The Easiest, Cheapest Method

Want to a/b test your WordPress (WP) website without the cranky, unreliable Google Website Optimizer (GWO) plugins?

Google Website Optimizer

The problem with using Google Website Optimizer with WordPress:

1. Google Website Optimizer was designed with static html pages in mind, as opposed to pages created by a content management system like WordPress.

Each post on a WordPress-powered website relies on multiple different files, such as header.php, sidebar.php, post.php etc. Google Website Optimizer requires you to place code on the page you’re going to test, which is made more difficult because of the dynamic inclusion of the header, sidebar, body of the post etc.

2. Various WP plugins supposedly resolve the difficulty. In fact, they don’t solve it for two reasons:

  • These plugins limit what you can test to the content of the post, and not the title, layout, navigation and other very important aspects of the page.
  • They don’t work with custom themes – which is likely your case if you’re putting money into A/B testing or multivariate (MVT) testing. I’ve failed to make GWO work on this WordPress site despite numerous efforts and following instructions to the letter.

In short, what you need is for your WordPress pages to be static html …

How to a/b test any WP page/post, free using Google Website Optimizer…

1) Navigate to the WordPress page you want to test, in your browser.

2) Click File -> Save File As and download the page. With Firefox, this downloads two things: i) a folder including all the graphics, CSS and backend voodoo that makes the page pretty and ii) the final html that is sent to the browser to display on your screen.

3) Upload the folder and html file from step 2 to your server. This is your control version of the page.

4) Create one or more copies of the folder and html file, and edit as needed for your test. This is your experimental version of the page.

5) Upload the copy/ies to your server. Important: Don’t upload to a folder in which WordPress is installed, because doing so will cause the newly uploaded page will take forever to load (in my case, 30 seconds+). This means that if WordPress powers your whole site (e.g. it’s installed in the root folder), you’ll need to test on a subdomain or another domain. I suspect this may also be true of trying to upload the file to a page where other CMSes are installed

Filezilla Upload

6) Edit both the control and experimental pages to include the Google Website Optimizer code.

7) Optional: Use a 302 Temporary Redirect on the existing page to send the traffic to your control page and let GWO split the traffic between the “A” (control) version and “B” (experimental) version of the test page. You want to use a temporary redirect because you’re only doing this until you find a better version of the page.

Alternately, you can use a 301 permanent redirect if you don’t want to be bothered keeping the WP version of the page later.

8) Optional: If you tested layout or something graphical besides content, have a dev create a special “page template” that you can select when creating a new WP page. That way you’ll be able to keep the new version within the control of WordPress, while getting the higher conversion rate of your new version.

A summary of this approach’s benefits:

- It’s easier than breaking your head trying to install GWO on a custom theme and never succeeding at having it validate.
- It provides more flexibility in what you can test than the existing plugins out there.
- You’re still using GWO, so it’s free.

Liked this workaround to a/b testing using GWO and WordPress? Add my rss feed to your reader for more tips on conversion and usability and advanced SEO.

Comments

Leave a Reply