Blog
Typo3: Turning off Google Analytics tracking for your browser
When using Google Analytics, in order to get a real picture of what is going on on your site, its very important to disable the counting of hits from your own browser. The Google Analytics FAQ documents how to do this by setting a cookie on a hidden web page by adding onload to the body tag on the page. http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55481 However its not immediately obvious how to do this in TYPO3, in fact while its not obvious it is still rather easy, and can be done in just 2 steps using a custom body tag.
- Create a regular page and hide it in the menu. Add a piece of plain text to it
- Create an extention template for the page, and in the Setup section add one the following pieces of code:
If you are using the old urchin.js code in your pagepage.bodyTag = <body onload="javascript:__utmSetVar('no_report')">If you are using the new ga.js in your pagepage.bodyTag = <body onload="javascript:pageTracker._setVar('no_report')"> - Your done! Just visit the page you created and then set up the custom filter as per the Google documentation and your own hits will no longer be counted
Bookmark on del.icio.us