Understand your customers by bringing all of your data together so everyone in your organization can explore, gain intelligence and inform strategies to increase business performance. Learn more.
While browsing through some of the entries in the Google Analytics Help Forum, I found a useful thread on how to troubleshoot tracking code errors. Borrowing heavily from the conversations in the thread, I've summarrized the top ways to fix your tracking code here on the blog. Hopefully, after reading this post, you'll never have to return to work after the weekend to find that you have no data in your Analytics account!
· Make sure you have your Google Analytics Tracking Code installed on your site by checking your site's page source. I know, it seems obvious -- but it's actually one of the most common implementation errors our users encounter.
· Remember to enter the code somewhere between the <body> and </body> tags, preferably towards the </body> tag.
· Get rid of unnecessary line breaks in your code. Copy the tracking code exactly as it's generated from within your 'Instructions for adding tracking' page. For example,
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js'
· Having more than one Include filter in a profile may cancel out data collection for that profile. Try removing extra Include filters so that you've only assigned a maximum of one to your profile.
An example of the try and catch block is below:
If you don't believe in the wisdom of crowds, hang out in our Google Analytics Help Forum and you may change your mind. Try asking a question on it or browse through other posts answered by our community of savvy Analytics users (we love you guys!).