WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Google Analyticator] Moving GA code from header to footer (4 posts)

  1. rossfedrik
    Member
    Posted 4 years ago #

    Hi,
    We have doubt that Google Analytics is slowing our page load, that's why we have decided to place it in footer, but I didn't find any option in the Google Analyticator plugin to do that, so I decided to remove the plugin, and manually place the code in footer, but even though after deactivating/deleting the plugin still the google analytics code is getting generated in the header, kindly suggest us how to remove the code from header.

    Many Thanks,
    Ross

    http://wordpress.org/extend/plugins/google-analyticator/

  2. dwwhit
    Member
    Posted 3 years ago #

    I would remove the plugin completely. Alternatively, if your plugin contains the wp_footer(), you can edit googleanalyticator.php, around line 98, and change wp_head to wp_footer.

  3. christo.ebe
    Member
    Posted 3 years ago #

    You can

    (1) deactivate the plugin
    (2) Delete the plugin
    (3) Edit your header file to see if there is a plugin code / analytics code
    (4) add ur analytics code in the footer, I mean hard code it in the footer.

    This is a very minor issue, when only one file needs to be edited to add this code, there is hardly a need for a plugin.

  4. cavemonkey50
    Member
    Posted 3 years ago #

    If you're running 6.1, yes, the tracking code is in the header, but this is by design. 6.x uses a new version of Google tracking code called async tracking.

    Basically, instead of loading the tracking code in order with the page (like previous versions of the tracking code), the tracking code is loaded in parallel at the same time. A browser visiting a page with the async tracking code will load both the page and the tracking code at the same time without conflicting. This means that even if Google's servers fail, the page content will load just as fast as if the code was not even on the page.

    The reason for now placing this code in the header is it increases the reliability of ensuring visitors are tracked. Previous versions of the code could miss visitors if they navigated away from the page before everything loads. Since there are no issues with slowing the page like previous versions of the code, the tracking code is placed at the top to give it a higher chance of loading before navigating away.

    You can read more about the async tracking code here: http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html

Topic Closed

This topic has been closed to new replies.

About this Topic