Skip to content
This repository has been archived by the owner on Nov 17, 2017. It is now read-only.

Move google analytics code to RouteActions #37

Open
gpbl opened this issue May 1, 2015 · 3 comments
Open

Move google analytics code to RouteActions #37

gpbl opened this issue May 1, 2015 · 3 comments

Comments

@gpbl
Copy link
Owner

gpbl commented May 1, 2015

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.

@samkelleher
Copy link

@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?

@gpbl
Copy link
Owner Author

gpbl commented Jan 12, 2016

@samkelleher what about using the custom store handling NAVIGATE_SUCCESS?

@samkelleher
Copy link

@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. 😍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants