Google analytics hacks: A real-time stats bookmarklet and full referring URLs

[article index] [] [@mattmight] [rss]

Google analytics is a powerful tool for analyzing your web site's traffic. Yet, by default, it lacks easy access to some very useful features: (1) real-time stats and (2) the [full] referring URL.

To get real-time stats, I've created a bookmarklet (and bookmarklet generator) that takes you to stats for today up to the most recent hour.

And, to get the full referring URL (useful when your site lands somewhere like Hacker News and you're trying to figure out how), this article shows you how to configure a custom filter to expose the full URL.

When combined, these two hacks make it much easier to jump into a discussion of your site while it's happening, rather than finding out after the fact and missing the opportunity to connect with folks and answer questions.

Real-time stats

Google analytics collects stats in near real-time, but it doesn't provide easy access to them. To get real-time stats, I created a bookmarklet that supplies a manually constructed interval that specifies today:

With [YOUR ID HERE] replaced with the site's analytics id. To get your site's id, open analytics and look for the portion of the URL that says "id=". (If it says "scid=", then you want to replace "id=" with "scid=" as well.)

If you're not inclined to hack the bookmarklet, enter your analytics URL:

to that you can drag to your toolbar:

Once you've got the bookmarklet, you can see how your site is doing today with just one click.

Referring URLs

For some reason, Google analytics doesn't provide the full referring URL by default. This is annoying when your site gets linked from a forum or a site like Hacker News that uses query parameters to identify pages.

If you want to see the full URL, you can set the "User Defined Value" to the referring URL with a filter. Go to Analytics Settings > Filter Manager, and then create a filter that matches the following:

Wait about an hour and then check your real-time stats to see if it's working. New visits should have the full referring URL available inside User Defined Value.