Thanks for the explanation, it’s not a simple workflow you’ve got there. You must deal with a ton of analytics data! We’re not at this level of data-flow yet
Google Analytics is nice to track pageviews, do you also use it to track events within your app, or do you use another solution? (Maybe linked to Google Tag Manager?)
We currently use Google Analytics for tracking pageviews (with manual pageviews when browsing in the SPA, we basically simulate natural browsing), and we use GTM to track events, which allows our analytic team to add new events anytime just by target existing DOM elements (ids, classes, etc.)
But, we’ve run into quite a few issues due to SPA. Basically, GTM binds events to DOM elements, but those elements are added/deleted dynamically without page refresh (i.e: when browsing), which messes up with GTM because it lost the bound DOM events and doesn’t work properly.
We’ve found a workaround which consists of re-binding all DOM events at every pageview, and it works (but has unwanted side effects)
Another workaround would be to send those events programatically, like for instance adding an event on a button and send the event when a user clicks on the button (
<a onclick="ga.send()" />). Doing so will avoid the DOM bound events breaking issue, but then our analytic team doesn’t have the hand on the events and everything must be hard-coded in the source code, and therefore relies on a developer. (and add unwanted complexity in the source code, that may be the source of bugs, etc.)
Did you run into such issues? Tracking pageviews is quite simple, but tracking events is much harder on SPA (because the page never refreshes and bound DOM events are lost when the DOM content dynamically changes)