Just a small JavaScript addition can solve a minor bug in Google’s Analytics Script. If anybody has a common AdBlocker installed and visits your Google Analytics enhanced page, she will notice 2 errors, including the famous: “_gat is not defined”. Looks like the google script does not validate if the actual tracking script is already loaded before it is executed.

As a quick work around add the following BOLD lines around your script:

<script type="text/javascript">
if (typeof(_gat) == 'object')
{ 
var pageTracker (YOUR TRACKING CODE)
...
}
</script>

ét voilá.

Advertisements