Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Javascript / Coffeescript snipped to use Google Analytics with Turbolinks in Rails 4
# add the tracking code normally to your layout; then include this in every page
$(document).on 'page:change', ->
ga('send', 'pageview');
else if window._gaq?
else if window.pageTracker?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment