diff --git a/assets/javascripts/lib/page.coffee b/assets/javascripts/lib/page.coffee index 886a96ff..1c77c643 100644 --- a/assets/javascripts/lib/page.coffee +++ b/assets/javascripts/lib/page.coffee @@ -42,6 +42,7 @@ page.show = (path, state) -> page.dispatch(context) context.pushState() ga?('send', 'pageview', location.pathname + location.search + location.hash) + _gauges?.push(['track']) context page.replace = (path, state, skipDispatch, init) -> @@ -51,6 +52,7 @@ page.replace = (path, state, skipDispatch, init) -> page.dispatch(context) unless skipDispatch context.replaceState() ga?('send', 'pageview', location.pathname + location.search + location.hash) unless init + _gauges?.push(['track']) context page.dispatch = (context) -> diff --git a/views/app.erb b/views/app.erb index fc795e5d..30509959 100644 --- a/views/app.erb +++ b/views/app.erb @@ -36,4 +36,10 @@ })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-5544833-12', 'devdocs.io'); ga('send', 'pageview'); +<% end %>