Note that this snippet has to be inside the <body>
for it to work — it won’t work when included in the <head>
. Also, in IE6, it would cause a security warning in IE6 for HTTPS pages.
Do what you want with this code, but please don’t use it. Use the more robust optimized Google Analytics snippet instead.
This snippet breaks the “no globals!” rule, but then again ga.js
relies on the global _gaq
variable.
Great stuff, @jed!
Note that this snippet breaks the following 140bytes rules:
_gaq
is required to be global for Google Analytics to work correctly