Last Updated: February 25, 2016
· samccone

Tracking page views with Google Analytics and Backbone

Single page apps are make it tricky to track page views with google analytics.

Here is a simple way to do just that with Marionette, Backbone, and Backbone.RouteFilter

class window.Router extends Backbone.Marionette.AppRouter
  after: ->
    _gaq?.push(['_trackPageview', Backbone.history.fragment])

1 Response
Add your response

Tell us something we didn't already know why don't you...

over 1 year ago ·