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

  1. jsdalton
    Posted 2 years 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/


Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.