The ROI Revolution Blog

Google Website Optimizer and Google Analytics: A Perfect Marriage

April 4, 2007

*Update May 12, 2008: This article is OUT OF DATE! The good news is that there is a brand-spanking-new version that is much easier to use! Click here to check out the new version!

gagwowed.jpgAlright everyone, you may want to grab a drink and a comfy seat before we begin - this article's a whopper. So you may have heard about Google's new Website Optimizer tool that is available through Google AdWords. Google Website Optimizer uses a single metric, conversion rate, to determine which combination of variations is king.

But what about other metrics that may be just as valuable, like Page Value, Avg. Time, Conversion Rates for multiple goals, Bounce Rate, Exit %, and Full Navigation Analysis? What if you want to segment your traffic or filter out internal hits? Well, now you can find out just about everything you want to know about combinations by using Google Analytics! We're still just starting to understand how powerful this method is, but I can say that I'm extremely excited about it (hopefully not just because I developed it).

So kick back and read on to find out how...


It may not sound like it, but integrating this tool can be easy as pie. You need to do three things:

1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics.


Here are the steps in detail, along with the results that show up in Google Analytics:

1. Put two JavaScript functions on the test page (The integration tool)
You can find this function by visiting this link. The file is called gwo_analytics_integration.js. The easiest way to use it is as an include on your test page. In order to do this, you must upload the file to your own server.

The include looks like this:

<script language="JavaScript" src="gwo_analytics_integration.js" type="text/javascript"></script>

Make sure you include it before the Google Analytics tracking code and after the Google Website Optimizer test page control script (thanks to Ophir for pointing out that I forgot to mention that it needs to go after the control script).

2. Change the Google Analytics Tracking code on your test page

from:

<script src="http://www.google-analytics.com
/urchin.js"type="text/javascript">
</script>
<script type="text/javascript">
    _uacct = 'UA-XXXXXX-X';
    urchinTracker();
</script>

to:

