diff --git a/templates/layout.html b/templates/layout.html
index 00b3606c..eede7928 100644
--- a/templates/layout.html
+++ b/templates/layout.html
@@ -81,13 +81,17 @@
activationElement: null
};
document.write('');
- (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-70822533-1', 'auto');
- ga('send', 'pageview');
+ var dnt = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
+ if (dnt != "1" && dnt != "yes") {
+ window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
+ ga('create', 'UA-70822533-1', 'auto');
+ ga('set', 'anonymizeIp', true);
+ ga('send', 'pageview');
+ } else {
+ console.debug("Respecting Do-Not-Track, not running analytics.");
+ }
+