Event Tracking Made Easy

I recently had a client ready to launch a microsite for a new promotion. The microsite was chock full of informative case studies that were relevant to our paid search audience, and the client’s main focus was to make sure people were downloading them. A lot of clients have problems coming up with enough content for SEM engagements – finding a client that’s got content bursting at the seams is fantastic.

There was a small catch, though: the case studies were out in the open on the page, just a link to a PDF. Visitors didn’t need to fill out a form or get through a gate to access the PDFs, and the client’s boss was unconvinced that a gate was necessary.

My client was exasperated on the phone. “How will we keep track of this?”

The answer, as it is so often, is Google Analytics.

Google’s magical tracking suite offers a feature called Event Tracking that’s perfect for our scenario. Using a tiny bit of coding and a little bit of planning, we can capture every time a visitor snags a PDF from any page on the site, even across multiple marketing channels.

Here’s how:

  1. Make sure Google Analytics is tracking on your site. Point It recommends using the new asynchronous tracking code.
  2. Set up the _trackEvent () call on the object you’re tracking. Here’s the little bit of coding mentioned before. Don’t worry, it’s easy.

Here’s your template: _trackEvent(category, action, opt_label, opt_value)

What’s With The Variables?

  • Category is the name you’ll give to each event you want to track. In our scenario, the category is PDF downloads.
  • Action is what someone is doing with that event. In our scenario, the action is Download.
  • Opt_label provides an additional but optional layer of info for each action. This is handy for labeling the name of the PDF being downloaded.
  • Opt_value is another optional variable for assigning values to each action. It’s also great for tracking video events, such as how long it takes a video to load off the site.


In our example, we supplied the site team with a trackEvent snippet for each download link that defined a PDF category, Download action and labeled each PDF with the filename for easy sorting. They added the reference into the rest of the javascript on the page.

Once the site management team updated the code and we collected enough data, we could watch the downloads roll in through GA’s Event Tracking interface, located under Content.

total events

The example here is only one way to use Event Tracking. You can track button clicks, widget usage, video downloads and playback… the options are limitless. As for our client, we can keep tabs on how many PDFs get downloaded, then make a case for putting them behind a lead gate in the future.

Have you used Event Tracking? Let us know what you did in the comments below!

Point It About the author
  • Sean

    Can you elaborate on why you used events instead of __trackPageview()? I was just looking at doing this earlier, Google’s documentation suggests the latter.



    August 11, 2010 at 8:02 am
  • Sure, Sean, the answer’s pretty simple really. The client is also checking the stats on PDF downloads and didn’t want to dig through the Top Content view to find what they’re looking for. Using Events keeps everything separate, something the client was really keen on.

    _trackPageview is fantastic, though, and we originally considered using it. Event Tracking gives us just slightly more control.

    August 11, 2010 at 8:10 am
  • Lisa Sanner

    This actually doesn’t sound that difficult. I remember a couple of years ago, people trying to figure out pop-unders or something like that. Once again, GA is a headache reliever.

    August 12, 2010 at 4:05 pm

Leave a Comment: