Skip to content

Commit

Permalink
Add support for Google Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsiwiec authored and lyyourc committed Nov 5, 2016
1 parent 8e83c5c commit 6e824ce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 4 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# basic
title: lyyourc
title: lyyourc
subtitle: You Are The JavaScript In My HTML
favicon: favicon.ico

Expand Down Expand Up @@ -31,3 +31,6 @@ node_sass:
outputStyle: nested
precision: 5
sourceComments: false


google_anlytics: # Put tracking ID here
12 changes: 12 additions & 0 deletions layout/_partial/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,16 @@
<link rel="shortcut icon" href="<%- url_for(theme.favicon) %>">
<%- css('css/app') %>
<!-- <link rel='stylesheet' href='http://fonts.useso.com/css?family=Source+Code+Pro'> -->
<% if (theme.google_analytics){ %>
<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', '<%= theme.google_analytics %>', 'auto');
ga('send', 'pageview');
</script>
<% } %>
</head>

0 comments on commit 6e824ce

Please sign in to comment.