]> iEval git - mindcoding-template-patches.git/commitdiff
Make evil-google-evil-analytics conditional
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 1 Feb 2014 18:48:27 +0000 (20:48 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 1 Feb 2014 18:48:27 +0000 (20:48 +0200)
evil-google-evil-analytics.js

index 15062bc970e22337fce6febf079f717b98dd5cd9..4c829f15cbd4b2b3cce9858980d17b604773d710 100644 (file)
@@ -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');
+}
This page took 0.023904 seconds and 4 git commands to generate.