Skip to content

Instantly share code, notes, and snippets.

@daveyoon
Last active December 20, 2015 00:19
Show Gist options
  • Save daveyoon/6041038 to your computer and use it in GitHub Desktop.
Save daveyoon/6041038 to your computer and use it in GitHub Desktop.
Installing google universal analytics into a backbone application
initialize: ->
@bind 'all', @track_pageview
track_pageview: ->
url = Backbone.history.getFragment()
ga('send', 'pageview', "/#{url}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment