Skip to content
This repository was archived by the owner on Dec 24, 2020. It is now read-only.

Commit 2aa6802

Browse files
authored
Merge pull request #40 from connorshea/add-g-analytics
Add Google Analytics.
2 parents f93b2ae + 54ed324 commit 2aa6802

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/views/layouts/application.html.erb

+11
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@
88

99
<%= stylesheet_link_tag 'application', media: 'all' %>
1010
<%= javascript_include_tag 'application' %>
11+
<!-- Google Analytics -->
12+
<script>
13+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
14+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
15+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
16+
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
17+
18+
ga('create', '<%= ENV["GA_ID"] || nil %>', 'auto');
19+
ga('send', 'pageview');
20+
</script>
21+
<!-- End Google Analytics -->
1122
</head>
1223

1324
<body>

0 commit comments

Comments
 (0)