Skip to content

Commit

Permalink
Visitors that have Do Not Track enabled are not tracked
Browse files Browse the repository at this point in the history
Fixes point 3 in Issue PaycoinFoundation#30
  • Loading branch information
MitchellCash committed Oct 31, 2015
1 parent 0cf5ccb commit 5405c60
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
12 changes: 4 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -427,15 +427,11 @@ <h4>Useful sites</h4>
<!-- Custom Theme JavaScript -->
<script src="/js/grayscale.js"></script>
<script>
(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-69138554-1', 'auto');
ga('send', 'pageview');

if( navigator.doNotTrack != "yes" && navigator.doNotTrack != "1" && window.doNotTrack != "1" && navigator.msDoNotTrack != "1" ){
script.src = 'js/analytics.js'

This comment has been minimized.

Copy link
@boxhock

boxhock Oct 31, 2015

I get an error on script. Using $.getScript(); then it LGTM

}
</script>

</body>

</html>
7 changes: 7 additions & 0 deletions js/analytics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(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-69138554-1', 'auto');
ga('send', 'pageview');

0 comments on commit 5405c60

Please sign in to comment.