I’ve been playing around with Durandal lately, and was wondering how you get a Durandal SPA to work with Google Analytics. The problem is the visitor is staying on the same html page. Yet you want analytics for your different views (so everytime the hash in the browsers navigation bar changes). It turns out this is fairly easy. I’m putting this here for my own and anyone else’s reference. It probably works with other SPA frameworks too (Angular for example).