« Always use server-side data validation | Main | Upcoming visit from Gert Franz of Railo »

Track, graph, and then email reports on just about any data with Google Analytics

At work we've been trying to figure out how best to use Eloqua, which is a campaign management and lead-tracking tool. Like many other services, Eloqua offers email and webinar campaign management, but it also adds something of great value-- the ability to track your leads' activities from the email or webinar through your web site. So, not only can you tell just which leads opened your email newsletter and attended your webinar broadcast, but you can see whether they've registered on your site, or downloaded a demo of your product. Many other campaign management tools will send out email campaigns for you, but don't offer that kind of end-to-end user tracking.

So Eloqua is great at tracking unique user behavior.. but it's not very good at aggregate reporting and graphing. The process of making a chart is painfully slow, and you can't choose your time intervals-- you're pretty much limited to showing aggregate activity per day instead of per week or per month. I'm sorry, Eloqua folks; this makes finding trends from your data well nigh impossible.

Around the same time, we started implementing Google Analytics so that we could at least get a look at some aggregate trends. Google produces beautiful reports, but only for web page views, where Google's JavaScript code can be embedded and sent down to the user's browser. This means, on the surface, that you can't track downloads.

Or so I thought. But then I found something in the Google Analytics help docs which made me realize that you can track downloads. And with a little bit of creative thinking, I realized that you could use the same technique not only to track actual requested URLs, but contrived URLs that represented any data you wanted to track.

The idea came to me while I was reading in the help section about how to track downloads. You see, as a part of the standard Analytics tracking code that you place on every page of your site, you're making a call to the _trackPageview() function. What the help docs reveal is that you can actually pass any URL as an argument in that function. For instance, you can track the request of a downloadable file by embedding a call to the _trackPageview() function in your hyperlink:

a href="/downloads/map.pdf" onclick="javascript: pageTracker._trackPageview('/stats/downloads/map.pdf');">Download our map

Once you pass the download information to Google, you can look up the activity in the Content Drilldown section, like so:

google-analytics.png

Comments (2)

Cool tip.

Interesting. It's just that most people include the Google Analytics code at the bottom of the page (as instructed by Google), but in order to use this technique, you have to move the code block above any calls to _trackPageview, etc. Just a reminder.

Also, I've integrated Eloqua into sites before and remember being able to pass 'non-web page' info on by using one of their 'redirect' scripts. For example, instead of "a href="/downloads/map.pdf", you could use "a href=/elqNow/elqRedir.htm?ref=http://www.domain.com/downloads/map.pdf"

Post a comment