WordPress.org

Ready to get started?Download WordPress

Forums

Google Analyticator
Move external-tracking.js from header to footer (1 post)

  1. jsdalton
    Member
    Posted 11 months ago #

    You should move the external-tracking.js to the footer. See this page for why: https://developers.google.com/speed/docs/insights/BlockingJS

    This can be accomplished by adding true as the final argument passed to wp_enqueue_script here:

    wp_enqueue_script('ga-external-tracking', plugins_url("/google-analyticator/external-tracking{$suffix}.js"), array('jquery'), GOOGLE_ANALYTICATOR_VERSION, true);

    Since the functionality for this script is all wrapped in the ready() function it won't accomplish anything until the page is loaded anyway. At present, having it load in the default header also pushes jquery to the header. Google will dock your PageSpeed score for this here: https://developers.google.com/speed/pagespeed/insights/

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

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.