Tracking Clicks in Emails Using Google Analytics

Published in: Email - Google Analytics

google analytics advancedMost use Google Analytics to track simple metrics like page views, what keywords do people type in search engines before they land on our website, where the visitors are coming from, what pages are most popular and so on.

Now this kind of data can be collected using any other web stats program so here we explore some more powerful “click tracking” features of Google Analytics.

How to Track Clicks in Email Messages

Say you have written a wonderful article that fellow bloggers may like to blog about. You are likely to send them an email with a link to the story but how do you track if people actually clicked on that email link ?

Enter URL Builder - a free tool from Google Analytics. Just type the URL of your blog article and put the following values (Campaign Source=<Your Website Name>, Campaign Medium="email", Campaign Name=<Title of your Blog Post>)

Press the Generate URL button and send that new tagged link in your email message. Here’s a sample URL after tagging:

email-campaigns To see how well your email performed, go to Traffic Sources -> Campaign and select the campaign name (which in this case is “My Great Article”).

You can extend this idea for tracking clicks to your site that may have originated from RSS newsreaders or even blog newsletters that are sent via FeedBlitz or FeedBurner.

Track Clicks on Links That Point to External Websites

Say one of your articles links to a story on CNN website or contains an affiliate link that points to some product on How do you track which external links are popular with your site visitors ?

Fortunately Google Analytics offers a very easy way for tracking outbound clicks or links to pages that are on external websites (e.g. Just append the onClick attribute to your <a> tag as shown here:

<a href="" onClick="javascript:urchinTracker('/external/');>CNN</a>

You can then see the number of clicks to from your own website by opening the Content -> Top Content report of Google Analytics.


If you have a large website, adding this urchinTracker function to every external link manually may be very tedious so here’s an alternative - add this small javascript from iqBlog to your website and all your outbound clicks with be tracked automatically.

Track Document Downloads (like Word Docs, PDF, MP3, etc)

If you link to files like PDFs, Word Documents, MP3 songs, Video Podcasts, etc that visitors can download from your website, consider using Google Analytics to track downloads so you have a good understanding of non-HTML content that is popular on your site.

Tracking file downloads with Google Analytics is easy - just add the following onlick function to your <a> tag.

<a href="" onClick="javascript: pageTracker._trackPageview('/downloads/GoogleAlerts'); ">

If the manual approach of tagging every link sounds impractical, get this javascript file from and put it anywhere before the Urchin code in your blog template. It will track all file downloads from your site automatically without you have to tag any link.

To see the statistics for file downloads and, navigate to the “Content” section then select “Top content”.

Google Analytics - More Advanced Techniques

Want more ? Watch these video presentations by Analytics gurus Alex Ortiz and Avinash Kaushik - they definitely know Analytics better than anyone else.

📮  Subscribe to our Email Newsletter for Google tips and tutorials!
Published in: Email - Google Analytics

Looking for something? Find here!

Meet the Author

Web Geek, Google Developer Expert
Amit Agarwal

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India. He is the developer of Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

Get in touch

Google Add-ons

Do more with your Gmail and GSuite account

We build bespoke solutions that use the capabilities and the features of Google Workspace for automating business processes and driving work productivity.

  1. Mail Merge with Attachments
    Send personalized email to your Google Contact with a Google Sheet and Gmail
  2. Save Emails and Attachments
    Download email messages and file attachments from Gmail to your Google Drive
  3. Google Forms Email Notifications
    Send email notifications to multiple people when a new Google Form is submitted
  4. Document Studio
    Create beautiful pixel perfect documents merging data from Google Sheets and Google Forms
  5. Creator Studio for Google Slides
    Turn your Google Slides presentations into animated GIFs and videos for uploading to YouTube