| |

Google Analytics Tracking Code Updated

And you don’t need to make the change.

Christina explains the change:

So why the change? Adding the try and catch to the snippet removes the possibility that your visitor sees a JavaScript message that doesn’t apply to her. It’s a fairly rare occurrence because messages like these (frequently in the form of an alert box) can only appear if JavaScript messaging has been enabled on the browser. Most browsers have JavaScript messaging turned off by default, but sometimes people unintentionally turn it on. For those visitors who have enabled messaging, the try and catch will have the effect of halting any messages from the Google Analytics tracking code snippet.

The updated code is:

<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("UA-50020-1");
pageTracker._trackPageview();
} catch(err) {}
</script>

Have you updated the code?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.