Skip to content

Google Analytics Event Tracking Explained

2010 June 12
by FavorHosting

Most websites already have Google Analytics tracking turned on, however most people do not take the time to learn some of the more advanced features of Google Analytics. This blog post is intended to highlight one of those useful features: Event Tracking.

Step 1: Make sure that if you already have Google Analytics installed on your website that the JavaScript is placed at the top (just after the first tag).

Note: Usually Google Analytics is inserted at the bottom of pages for faster page loads.

After you have confirmed Google Analytics is being used by your website you can then add the tracking code to the pages you want to track specific events.

Example:
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'XX-XXXXXXXX-X']); (Account number will be unique)
_gaq.push(['_trackPageview']);

Step 2: Tracking a link clicked on your website

In order to track links that were clicked on your website you just need to add a javascript code snippet to your hyperlink.

Example:
<a href=”http://www.example.com” onClick=”_gaq.push(['_trackEvent', 'Category', 'Action']);”>Example</a>
Both Category and Action are required parameters for indicating the category being tracked, and the action is the specific action you are tracking.

Step 3: Tracking a Form being Submitted

In order to track how many times your signup form, or contact form has been used you need to add another tracking code to your form html source.

Example:
onSubmit=”_gaq.push(['_trackEvent', 'Contact Form', 'Submit']);”

Where ‘Contact Form’ is used to track which contact form is being tracked. The onSubmit event must be within your

tag on your web page.

That is pretty much all you need to get going with tracking your events using Google Analytics.

Viewing the results inside of Google Analytics

Under the Content menu there is a submenu for Event Tracking as shown here:

Event Tracking

With easy to access reports for all of the events being tracked as shown here:

Event Tracking Reports

Visit Google Analytics for more information.

Possibly Related Posts:


One Response leave one →

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS