Add Google Analytics

This commit is contained in:
2017-07-10 19:17:58 +01:00
parent 33c90a3c1e
commit 4f8f4d434d
3 changed files with 12 additions and 0 deletions

10
_includes/analytics.html Normal file
View File

@@ -0,0 +1,10 @@
<script>
if (window.location.hostname == "{{ site.hostname }}") {
(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', 'UA-102330905-1', 'auto');
ga('send', 'pageview');
} else { _gaq = []; };
</script>