It’s surprisingly simple to use Google Analytics for Tracking Hash URLs really. I needed to track each “page” as it was viewed, but being a hash url driven website of course google analytics (by default) only recognises the “index”, seeing as its essentially a “one page website”. No good to anyone…
So a simple one liner ( i have added this inside my function that loads the content, but it goes wherever you need to track)
_gaq.push([‘_trackPageview’, "/" + window.location.hash]);
Looking at the Google Analytics screen we can now see each hash url logged as a visited page. Exactly what the client wants to see.