Note: I began writing this question, and in writing it up ended up solving the problem. I'll leave it here and hopefully it will help someone else.
I've been pounding my head against the wall with this for a while now and keep getting inconsistent results.
Attempt 1 (from here)
App.ApplicationController = Ember.Controller.extend({
routeChanged: function (){
mixpanel.track("pageview", {"url": window.location.href });
}.observes('currentPath')
});
I had to deviate from the example since mixpanel.track_pageview()
is deprecated. This resulted in incorrect location logging since I can't find a way to get what the new hash path will be once the transition rewrites the URL, and the URL hasn't been updated at this point.
Attempt 2
$(window).on('hashchange', function(){
mixpanel.track("pageview", {"url": window.location.href });
});
This works when the URL hash changes, but now I don't get any tracking when the site is first loaded.