Add google analytics

This commit is contained in:
Cole Bemis 2017-04-30 16:51:46 -07:00
parent 0bd43ce36c
commit 7f501e139e
3 changed files with 18 additions and 1 deletions

View File

@ -8,4 +8,7 @@ exclude:
- icons-manifest.json
- bin
- sandbox
- stash
- stash
# Google Analytics Tracking ID
google_analytics: UA-63028889-4

10
_includes/analytics.html Normal file
View File

@ -0,0 +1,10 @@
<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','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.google_analytics }}', 'auto');
ga('send', 'pageview');
</script>

View File

@ -18,6 +18,10 @@ description: Feather is a collection of simply beautiful open source icons. Each
<link href="https://fonts.googleapis.com/css?family=Rubik:300,400" rel="stylesheet">
<link rel="stylesheet" href="style.css">
{% if site.google_analytics and jekyll.environment == 'production' %}
{% include analytics.html %}
{% endif %}
</head>
<body>
{% include header.html %}