Analytics has come a long way over the past ten years. We started with simple hits and visits from daily log analysis, then moved on to real-time tagging and more “modern” tracking methods. Along the way we’ve gained the ability to segment, test various ideas, and filter out the noise from our website data. Today, we have the ability to add data to website visitor activities to gain another level of insight.
When web analysis started, the only data we had access to was that coming from the web browser stored in server log files. This included the pages/files requested, computer information and visitor IP address. Even if the visitor had logged in and we had a complete profile on them, we couldn’t do anything with that data. Today, thankfully, we can insert these additional data points, such as demographics (age, gender, etc.), preferences (heavy user, light user) or even memberships levels (non-member, basic, premium), into the data stream and use this data in our analysis.
Each analytics package has it’s own way of handling custom variables, both in the number allowed and the code-level configuration. Below is a video from Google about how to handle this in Google Analytics (fast forward to 11:21 in the video – audio quality is not great).
One custom variable implementation that DigiKnow did that I think is a little outside the box, is using the page-level variable to track 404 (page not found) errors on a website. This may be a little more technical than I usually get here, but to explain what we did, the line of code in red was added to the 404.html page for the website. The parameters on the “setCustomVar” call are indicating: slot/key #1, Category of variable, Value for category and that the variable is page-level (3).
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-XXXXXXXX-1");
pageTracker._setCustomVar(1, "Error", "404", 3);
pageTracker._trackPageview();
} catch(err) {}</script>
What results from this is new content in the Custom Variables section (under Visitors)
More importantly, now I can setup custom report “Pages with 404 Errors” and a segment “Visits with 404 Errors” and see how and why visitors are getting to pages that don’t exist.
If the technical details here are daunting, don’t worry, there are experts to help with that. Just knowing that you can bring customer profiles or other custom variables (like the 404 example) into your analytics data should get your mind going about what else you might want to track.
