Created
January 9, 2014 01:25
-
-
Save mlb5000/8327824 to your computer and use it in GitHub Desktop.
Mixpanel EmberJS Integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//detect changes to the Hash URL | |
$(window).on('hashchange', function(){ | |
mixpanel.track("pageview", {"url": window.location.href }); | |
}); | |
Ember.Application.initializer({ | |
initialize: function(container, application) { | |
//track the initial page load's location (the user's entry route) | |
mixpanel.track("pageview", {"url": window.location.href }); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment