How to Get Google Analytics to Work for Your Single Page Application
May 7, 2015
One of the things that becomes increasingly fascinating as I get older is the new knowledge acquired while “doing things for real”. Currently, we have been building a site for my current organization.
We built a little CMS to drive content, and the whole page is a Single Page Application (SPA). As we approached completion, we naturally wanted to add Google Analytics to the site. Sounds simple enough.
Or maybe not… in this post, I’ll describe how we got it to work for our Single Page Application. Google Analytics default setup is not built for that. And many descriptions you find out there are written with a client-side framework in mind, like Backbone.js.
What I write about below only requires jQuery, and that’s mostly for convenience.
As with most things I learn, it’s based on others’ knowledge that I tweak. In this case, I found a...