Google Analytics plugin - emit in footer, not <head>
Posted: Wed Nov 05, 2008 4:09 pm
Looking at the google analytics plugin, I see that is uses the frontend_header hook, and not the frontend_footer hook.... I think it should use frontend_footer. I modified my own copy of the plugin, and it works fine.
The reason for this is, according to google:
I did see some contradictory information here: http://developer.yahoo.com/performance/ ... #js_bottom
Not sure what document.write has to do with it, and the google analytics code does use document.write, but it seems to work fine placed in the footer hook.
I could commit the change myself, but my cvs client never seems to want to cooperate. I'm suggesting someone else make this change unless a really good reason can be provided why it should not be there. Same goes for any other plugins emitting in the <head> element that really do not need to be there.
I leave the code running for a few hours just to make sure GA is still tracking the site I made the change on, then I will report back here...
The reason for this is, according to google:
Code: Select all
Copy and paste the code segment into the bottom of your content, immediately before the </body> tag of each page you are planning to track.Code: Select all
In some situations it's not easy to move scripts to the bottom. If, for example, the script uses document.write to insert part of the page's content, it can't be moved lower in the page.I could commit the change myself, but my cvs client never seems to want to cooperate. I'm suggesting someone else make this change unless a really good reason can be provided why it should not be there. Same goes for any other plugins emitting in the <head> element that really do not need to be there.
I leave the code running for a few hours just to make sure GA is still tracking the site I made the change on, then I will report back here...