Tracking 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.
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'.
<a href=”mailto:email@example.com”>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:
Read more about the attributeStartsWith selector here.
Sit back and watch your email conversions being tracked!