Anuncia aquí

Google Analytics: urchinTracker is not defined

Muchos de los sitios que usan Google Analytics para manejar sus estadísticas, presentan un -pequeño- error en javascript cuando el visitante usa Firefox.

Google Analytics errors

Google Analytics errors

Para solucionar -realmente- este pequeño error, pueden usar una versión modificada del script de Google Analytics o cambiar lo siguiente para evitar que se muestre el error:

html:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>

<script type="text/javascript">
_uacct = "....";
urchinTracker();
</script>

por:

html:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>

<script type="text/javascript">
_uacct = "....";
if (typeof(urchinTracker) == 'function') {
  urchinTracker();
}
</script>

Esta entrada fue publicada en Firefox, Google, JavaScript, Varios

6 Comentarios

  1. 1 Javier Pérez (4 de diciembre de 2006, 01:38:58 pm) http://javierperez.eu

    Hola Alex. El error lo da por culpa de la extensión AdBlock, que filtra http://www.google-analytics.com/urchin.js. Y por lo tanto, como no carga ese javascript, la función urchinTracker no queda definida cuando se llega a _uacct = "..."; urchinTracker();

    Yo pondría un "if (urchinTracker) urchinTracker();". Pero sólo por ser un poco quisquilloso ;)

    Saludos.

  2. 2 alex (4 de diciembre de 2006, 01:43:42 pm) http://www.buayacorp.com

    Ah, no me había dado cuenta de ese detalle, gracias por hacer notar mi error.

    En cuanto a tu sugerencia, probé eso y seguía dando error, por eso puse el código un poco más largo

  3. 3 FooManChu (4 de abril de 2007, 10:24:55 pm) http://foomanchu.com/

    Not only AdBlock, but also NoScript.

    If the Firefox extension NoScript does not explicitly allow google-analytics.com, then again, urchinTracker will not be defined.

  4. 4 alex (5 de abril de 2007, 09:02:52 am) http://www.buayacorp.com

    Yeah, you're right ;)

  5. 5 Joe (15 de abril de 2007, 06:38:05 am) http://ebooksandthings.blogspot.com

    Thank you so much, I have been looking for this fix for more than 6 months. I was having the problem in Internet Explorer. All fixed now. Gracias.

  6. 6 Aaron (19 de mayo de 2008, 07:26:07 am) http://www.aaronsink.com

    I have found that if you put the javascript code directly in the footer file instead of calling it from the footer file the script works without any modification.

3 Trackbacks

  1. Por Tidav Blog » urchinTracker is now defined el 27 marzo 2007 a las 12:39 am

    [...] une petite recherche sur Google, je suis tombé sur cet article qui indique parfaitement la marche à suivre pour qu’il n’y ait plus [...]

  2. [...] way around this was to use the code from http://www.buayacorp.com/archivos/google-analytics-urchintracker-is-not-defined/ and the problem should go away. It seems that the suggestion in this thread over at Google groups [...]

Publicar un Comentario

Tu email nunca será publicado o compartido. Los campos requeridos están marcados con un *

*
*

Puedes usar estas etiquetas y atributos HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>