<script src="http://www.google-analytics.com/
urchin.js"type="text/javascript">
</script>
<script type="text/javascript">
    _uacct = 'UA-XXXXXX-X';
    var combination = getcombo();
    urchinTracker('/originalpagename.htm?
Combination=' + combination);
</script>

This simply adds the combination number to the page name and sends it to Google Analytics. It is important that you only use this code on pages that are running an Optimizer Experiment.

UPDATED June 14th, 2007:
There was originally an error in the algorithm used in the script above. To view the details of the error you can go to Ophir's article. A big thanks goes out to Ophir for finding this error and correcting it. That being said, there are some new instructions for using this script.

In the getcombo() function, you need to enter in the number of combinations you have in each section. So, for example, if you have 4 variations in the first section, 2 in the second, and 3 in the third, you would call getcombo('4-2-3'). If you only have one section, you don't need to make any changes.

Thanks again to Ophir for testing, finding, and fixing the error. This is just another great example of why blogging and open source code can be great partners.
END OF UPDATE

Note also that you need to use the original page name in the urchinTracker call. So if we are testing 'trial.htm', we enter in

urchinTracker('/trial.htm?Combination=' + combination);

3. Filter out the combination data from main profiles within Google Analytics
Why? Because otherwise all of your combinations will show up in your reports, causing ugly and confusing reports. All you have to do, as long as you have included the appropriate page name in the urchinTracker function, is add 'Combination' to your list of excluded query parameters. This will keep those combinations from showing up in your main profile. I recommend setting up a separate profile just to track your experiment data.

So why would you ever put yourself through this? Because the rewards can be great.

This is a report you would normally see in Google Website Optimizer:

gworeportsmall.jpg
Click to see the larger image

As you can see, only conversion rate is used to measure the success of a combination. What about other metrics? Here is an example of the things you can see if you use this integration. I hope you agree that this information is very valuable.

Click for Instructions for New Google Analytics Interface

Instructions for Old Google Analytics Interface:

For Unique Views, Pageviews, Avg. Time, %Exit, and $Index, along with Cross-Segmenting and Data-Over-Time, use the Dynamic Content Report. Find the page you are testing and drill down to see something like this:

dynamiccontentsmall.jpg
Click to see the larger image

For Bounce Rate data (for landing pages), use the Entrance Bounce Rates report:

bounceratessmall.jpg
Click to see the larger image

For conversion rates of multiple goals and preliminary navigation analysis, you could use the Initial Navigation Report:

initialnavsmall.jpg
Click to see the larger image

You can even get information about the full navigation resulting from the combinations using the All Navigation report.

Whew! If that were all you could do, that would be pretty cool, right? Well, there's more! Because the data is showing up in Google Analytics, it can be subjected to the same settings and filters that you use to segment data. You can exclude internal traffic, or use cross-segmenting to see if the source of the traffic had an impact on test results (like all AdWords traffic, for example). I'm not going to get into everything you can do, but there is an absolute ton.

Well, I hope you survived the article, and that you find this implementation useful. I think there are tons of applications for this, and I'd love to hear your comments about this tool. Thanks for reading!


If our experiences with paid search have taught us anything, it's that deliberate keyword lists, tightly structured accounts, and proven ads are only half of the equation. Intuitive landing pages tested with Google Website Optimizer experiments are just as essential for profitable PPC results. Learn more about how we maximize ROI from the search to the finalized sale.

Comments

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there was no A/B component to the Google Website Optimizer . You'll be happy to know that no workaround like this is necessary if you are using an A/B experiment. You simply have to know where to look within Google Analytics. Thanks for the question!

October 24, 2007 3:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Darcy:

Thanks for the compliments. There are certainly a lot of things Google Analytics can tell you about a running experiment. My personal favorite is the ability to look at segmented data. For example, which combination has the highest conversion rate for my AdWords traffic? What about for my Yahoo! Search Marketing traffic? They may not be the same.

Anyway, for those of you out there who are also using the tool, I'd love to hear what kinds of value you've gotten out of it (if any). Keep the comments coming!

October 24, 2007 3:12 PM

Jenny said:

Will this work correctly if we have one test with 2 sections, and the sections are on different pages? (Thanks Ophir for the idea!)

Do I place the Analytics code with "var combination = getcombo('2-2');" on both test pages?

By the way, this is a great solution. With this method, I can create two types of conversions. Within GWO, I set up the "do anything" conversion with onclick. And then in Analytics, I can set up url landing page conversions with goal settings. Tracking both is more ideal for our testing purposes than just seeing one.

Thanks!

November 29, 2007 5:27 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Jenny:

I suppose you could use this method to track a test that has more than one test page. You could certainly call the customized urchinTracker along with getcombo on each test page. This method will work on any page where the __utmx cookie is set (the Google Website Optimizer cookie).

Thanks for using it!

December 3, 2007 2:51 PM

James Dutton said:

Hi Shawn,
Great post - we recently made use of your scripts for a test we're running -so thanks!
We discovered a small cosmetic problem that malformed our GA data while the test was paused: We got an undefined error being passed to our content name when 'combinations' was not being set.
So rather than using:

urchinTracker('/originalpagename.htm?
Combination=' + combination);

We put an if..else statement in to make our data look a little more pretty while we are reviewing the implementation / testing code etc / pausing the test:
if (combination) {
urchinTracker('/originalpagename.htm?
Combination=' + combination);
} else {
urchinTracker('/originalpagename.htm');
}

It's by no means a critical problem...
Thanks again, and now looking forward to making good use of our data!

Cheers, J

December 7, 2007 2:40 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@James:

This is great - thanks for sharing this method with others. I hope you find the data you're getting to be useful - I'd love to hear more. For those of you out there pausing experiments while using the integration script, definitely use James' fix.

Thanks!

December 10, 2007 11:08 AM

Yaron said:

Hi,Thank you shawn for the great work.If I uderstand, the script works only with the old urchin script and not with ga.js?I wonder if it is possible to use the user define segmentation to solve this easily. when we use the ga.js we can simply call it like this: it simplify it all - I am testing it now.I would be very happy to hear if there is something incorrect that I am doing (it looks too simple :))ThanksYaron

January 29, 2008 10:44 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Yaron:

That's correct. Currently these instructions work for urchin.js. However, the .js file itself simply reads the cookie data and returns the correct combination number, and would work with either version. I haven't had a chance to look into this yet, but it seems some simple changes to the new Google Analytics code on the page would be all that's needed for this to work.

I've discussed using the User Defined segment for this information before, and it may be worth pursuing, but we prefer to save that variable for other things, like Michael's exact keyword tracking tool. Plus, with a User Defined variable, the data will persist well past the life of the experiment itself, so I shy away from using it in the short term.

I'll look into modifications to the code for ga.js - my hunch is that only a simple change will be needed. When I get a free moment to test things out, I'll make sure to post an update. Thanks for your comments!

January 29, 2008 11:07 AM

OP said:

Hi Shawn,

One of the questions I always have when using the GA & GWO integration hack is the confidence level for the data I'm getting in GA.

Of course, I can get it for the goal I'm using in GWO, but often I'll also use other "micro converion" goals in GA to see how a test is doing.

I just put up a very simple to use confidence level calculator so anyone can get the numbers themselves.

Check it out here:
http://www.prusak.com/conversion-confidence-calculator/

May 7, 2008 4:23 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Ophir:

Thanks for this neat tool. This is a great way for people to understand whether or not they've collected enough data within Google Analytics/AdWords/Optimizer to warrant a change on the site, regardless of whether or not they are using Google Website Optimizer. I've seen way too many cases where a rush to make a decision proved costly.

To give an example of how someone can use this without Google Website Optimizer, say I'm testing two different ads within an AdWords Ad Group, and I only use Conversion Tracker to make my decisions (not a great move, but it happens a lot). At the very least, now I can use your calculator and find out the confidence value of the test, and get an idea of how much more traffic I would need to get meaningful results.

Thanks again for offering this nice addition to the testing toolset.

May 8, 2008 8:37 AM

sunday gbertyo said:

Hello,
Thanks for the explainations, but the problem that a having is, i can't view the content pages, on how to 1. Put two JavaScript functions on the test page.

2. Change the Google Analytics tracking script to use the new functions.

3. Filter out the combination data from main profiles within Google Analytics using the links, as discribe here is this page, so i will like you to send me with the details on how to do that right in my account, i mean to the short cuts on how to click and perform all this actions, thanks for always been there, am still sunday gbertyo.

December 25, 2008 7:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@sunday gbertyo:

Sounds like you need quite a bit of help! Unfortunately, this blog isn't really the place for specific one-on-one help that is this detailed. There are a lot of free resources on the web, like the Google Analytics Help Center, and you can always hire us to help you with all of your Analytics needs. Thanks for reading!

December 31, 2008 9:40 AM

Ophir Prusak said:

Hi Shawn,

I was actually working on the same thing:)
Kudos for beating me to it.

I was going to use user defined visitor segmentation and not the query string.

For the most part, your solution seems better, but there are some scenarios where user defined segmentation would be helpful as well.

The only nescasary change is adding a getexperiment function (the data is also available from the __utmx cookie).

Then use something like this:
__utmSetVar('GWO/'+ experiment_id + '/' + combo_id);

This gives you the best of both worlds.

April 6, 2007 5:59 PM

Ben Krull said:

This is a GREAT post! We are just starting to test Google website optimizer and I was disappointed that it only worked through adwords.

I'm really interested in seeing how the conversions change when segmented by keyword. Being able to automatically customize and optimize landing pages across thousands of keywords in a campaign would be a goldmine.

Thanks for the post Shawn,

Ben Krull
Media Specialist | space150

April 7, 2007 12:22 AM

Shawn Purtell said:

@Ophir:

I thought about using the User Defined variable, and you could do that using a similar function to the one in this post (the getcombo() function: Really, you could just put in the Experiment Name instead of reading the cookie). I think using the urchinTracker function has two (and possibly more) big advantages:

1. It doesn't 'use up' your one precious user defined variable, so if you wanted to do another kind of segmentation, things would get very sticky.

2. Having the combinations show up within the reports allows for extremely easy access to the metrics noted in the post (like full navigation, which would be unavailable using the User Defined variable).

Feel free to use the function in setting the user defined variable. I'm actually pretty interested in testing the differences.

Thanks for posting!

April 9, 2007 8:45 AM

Shawn Purtell said:

@Ben:

Thanks for the kind words! I feel the same way. We're still in the process of testing just how powerful something like this will be, but I have high hopes.

April 9, 2007 9:04 AM

Ophir Prusak said:

Hi Shawn,

1 - I was doing some testing and found something you need to add to your instructions:
The getcombo() and urchinTracker(...) calls must come after the GWO code.

The first time you visit the page the __utmx variable doesn't exist until after the GWO code has been run.

I was getting an error that __utmx didn't exist when I visited a page for the first time and the getcombo() call was before the GWO code.

2 - I agree that using a query parameter is overall better than a user defined visitor segmentation. The only case where user defined segmentation is better is when performing a multi-page experiment.

Any chance you linking to my article that covers advanced features (like multi page experiments):

Click here for the article

thanks
Ophir

April 9, 2007 12:44 PM

Shawn Purtell said:

@Ophir:

Thanks for the great input. I've modified the article to include the suggestion you bring up in #1. The function definitely will not work if the cookie has not been created, which happens in the control script on the test page.

I can see how using the User-Defined variable for a test that occurs across pages could be valuable. However, you could still use the method above. You could for example, create one profile for pages with element A and another profile for pages with element B and compare them. You could, of course, do this in a single profile. I still recommend saving the User Defined variable for more useful segmentation.

April 9, 2007 1:08 PM

René Dechamps Otamendi said:

Hi Shawn,

Thanks a lot for your post. It resolves one of the big questions I had regarding WO: how to measure other things than conversions. I've just forwarded your post to my team that attended the GAAC training in Dublin a couple of weeks ago.

Thanks for sharing this with the rest of the world!

Please if you come to the Emetrics in San Francisco or Washington, drop by and I'll be glad to invite you to a mojito or a beer ;-)

Keep up this excellent work,

René
CEO OX2

April 9, 2007 1:32 PM

Shawn Purtell said:

@René:

Thanks for the comment! It's nice to know that the international community may find this as useful as I do.

Thanks also for the kind invitation. If you're ever in the Chapel Hill or Raleigh, NC area, the same goes for you.

April 9, 2007 1:48 PM

Ophir Prusak said:

Hi Shawn,

Any chance taking a few minutes and making the script grab the page URL automatically?
I'd love to make the script a common include file.

April 9, 2007 5:30 PM

Mikey said:

Shawn,

Great work mate - rest assured the international ones among us are finding info like this hugely useful.
I'm sure there are plenty of fellow Aussies that'll be using this excellent idea very soon.

As Rene said - thanks for sharing!

Cheers,
Mikey

April 9, 2007 6:35 PM

Shawn Purtell said:

@Ophir:

Feel free to modify the script for your own use. I tried to keep it simple so that people could customize it.

The reason I don't have the script grab the URL is that many people use custom urchinTracker functions already (for static php URLs and the like), and keeping it simple allows anyone to modify the script in a way that fits their particular situation.

Thanks again for all of your great input.

@Mikey:

We're all international ones, right? :) Thanks for the nice words.

April 10, 2007 8:56 AM

Peter Koning said:

Thanks Shawn. I was wondering how to mix in GA with WO. The WO instructions for integrating the two had me confused. This should help ... and take it to the next level.

May 2, 2007 6:07 PM

Shawn Purtell said:

@Peter:

Thanks for the nice words. I wasn't even aware that there were now official GWO instructions for this. I'll definitely check them out. I'm glad you found the post useful!

May 3, 2007 8:39 AM

Charles said:

Certainly looks good!

Quick one - sorry if this isnt quite the place to post.

We use a media agency for our Adwords campaign, who lump all the PPC for ALL their clients into one account.

Due to this, we can not have user access to our Adwords campaign, ergo we cant use GWO.

Anyone know a way out of this - I have heard Google are looking at providing client level access to adwords accounts?

May 15, 2007 10:37 AM

Shawn Purtell said:

@Charles:

Ack! Has your media agency heard of an MCC? If not, they should start using one.

You should always have your own individual AdWords account so that you can be in complete control of your ad spend. But that's another story altogether. This in turn allows you complete control of any GWO experiment you want to run.

Currently there is no way around your particular problem. But if you don't have access to your own AdWords account, it sounds like you have a bigger problem to deal with. Also, a company who has MCC access to your AdWords account will not be able to access Google Website Optimizer. This would be great feature for Google to add.

May 15, 2007 11:08 AM

Liquid Vitamins said:

Shawn,I am having a hell of a time with the code for both GA and WO.

I am doing a site wide navigation test to see if effected conversions when I changed it a few months ago. I have created the site wide header and footers. It looks like GA and WO are tracking visitors and WO is flipping the changes correctly.

Problem is that while GA has the correct conversation data WO is not picking up on it at all. Is there anyway you could take a quick look?

I will pay you for your time. After jumping through a bunch of hoops to get this all up it seems I am missing just the last piece. I was going to use your script there are 90 pages it will go on. I will use the script once I get into page testing but one thing at a time for now.

June 10, 2007 11:20 AM

Shawn Purtell said:

@LV:

It just so happens that fixing these types of problems is what I do for a living.

If you would like to hire us for support, we'd be happy to help. You can view our support plans here.

If you would like to contact our sales team to discuss your specific problem, you can use our contact form, located here.

June 11, 2007 9:20 AM

Ophir Prusak said:

Hi Shawn,

Just found a bug in your code.
I posted a bugfix here:

Click here for the article

- Ophir

June 13, 2007 11:12 PM

Shawn Purtell said:

@Ophir:

We haven't noticed the bug in any test that I've run so far. I did notice one problem that I updated in a more recent post about this integration, found Here

If you could provide details about the bug you found, that would be much more helpful, so that I could make sure sure to fix the code I developed.

June 14, 2007 8:48 AM

Ophir Prusak said:

Hi Shawn,

I added a some more information to my post, but most importantly, I created a page that shows the bug. I basically test out getcombo in several scenarios, and you can see that sometimes the number it returns is wrong.

You can see the test page here:
http://www.prusak.com/gwo/getcombo_test.html

June 14, 2007 2:36 PM

Shawn Purtell said:

@Ophir:

My blog post has been updated to reflect your fix. Thanks for making this available to everyone, as I think it's a very valuable tool.

June 14, 2007 4:17 PM

Nick said:

Hello Shawn,

Thanks for making this tool. I been testing it to integrate Google Analytics with their Website Optimizer. I found a small problem, however. When I stopped my experiment I left the gwo_analytics_integration.js code in there, thinking there wouldn't be a problem. I didn't notice any issue in Firefox, but in Internet Explorer I started getting javascript errors. This was because the '__utmx' wasn't being set after the experiment was over but the javascript was not checking for that possibility. I updated the code to check for a null value, so the updated getcombo code looks like:


function getcombo(variations)
{
var utmx_cookie_value = readCookie('__utmx');
if (utmx_cookie_value != null) {
var cookie_data_array = utmx_cookie_value.split(':');
var combination_id = cookie_data_array[2];
var temp = combination_id.split('.');
var ids = temp[0].split('-');
var x = ids.length;
var multiplier = [];
var factor = 1;
var sum = 0;
if (variations != undefined) {
multiplier = variations.split('-');
}
for(i=0; i sum += ids[i] * factor;
factor = (multiplier[i] > 0) ? factor * multiplier[i] : Math.pow(x,i+1) ;
}
return sum;
}
else {
return -1;
}
}


Thanks,
Nick

July 16, 2007 6:21 PM

Shawn Purtell said:

@Nick:

Thanks for pointing this out. I actually had added this error handling a little while ago, but I never updated the file on the server (My apologies). I used a slightly different method than you did, but it basically does the same thing.

Thanks again for helping to make sure this tool works as well as it possibly can.

July 17, 2007 8:45 AM

Leah said:

I've implemented your gwo_analytics_integration.js script into my site to integrate GA with GWO. I've run 2 separate GWO experiments and both times I've noticed the same problem. In GA, when I look at the content screen and filter by the word 'combination', it returns most of my combinations with data, but it seems to miss one or two (generally the last ones).

For example, I ran an experiment with 2 sections and my original and 1 variation in each. I included the number of variations in the getcombo function - getcombo('1-1') as mentioned. When I logged into GA (after about 5 days of running the experiment) I saw results for my page with the URL variables combination=0, combination=1, and combination=2. I was missing combination=3 (there should be 4 total combinations). GWO was showing that all combinations had been served. I ran into the same issue with my 2nd experiment, except this time I had 2 sections with my original and 2 variations in each, so I used getcombo(2-2). Again in GA I was missing some combinations, specifically combination=7 and combination=8 (the last 2).

In both these instances I noticed that one or two of the combinations was showing much higher unique page views than the rest, which shouldn't really be the case since GWO serves the different combinations as equally as possible.

Have you noticed this issue before? Is it possible that views for the last combination(s) is/are getting tracked in GA under another combination (which would account for the higher number of unique page views).

I've checked my code multiple times to ensure it is being implemented properly. I would really like this to work properly as I think it is a very powerful tool, but if the data in GA can't be trusted, then it becomes useless.

If you have any suggestions, or have maybe heard of others experiencing the same issues, I'd really appreciate the help.

Thanks,
Leah

September 25, 2007 2:51 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

Fortunately, it looks like there was just a miscommunication in the instructions. The number of variations should include the original, so your first experiment should have called getcombo with "2-2" and not "1-1". Since the cookie was being created for 2-2, there was a discrepancy that caused you to see incorrect information in Analytics.

So if you have 2 sections, each with an original and 2 additional variations, you would use getcombo('3-3') (as in your second example).

I hope this helps. Thanks for your feedback.

September 27, 2007 11:17 AM

Leah said:

Shawn,

Thanks for your help. I'm going to try running my WO experiment again, and this time pass the proper values to the getcombo() function.

Leah

September 27, 2007 5:55 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Leah:

No Problem. I hope everything works for you!

October 1, 2007 8:56 AM

nic said:

This is for the multi variant part of GWO; how would it work for the A/B test part of GWO?

October 9, 2007 12:41 PM

Darcy said:

Just b/c you may be driving more traffic through your GWO test page to your GWO conversion page does not mean that the traffic is more qualified to make a buying decision (especially if the purchase is several clicks away). Using the above technique you can qualify your GWO conversions based on GA real revenue (and other metrics). In some cases \x96 less more qualified traffic clicking through a testimonial page for example is more profitable then a ton of traffic that hasn\x92t read a long testimonial (you see the long copy will slow the click through rate, but it will qualify and educate the visitor increasing the likely hood of a sale) \x96 so you have to temper how you design your test page and what the actual metric of importance is. Is it click through or is it revenue \x96 or is it a combination of both \x96 and now thanks to Shawn and Ophir we can do that.

Awesome post and great work around \x96 thanks Shawn.

October 24, 2007 1:05 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@nic:

This tool was created back when there wa