

News Archive
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
How To Track Email Conversions in GA
April 22, 2010, 7:00 amTracking Goals in Google Analytics is vital to tracking conversions and having a grasp on your performance over time. However, it’s important to remember that Goals can apply to so much more than simply a sale or page view. A client of ours measures a conversion as simply an email being sent to one of their specialists, whose email details are displayed on relevant pages as the users browses around. Currently tracking and measuring these emails can only be carried out by cc-ing another email address each time an enquiry is sent. With the client’s service being of extremely high value, and an email being the first step to a sale, this primitive way of tracking in not sufficient.
A quick Google Analytics goal creation, followed by some Javascript reworking in your code means ten minutes work can ensure you’re tracking email conversions in a much more sophisticated way.
Step one:
Assuming Google Analytics is installed on your website, head over to the ‘Goals’ section and hit ’Add Goal’
We’ll need a name that describes this Goal correctly for future reference and the Goal type must be set to ‘URL destination’.
In Goal Details we need to set the ‘Goal URL’. This is essentially a fake page simply in place for tracking, and can be anything you like as long as it remains the same in your JavaScript code (see below), for now we’ll just stick with a variation on the Goal Name. Goal Value is optional and can be left blank, however if you can apply a Value to each email enquiry sent for yours or your client’s business – then stick it in here.
Step two:
With the Goal in place we need to apply some simple JavaScript to our email address html to ensure each email click is tracked. So where a typical email address might appear like this:
<a href=”mailto:johnsmith@email.com”>Email John Smith</a>
We need to apply some javascript so the code looks like this, ensuring the URL in the javascript code is exactly the same as the Goal URL set in Analytics:
<a href=”mailto:johnsmith@email.com” onClick=”javascript:pageTracker._trackPageview(’/mailto/email’);”>Email John Smith</a>
Ok, so now for the hard part – applying this code to every email address across your site. Our client literally has hundreds of different email addresses across the website and editing the html code for each of these manually would be a colossal waste of time. By putting our development hat on for a few mins and learning a little jquery, we can edit all these email addresses across the site in no time!
Sticking the following code into the header of each page ensures each anchor with a href that starts with ‘mailto:’ has the page tracking code appended to it:
$(document).ready(function() {
$(“a[href^='mailto:']“).each(function(){
pageTracker._trackPageview(’/mailto/email’);
});
});
Read more about the attributeStartsWith selector here.
Step Three:
Sit back and watch your email conversions being tracked!






