How to Check If Google Analytics Click Tracking is Triggered

When I add new Event or PageView tracking code that is bound to click events, I want to be sure that the tracking code is fired without waiting for a site visitor to trigger it (or in some cases before the code is even on a live page). Because my own traffic is filtered out of all of my Google Analytics reports, I can’t rely on my clicks to show in my reports (not to mention the delay). But, even with the filter in place, the clicks are sent to Google, and I can check to be sure they’re sending the right information in Firefox using Firebug’s Net panel. Here’s how.

Enable the Net tab

If you don’t already have Firebug installed in Firefox, get it, because you need it for this.

Once it’s installed, enable the Net panel.

Load the page you want to test. Once you do, you’ll see a lot of stuff pop up in the Firebug Net panel. One of my posts looks something like:

Look for the PageView

Once you have enabled the Net panel, you can see if your Google code triggers the initial pageview. Look through the requests for one that starts with _utm.gif?. Expand it by clicking on the arrow to the left of it.

Looking at the params tab (it defaults to headers), you can see the information being passed to Google. The first line is your unique tracking ID. You’ll also see your page title, the domain, and most importantly, the URL being passed.

If you don’t find the _utm.gif? entry, something is wrong with your basic GA tracking code and no data is being sent to Google.

Trigger your event or new pageview and find the tracking info

After verifying that the GA code is tracking the pageview, you can see if your click event code is working. To do so, trigger an event that you’ve attached tracking code to. In my screenshot, I open an external link, which I’ve coded to trigger a GA event. It’s important that if you are triggering a link to a new page that you open it in a new tab or window so that your Firebug Net panel still tracks the original page.

A new _utm.gif? line should show up in the Net panel. Expand this new tab. If you triggered another pageview, the params will look similar to those mentioned earlier. Events look a bit different.

Click to view larger version

The important field here is utme, which shows the information you passed in the _trackEvent call. The arguments you passed to _trackEvent are separated by asterisks. Mine reads Outbound Link**Why is date() returning 12/31/1969. This is because I track my outbound links under the category Outbound Link, with the external URL as the action and the h1 text on the page the call was triggered from as the label.

Yours will likely differ depending on your schema for event tracking.

Again, if you don’t find this new _utm.gif? call in the Net panel, your click event code isn’t running, or the GA _trackEvent/_trackPageview code is set up incorrectly. You’ll need to debug it, then check again.

Now you know how to check if your code is working. What do you use Google Event or Pageview tracking for?

17 thoughts on “How to Check If Google Analytics Click Tracking is Triggered”

  1. Just what I was looking for. Waiting a day for the results to show up in analytics would have have a bit nerve-wracking.

  2. Hi! I am from Chile and want to thank you for the great article. But I have a problem…

    I have a one-page website. It doesn’t contain any links, so I have nothing to trigger (don’t know how to set up events either). I just need to know the number of visits, technology they are using, traffic sources, and so on. How can I check if Google Analytics is correctly installed?

    I decided to access the page using rarely used browsers and operating systems, to see if Analytics tracks those visits. I used Konqueror, Opera and Lynx from Linux, but after about 8 hours I don’t see the visits in Analytics.

    I would really appreciate your help.

  3. This post has helped me narrow down my issue with GA not processing the event. The gif appears to be loading in Firebug, but never actually executes. I’m thinking there is some lag once you remove an IP from filtering that is causing the issue.

  4. Thanks! Thought I had things set up correctly, only to wait a whole day and find no results in Analytics. Ran firebug, tested a second configuration, all’s well.

  5. Oh btw, my utme looks like this:

    utme 5(cloudflood*Share*CloudFlood)

    Not sure what is that 5 in front of it … is it alright?

    My event is set like this:

    onmousedown="_gaq.push(['_trackEvent', 'cloudflood', 'Share', 'CloudFlood']);"

  6. Bruno, I’m not sure what the 5 is either, but it is in front of all utmes I’ve ever seen, on many different site configs. I imagine it means something to Google’s parsing algorithm.

    1. Hey Kristian, try adding return false at the end of the onclick event handler, like this:

      You Link Here

      Returning false kills the event propagation so the browser doesn’t try to change location.

      1. My bad, I didn’t properly encode my HTML:

        <a href=”#” onclick=”_gaq.push([‘_trackEvent’, ‘Site Forms’, ‘Hey’, ‘TPS Report’]); return false;”>Your Link Here</a>

  7. Thanks a lot for this post, Rachael! You saved me a few hours of pecking around trying to figure out if our AJAX platform was properly recording hits!

Comments are closed.