Dorem - Jérémie Bouillon wrote:
On 01/05/2011 13:31, Krinkle wrote:
Just out of curiousity, to avoid or perhaps solve
why does it have to be at the end per se ? What is it you want to
Two things. First, I'm starting to seriously use MW, so it helps me
learning it :-)
Second in this specific case, it's for Google Analytics. Since they
extension with the appropriate code anymore, and they strongly
place it here (last thing before /head).
I'll adjust the code position in the future with more test and
when my site goes public, but right now I don't see the harm in
following their recommendation, and perhaps more important to have the
same result across the various part of my site (hence, having it
on the same spot).
The Google Analytics script doesn't rely on any other resources. The
/position of the script inside the <head> (or <body>) doesn't matter.
Google however likes to keep things simple for users to avoid
They recommend placing it right before </head>, that way everybody
knows where it must go, even for users who have little to no clue about
HTML and the Document Object Model.
I'm pretty sure it doesn't make any difference where you add it in your
document as long as it's parsed by the browser.
If you look at other scripts from google they sometimes say "inside
sometimes "at the end of <body>" or "right before </head>"
or ".. </
It's just a way to simplify it for the users. It doesn't have to be at
end of beginning of a tag, nor should it matter whether it's in <head>
Add it somewhere and see if it works. If it does, you're doing it