WordPress.org

Support

Support » Plugins and Hacks » Google Analyticator » [Plugin: Google Analyticator] Why is GA code not added to footer?

[Plugin: Google Analyticator] Why is GA code not added to footer?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Christine Rondeau

    @crondeau

    Volunteer Forum Moderator

    Google changed that not long ago. They now recommend adding the GA code in the header and, I’m guessing here, that’s why it’s added in the header.

    What you could do, however, is not use a plugin and just add the code to your footer.php.

    Tom

    @jeffreeeeey

    Thanks Christine, never realised that.

    Sometimes I do add a snippet to the functions.php file to include GA code in the footer of the site (a nice clean way of adding it), but for this particular site, I’d like to use this plugin as I’d like to have the stats widget in the dashboard.

    Looks like I’m going to need to rip into the plugin’s code to do so.

    Any ideas how I might go about doing it?

    Christine Rondeau

    @crondeau

    Volunteer Forum Moderator

    No idea… I’ve never ripped open a plugin before. Personally I would live it as is and just accept the fact that the code is in the header. Google recommends having it there anyway, so…. I wouldn’t lose sleep over it.

    Hi Tom,

    Google highly discourages the tracking code placement anywhere but the <head> section of the HTML document. There are no disadvantages to doing so as the tracking is done asynchronously. I have a detailed FAQ explaining the placement available here: http://forums.ronaldheft.com/viewtopic.php?f=5&t=967

    Tom

    @jeffreeeeey

    Thanks,

    I’ll stick with it then. Just wanted to tidy it up a little. The snippet I’ve been using on other sites (to add it via the functions.php file, into the footer) was via Chris Coyier’s “Digging into WordPress” site.

    Although that said, the post in question from which I got it from is from back in 2010 so I guess it’s out-dated now.

    Thanks for the response, I’ll leave it as is 🙂

    Hi
    Does one need to separately add the tracking code in the header.php or is the analyticator doing this by itself, using the google verifier api?

    Also, when I do ad it, it shows up on my public screen at the very top of my page, how do I prevent this, if it needs to go there?
    Thanks
    Paul

    matmancini

    @matmancini

    the analytics script may be run async in the header, but pulls jQuery from the bottom and place it in the header.
    naughty naughty…

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Google Analyticator] Why is GA code not added to footer?’ is closed to new replies.
Skip to toolbar