New Google Analytics tracking code with 'try and catch'

Google made some changes to the analytics code and added a try and catch block which will have the effect of halting any messages from the Google Analytics tracking code snippet throwing up to the visitors who have enabled JavaScript messaging in their browsers. These addition should not have any impact on tracking if the old code is still in place.New […]

Google made some changes to the analytics code and added a try and catch block which will have the effect of halting any messages from the Google Analytics tracking code snippet throwing up to the visitors who have enabled JavaScript messaging in their browsers. These addition should not have any impact on tracking if the old code is still in place.

New Google Analytics Tracking Code:

&lt;script type="text/javascript"&gt;<br />try {<br />var pageTracker = _gat._getTracker("UA-XXXXX-X");<br />pageTracker._trackPageview();<br />} catch(err) {}<br />&lt;/script&gt;

About The Author

Deepak Gupta is a IT & Web Consultant. He is the founder and CEO of diTii.com & DIT Technologies, where he's engaged in providing Technology Consultancy, Design and Development of Desktop, Web and Mobile applications using various tools and softwares. Sign-up for the Email for daily updates. Google+ Profile.