Skip to content

Commit

Permalink
ga fixes (#2390)
Browse files Browse the repository at this point in the history
  • Loading branch information
jywarren authored Feb 23, 2018
1 parent 58bb601 commit 6b18843
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
3 changes: 1 addition & 2 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
//= require short-code-forms/dist/short-code-prompts.js
//= require wikis.js
//= require chart.js/dist/Chart.js
// require turbolinks // Temporarily removed while fixing
//= require google_analytics.js
//= require header_footer.js
// require turbolinks // Temporarily removed while fixing

6 changes: 0 additions & 6 deletions app/assets/javascripts/google_analytics.js

This file was deleted.

15 changes: 8 additions & 7 deletions app/views/layouts/_google_analytics.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<% if Rails.env.production? %>
<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", "UA-180781-33", "auto");
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-180781-33"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-180781-33');
</script>
<% end %>

0 comments on commit 6b18843

Please sign in to comment.