Skip to content

Commit

Permalink
Merge pull request jekyll#177 from MikkCZ/issue-158
Browse files Browse the repository at this point in the history
Honor DNT for Google Analytics
  • Loading branch information
DirtyF authored Jan 16, 2018
2 parents d2ffebc + 0fbe8cd commit 98553e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion _includes/google-analytics.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<script>
if(!(window.doNotTrack === "1" || navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1")) {
(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','https://www.google-analytics.com/analytics.js','ga');

ga('create', '{{ site.google_analytics }}', 'auto');
ga('send', 'pageview');

}
</script>

0 comments on commit 98553e3

Please sign in to comment.