From 4467d41325dc99ee2917360cb6703c1ba09b319a Mon Sep 17 00:00:00 2001 From: Scott Walkinshaw Date: Tue, 20 Jan 2015 23:35:01 -0500 Subject: [PATCH] Improve Google Analytics conditional loading The current logic for condtionally including the GA snippet is confusing and bit inconsistent. In development you would see logging when the snippet wasn't included but this wouldn't happen if you were a logged in admin. Now there's only two cases: 1. Production non admin user: GA snippet is loaded. 2. Anything else (development or admin user): log output --- lib/assets.php | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/assets.php b/lib/assets.php index 39f9a17..81fcbc9 100644 --- a/lib/assets.php +++ b/lib/assets.php @@ -84,23 +84,25 @@ add_action('wp_head', __NAMESPACE__ . '\\jquery_local_fallback'); * * Cookie domain is 'auto' configured. See: http://goo.gl/VUCHKM */ -function google_analytics() { ?> - +function google_analytics() { + ?> + +