Move external-tracking.js from header to footer
-
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/
- The topic ‘Move external-tracking.js from header to footer’ is closed to new replies.