New Tools to Debug Your Tracking Code
Wednesday, August 25, 2010 | 2:50 PM
Labels: Analytics API, Code and Configuration
Raise your hand if any of this sounds familiar to you:
- You just set up your tracking code and you're wondering if it's correct--and you want to know right now.
- You have decided to migrate your tracking to the new asynchronous syntax--but you want to know if your syntax has any errors.
- You finally decided to customize the tracking code for cross-domain tracking--but you're worried that you might break your tracking.
- You want to make sure that your campaign is set up to the correct goal.
The Google Analytics team has launched a debugging version of the Analytics Tracking code called ga_debug.js to verify your tracking code setup. To make it even simpler, we also created a Chrome extension which uses the ga_debug.js script, which allows you to use the new ga_debug.js without re-tagagging any of your content. You can also use this extension to verify what information is sent to Analytics with each page.
How does it work? First, the ga_debug.js script provides a testing version of the tracking code which will print common syntax errors and tracking analysis messages to the browser’s JavaScript console. Secondly, the Chrome extension which automatically enables your page to use the debug version of the JavaScript without any need for you to retag or recode your pages.
How do you use it? The most simple thing to do is to download the Tracking Code Debugger extension for your Chrome browser. Next, turn on the extension by clicking on the icon to the right of the address bar on Chrome.
Finally, visit a page that contains the tracking code you want to test and open up the Chrome JavaScript console to see the messages (detailed instructions). That's it!If you want to go use ga_debug.js without the Chrome extension, read all about how to do this in our newly revised Troubleshooting Guide on Google Code. You can use the script on your testing environment to verify extensive tracking code changes. Make sure, however, that you don't use this version of the tracking code on your production website--the script is meant for debugging and analysis, not speed, so you should always use this as a testing mechanism only. If you want to learn more about the kinds of errors this script can help you find, see Common Tracking Code Errors/Typos in our Troubleshooting Guide. While the ga_debug.js script doesn’t catch all possible errors yet, we think it’s off to a great start and will get even better over time.
Happy testing!
Brian Kuhn on behalf of the Analytics Team


14 comments:
dukehoops said...
Very nice addition to the tool box. But once a GA user debugged their JS and is convinced that the problem is on GA side, what should s/he do? There is no help from the 'help forum'. Is there premium (paid_ support available from Google?
http://www.google.com/support/forum/p/Google+Analytics/thread?tid=4d5ea0173db497be&hl=en
3:15 PM
Stephane Hamel at immeria.net said...
Interesting, but haven't anyone heard of WASP? A Firefox extension that makes it a snap to view the exact data being sent to GA (and about 150 other tools, including GWO specific calls).
Disclaimer: I created WASP a few years back, now owned by iPerceptions.
3:33 PM
Mark said...
Let me know when you actually get it working.
At the moment it does nothing.
9:22 PM
Brian said...
@Mark - Make sure you open the Javascript console and turn on the extension. If you see no output at all in the Javascript console, you may not have GA installed on the page.
9:30 PM
nathan said...
Nice to see you providing helpful debugging mechanisms. In the spirit of Google's approach you should also consider the ObservePoint extension. Unlike other great solutions, it's free ;)
10:45 PM
Tyler Broadbent said...
11:01 PM
Tyler Broadbent said...
I second the Observepoint plugin. It's currently only for Firefox, but they are always updating it and adding new features. It's a great debugger similar to Firebug but for analytics.
Google's GA tool should be nice too with some polishing, if the results are anything like their other products.
11:03 PM
Erwin said...
Nice tool, but it doesn't show if anonymizeIp is enabled. You still have to check if aip=1 is set as get parameter.
1:57 AM
30.45 N,76.48 E said...
I use omnibug on Firebug-pretty useful and works fine with GA ,and Its free
2:19 AM
runwolf said...
There is a free version of WASP, but if you buy the analyst version, it provide a lot more insight than any other tools. You can also use it to automate your QA and it's a lot cheaper than any web base site audit solutions and there is no limit on size ;-) You also get SEO and competitive market analysis functionality as part of the deal. It’s a great product !!
4:56 AM
Jon said...
Cool plug-in, however, it breaks my Google Reader.
10:34 AM
Beth said...
I really like this tool. However, your tool does not provide Campaign Medium nor Campaign Name from a paid user. Organic works perfect.
My ads are auto-tagged.
11:56 AM
Kristian said...
Some other tools are mentioned in the comments. Anyone who knows the pros and cons of them?
11:53 PM
Francisco said...
Firefox version?
8:43 PM
Post a Comment