Universal Conversion Code For Google Website Optimizer

Posted on October 14

it's universal

We’ve been using a piece of code for a while that makes it easier to set up multiple Google Website Optimizer experiments. These experiments could be one right after the other, or even several experiments running simultaneously.

The only requirement is that you should have a single conversion point for all of your Google Website Optimizer experiments. You may be able to adapt this code to situations with multiple conversion points, but that’s likely to get rather complicated.

So why use this code? Oftentimes your conversion point is a page that you’re not really wanting to edit a lot, or may even be able to edit a lot. Instead of having to update your conversion page every time you set up a new experiment, you just add this code to your conversion page once and forget about it. It will register a conversion for all current and future experiments, and will even accommodate visitors who may be part of more than one experiment.

So here’s the code:

A few things to keep in mind:

  • If you have your own functionally equivalent readCookie function, you can use that instead.
  • This code will probably work best if it comes after your Google Analytics Tracking Code.
  • If you have any kinds of modifications to your Google Analytics Tracking Code, you'll need to make those same modifications to your Google Website Optimizer code. See Shawn's post on this.
  • This code is meant to replace the Google Website Optimizer conversion script that's provided with your instructions.

That's it! I always appreciate suggestions for improving code I put up here. If you've found this code to be particularly useful, I'd like to hear that too.

The ROI Revolution Blog @ The ROI Revolution BlogHere is the original post: The ROI Revolution Blog

Tags: , , , , , // Category: Google Analytics.


3 Responses

  1. Martha
    April 17th, 2010

    nice site I like and I sure to visit, well done

  2. Annalee Stock
    May 4th, 2010

    G’day, It is nice to find a good blog like this one. Do you care if I use some of the information here, and I’ll leave a link back to your blog?

  3. learn seo
    June 4th, 2010

    Great write-up, I am a big believer in commenting on blogs to let the blog writers know that they’ve added something worthwhile to the world wide web!