Analytics: How to?

@stravid, although the post you linked is really useful I just found out that this solution is “not working” when you’re transitioning between dynamic segments in the same route

i.e from /posts/1 to /posts/2

I’ve put together a demo in this fiddle

basically if you look at the console the “currentPage” is not going to be logged when you transition from the first to the second post

My current solution to log all the transitions properly is to reopen Ember.Router and override the didTransition method

Em.Router.reopen({
	didTransition: function(infos){
		this._super(infos);
		Em.run.next(function(){
			path = window.location.pathname;
			// Google analytics code...
		});
	}
})

I don’t love the idea of using a private API to achieve this so if you have better suggestions please let me know !