Support turoblinks5
This commit is contained in:
parent
179a79675c
commit
1dfafd5c6b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue