From dc0e838c2f9a7c3ecd5c1a29675e2ad3750c8a38 Mon Sep 17 00:00:00 2001 From: QWp6t Date: Wed, 6 Aug 2014 20:55:12 -0700 Subject: [PATCH] Only load GA in production environment Loads Google Analytics when `WP_ENV` is 'production' Otherwise it passes `ga()` arguments as an array to `console.log()` Also sets cookie domain to be auto configured. --- lib/scripts.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/scripts.php b/lib/scripts.php index b515346..53a0822 100644 --- a/lib/scripts.php +++ b/lib/scripts.php @@ -79,15 +79,23 @@ add_action('wp_head', 'roots_jquery_local_fallback'); /** * Google Analytics snippet from HTML5 Boilerplate + * + * Cookie domain is 'auto' configured. See: http://goo.gl/VUCHKM */ function roots_google_analytics() { ?>