Skip to content

Instantly share code, notes, and snippets.

@mlb5000
Created January 9, 2014 01:25
Show Gist options
  • Save mlb5000/8327824 to your computer and use it in GitHub Desktop.
Save mlb5000/8327824 to your computer and use it in GitHub Desktop.
Mixpanel EmberJS Integration
//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