

Combining and Compressing Disqus' and Google Analytics' JavaScript - mudgemeister
http://mudge.github.com/2011/01/29/combining-and-compressing-disqus-and-google-analytics-javascript.html

======
enomar
"Both seem terse enough and are meant for inclusion in at the bottom of your
web page."

That isn't true for Google Analytics. It's designed to be placed at the bottom
of the head section:
[http://code.google.com/apis/analytics/docs/tracking/asyncTra...](http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html#Installation)

~~~
mudgemeister
You're right, enomar; I've updated the post to reflect Google's recommended
placement of the asynchronous snippet (and your other comment regarding the
script type attribute only defaulting in HTML5).

Perhaps instead of appending to document.body, it would be better to use
document.documentElement.firstChild to use the head element instead (this is
what is present on <http://diveintomark.org>).

------
enomar
"it turns out that the type attribute is optional"

It is optional for HTML5, but not for 4.01:
[http://www.w3.org/TR/html401/interact/scripts.html#adef-
type...](http://www.w3.org/TR/html401/interact/scripts.html#adef-type-SCRIPT)

