Developing against the Google Analytics Tracking API is a pain. Not only is it a bit of a black box, but the actual statistical output only updates every so often. It isn’t easy, but I love the power it enables.
Long have I wished that someone would create some sort of testing library, either to replace the Analytics script itself, or to sit alongside it and output any interactions with the Analytics server. Until now it hasn’t existed – until now.
I present the Google Analytics Testing script. This bad boy utilises the Firebug script console to output most information you care about going to Google Analytics. Great for AJAXy trackEvent projects or anything else doing more than the rudimentary Analytics set and forget stuff. It works as a Greasemonkey script or you can include it in a script tag anywhere in your HTML. It doesn’t prevent the data itself being sent through to the data, but that is something that may change in a future version of the script.
This script currently relies on the existence of the Google Analytics script, but in the future will exist as a standalone script.
I would love any feedback, bug reports or ideas as to how to make this better and more useful.
Install it now with Greasemonkey or include it in a script tag.