isomorphic500
isomorphic500 copied to clipboard
Move google analytics code to RouteActions
It doesn't fit well in the Application.js, also the title would not match since the page it's updated using an action which is async.
@gpbl Where would you put them? I wanted to avoid putting them into each and every action, but I do have each of my actions setting a title property on the route. The NAVIGATE_SUCCESS action is then handled in a custom store that now has the correct title and urls, from which I trigger analytics. Did you come up with another solution?
@samkelleher what about using the custom store handling NAVIGATE_SUCCESS?
@gpbl This is what I have ended up doing, I have a TitleStore which manages the document.title and now calling Google Analytics. It works. However it doesn't record the initial page load, since there is no in-page page navigation. I'm working on this now to find an elegant solution. I can feed back what I end up doing. I've been using your amazing starter project as a guide. 😍