The Beginner's Guide To Event Tracking In Google Analytics

What Is Event Tracking ?

Event Tracking is a method available to all websites set up using the ga.js tracking code, which allows users to record user interaction with website elements that Google Analytics wouldn’t originally have control of. These include:

  • Tracking Outbound link Clicks
  • Tracking PDF/Multimedia Downloads
  • Tracking interactions in the whole DOM with JQuery
  • Embedded Media Interaction

This is accomplished by attaching the method call to the particular element you want to track. Once set up, all user activity on such elements is tracked and displayed as Events in Google Analytics’ reporting interface. Finally, Event Tracking uses an  object-oriented model that lets you to specify each element in the function, and allowing you to tailor and breakdown any data displayed exactly how you would like it.

How do I set up Event Tracking?

Event Tracking can be set up on your site by following these simple steps:

1. Make sure GA is currently tracking on your website

2. Call the _trackEvent () method in the source of a page element, widget or video (In this example I use an anchor tag)
<a href="#" onClick="_gaq.push(['_trackEvent', 'Category', 'Action', 'Label']);">Anchor Text</a>

3. Rename the following elements in the code snippet

  • Category (Required)  The name you supply for the group of objects you want to track
  • Action (Required)  The last required element, commonly used to specify the user’s interaction with the web object.
  • Label (Optional)  An optional element used to provide additional specifics to the user event.

Breaking down the function

To show you a complete breakdown of each of the required* elements needed for event tracking to work. To make this as easy as possible to understand, I have used Event Tracking on an anchor tag:
<a href="#" onClick="_gaq.push(['_trackEvent', 'Category', 'Action', 'Label']);">Anchor Text</a>

Categories *

For Event Tracking, a category is a name you give to group elements you want to track. With Categories being the top tier element in the structure of Event Tracking, you would typically make this related to the type of element you want to track. These can be as specific as you like, but always bear in mind the expansion of your website and the possibilities of adding additional tracking in the future.

For example, some possible ideas for categories are as follows:
_gaq.push(['_trackEvent', 'PDF', 'Download', 'Hot Tub Brochure']);
_gaq.push(['_trackEvent', 'Banner Ads', 'Lead Gen', 'Home Cat ID 2']);
_gaq.push(['_trackEvent', 'Videos', 'Play', 'Never Gonna Give You Up']);

Actions *

In Event Tracking, the term “Action” refers to the second parameter in the _trackEvent () code snippet. It’s good practice to use the action parameter to label the type of interaction you want to track on the web element. Some good examples of this parameter are:

  • ‘Play’
  • ‘Pause’
  • ‘Stop’
  • ‘Exit Site’
  • ‘Download’


The term “Label” refers to the third parameter in Event Tracking. The Label Parameter may be optional; however, I would suggest using this to uniquely identify which web element you are tracking. For example: you may have one page with two ad spaces, so without the Label Parameter you would just be tracking the following;
<a href="siteOne" onClick="_gaq.push(['_trackEvent', 'Banner Ads', 'Lead Gen']);"><img src="siteOne.jpg" a></a>
<a href="siteTwo" onClick="_gaq.push(['_trackEvent', 'Banner Ads', 'Lead Gen']);"><img src="siteTwo.jpg" ></a>

In this situation, when you go to approach your advertisers to review the performance of the advert, you will not be able to distinguish which leads were whose. However, if you set up your Event Tracking with labels, you will be able to not only tell how many leads each ad generated, but you will now have started to collect data to determine which ad slot is your prime real estate and price it accordingly.

Where can I find the results in GA?

Event Tracking results can be found under the content tab. Here, you navigate to the drop down menu titled “Events”, where you have the following sections available:

  • Overview – Unsurprisingly, this section gives a brief overview of the performance of the events you are tracking.
  • Top Events – Similar to overview, here you have complete control on how you segment the data.
  • Pages – Here you can view which pages trigger the events. Great if you are tracking a single object which is present on numerous pages.
  • Events Flow – This section brings a more visual overview of the user’s journey

Troubleshooting / FAQ

In this section, I will be answering any questions you post in the comments section below.

What can I use event tracking for?

Outbound Links

With Google Analytics not being able to grant you access to unverified website data, it is hard to determine whether your site’s exit rate stats are due to you leading your traffic away through outbound links or the user not finding what they want.
<a href="#" onClick="_gaq.push(['_trackEvent', 'Category', 'Exit Site', 'Label']);"> Web Element</a>

Some examples of good outbound links to track:

  • Icons to social profiles
  • Advertising Space to analyse performance
  • External services such as live help chats


Event Tracking can also help track the performance of your downloads, which is good for seeing which are the most popular.

Some examples of downloads to track:

  • PDF’s / Brochures
  • Multimedia

<a href="#" onClick="_gaq.push(['_trackEvent', 'Category', 'Downloads', 'File Name']);">Web Element </a>


Using JQuery opens up the whole DOM to interactions. For example if you wanted to track specific extension downloads you could use the following code (replacing “extension” with PDF would track all PDF downloads).

$(document).ready(function() {$('a[href$="extension"] ') .click(function()) {_gaq.push(['_trackEvent', 'Extension Category', 'Extension Action', $(this).attr('href')]);});});

In Conclusion

Overall, Event Tracking can provide a critical insight into further analysing your users’ interactions with your site. It is pretty easy to set up and can provide you and your client with information to progress further in your internet marketing efforts. Even if you only have one or two things you want to track, it is still worth the effort as you never know how your site may evolve in the future.


Our starting point is you. We spend time getting to know your business, its challenges and your goals.


We listen, then we create. We explore different approaches, techniques and strategies based on your needs.


Our experts work collaboratively to build a complete and effective web design and digital marketing solution.


We prioritise measurable results and will report, analyse, test, assess, tweak and develop continuously.

Get in touch today on 0115 959 8900 or Contact Us

Loading Images...

Looking for more leads for your business? Let's work together.Start your journey
Google Partner

Loading Reviews…