From 8cdd1a21faa971a9d914ccae3e577437d39bc866 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sat, 1 Feb 2014 20:48:27 +0200 Subject: [PATCH] Make evil-google-evil-analytics conditional --- evil-google-evil-analytics.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/evil-google-evil-analytics.js b/evil-google-evil-analytics.js index 15062bc..4c829f1 100644 --- a/evil-google-evil-analytics.js +++ b/evil-google-evil-analytics.js @@ -1,7 +1,11 @@ -(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ -(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), -m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) -})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); +var dnt = navigator.doNotTrack == "yes" || navigator.doNotTrack == "1" || navigator.msDoNotTrack == "1"; -ga('create', 'UA-47497115-1', 'mindcoding.ro'); -ga('send', 'pageview'); +if(!dnt) { + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-47497115-1', 'mindcoding.ro'); + ga('send', 'pageview'); +} -- 2.39.2