Blast Analytics and Marketing

Analytics Blog

Supporting Leaders to EVOLVE
Category: Digital Experience

Website Optimizer Tips for Tracking Complex Conversions

December 18, 2008

You don’t need to have a separate page to track Website Optimizer conversions

We’ve learned that many people struggle with how to setup conversion tracking in Google Website Optimizer for videos, product demos, ajax forms, multiple forms on a page, or other pages that either have multiple desired actions or don’t have any clear actions. We’ve provided three solutions for tracking these complex conversions using GWO’s Javascript code to either track the time on page, link clicks, or form submissions as a conversion.

Conversion Tracking for Videos & Demos

Want to know how well your videos or product demos are working? You can test the effectiveness of one video style versus another style of video using the time on page as a conversion goal. For example, if the two videos you are testing are say 2 minutes long you can set the conversion to be counted when they reach the full 2 minutes. Or maybe count a conversion at the point where the meat of the video wraps up (say at 75% of the way through the video at the 1 minute and 30 second mark). This type of conversion tracking is a great way to be able to utilize Google Website Optimizer to determine which video your users respond better to.

Google Website Optimizer Javascript Code for tracking time on page
To use this method you will need to add the code below, in place of the Conversion code provided in the Website Optimizer tool. This new code should be pasted into the page after your tracking script, and immediately before the </body> closing tag. You’ll need to update the _uacct and urchinTracker variables with your own account numbers (they’ll be the same numbers that appear in your tracking script on the same page).

<script>
if(typeof(urchinTracker)!=’function’)document.write(‘<sc’+’ript src=”‘+
‘http’+(document.location.protocol==’
https:’?’s://ssl’:’://www’)+
‘.google-analytics.com/urchin.js’+'”></sc’+’ript>’)
</script>

<script>
setTimeout(‘_uacct = “UA-xxxxxx-x”;urchinTracker(“/xxxxxxxxx/goal”);’, 60000);
</script>

To modify the amount of time that should elapse before a conversion is counted, change the 60000 figure above. This figure represent milliseconds, so 60000 equals 60 seconds.

Google Website Optimizer Conversion Tracking for Link Clicks

If you don’t have one specific conversion page because more than one link destination page (i.e. action) from a page can count as a conversion than this is a great technique to use.

Code for Tracking Links as a Conversion
First, put this code below right after the <body> tag:

<script>
if(typeof(urchinTracker)!=’function’)document.write(‘<sc’+’ript src=”‘+’http’+document.location.protocol==’
‘)”>https:’?’s://ssl’:’://www’)+’.google-analytics.com/urchin.js’+'”>’)
<!–
function ConversionCount()
{
_uacct = ‘UA-XXXXXXX-X’;
urchinTracker(“/XXXXXXXXXXX/goal”);
return true;
}
// –>
</script>

Next, put this code on every link you want to track. Your link would look like this:

<a href=http://www.yahoo.com/” onclick=”return ConversionCount();”>You text link</a>

Google Website Optimizer Conversion Tracking for Ajax Forms

If you don’t have one separate conversion page due to the use of Ajax forms that submit to the same page or have multiple forms that submit to multiple destinations you can use this technique to track the specific forms actions that you want to count as a conversion.

Javascript Code to track a form that submits to the same page like an ajax form use this code on the onsubmit:

<form action=”/cart.html” method=”post” onsubmit=”return ConversionCount()”>

Questions?
Leave a comment here or ask a question on our Google Website Optimizer Group on LinkedIn

Kayden Kelly
About the Author

Kayden is the Founder and CEO of Blast Analytics & Marketing. He leads overall strategy and execution in positioning Blast as a leading analytics and digital marketing consulting company. An industry trailblazer who stays ahead of trends and opportunities, Kayden has spent nearly two decades building his expertise in all areas, with a deep focus on analytics, search engine optimization, and user experience. He is an evangelist for “the customer,” helping clients create sustainable competitive advantage by developing, optimizing, distributing, and connecting valuable content to customer needs. Connect with Kayden on LinkedIn. Kayden Kelly has written on the Blast Digital Customer Experience and Analytics Blog.