b4r7

come risolvere: “_gat is not defined”

by lelebart on mag.06, 2009, under siti

via: http://vpxcc.wordpress.com/

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á.


Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Caro lettore, commentando, dichiari di aver letto e accettato la privacy policy di questo blog raggiungibile a questa pagina: Privacy.