Google Blogoscoped

Forum

Change Google Analytics code

WebSonic.nl [PersonRank 10]

Friday, November 14, 2008
15 years ago2,609 views

I noticed a change in the Google Analytics code,

New is,
"} catch(err) {}"

   <script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("XXXXXXX");
pageTracker._trackPageview();
} catch(err) {}</script>
  

Jeremy Kuo [PersonRank 0]

15 years ago #

I noticed that too. I think it's a preventative measure for IE7 woes. The "try catch" statement prevents the runtime error dialog box from loading up when a JS error is encountered.

WebSonic.nl [PersonRank 10]

15 years ago #

Strange, now when i look in Analytics i see the old code again......

Forum home

Advertisement

 
Blog  |  Forum     more >> Archive | Feed | Google's blogs | About
Advertisement

 

This site unofficially covers Google™ and more with some rights reserved. Join our forum!