come risolvere: "_gat is not defined"

Hey, ho scritto questo articolo 14 anni e 11 mesi fa.
È molto probabile che nel frattempo le cose siano cambiate.

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

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

*

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.