Skip to content

Commit 607b906

Browse files
committed
Updated the Google Analytics tracking code
1 parent 3a7eb77 commit 607b906

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

app/views/shared/_analytics.html.erb

+10-17
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
<% if ENABLE_TRACKING %>
2-
<script type="text/javascript">
1+
<% if ENV['GOOGLE_ANALYTICS'] %>
2+
<script>
3+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
4+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
5+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
6+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
37

4-
var _gaq = _gaq || [];
5-
_gaq.push(['_setAccount', 'UA-797907-8']);
6-
_gaq.push(['_trackPageview']);
7-
8-
(function () {
9-
var ga = document.createElement('script');
10-
ga.type = 'text/javascript';
11-
ga.async = true;
12-
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
13-
var s = document.getElementsByTagName('script')[0];
14-
s.parentNode.insertBefore(ga, s);
15-
})();
16-
17-
</script>
18-
<% end %>
8+
ga('create', "<%= ENV['GOOGLE_ANALYTICS'] %>", 'auto');
9+
ga('send', 'pageview');
10+
</script>
11+
<% end %>

0 commit comments

Comments
 (0)