diff --git a/app/assets/javascripts/google_anlytics.js.coffee.erb b/app/assets/javascripts/google_anlytics.js.coffee.erb index a029068..d4f7069 100644 --- a/app/assets/javascripts/google_anlytics.js.coffee.erb +++ b/app/assets/javascripts/google_anlytics.js.coffee.erb @@ -13,10 +13,8 @@ class @GoogleAnalytics firstScript = document.getElementsByTagName("script")[0] firstScript.parentNode.insertBefore ga, firstScript - # If Turbolinks is supported, set up a callback to track pageviews on page:change. - # If it isn't supported, just track the pageview now. if typeof Turbolinks isnt 'undefined' and Turbolinks.supported - document.addEventListener "page:change", (-> + document.addEventListener "turbolinks:load", (-> GoogleAnalytics.trackPageview() ), true else