Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GA track every page #6

Open
achtan opened this issue Sep 10, 2015 · 4 comments
Open

GA track every page #6

achtan opened this issue Sep 10, 2015 · 4 comments

Comments

@achtan
Copy link

achtan commented Sep 10, 2015

Hi, how to set up GA to track every pageview ?

i come up with this solution:

var gaScript = 'https://www.google-analytics.com/analytics.js';
DocHead.loadScript(gaScript, function() {
  ga('create', 'UA-XXXXXX-Y', 'auto');

  FlowRouter.triggers.enter([(context) => {
    ga('send', 'pageview', {path: context.path});
  }]);
});

but sometimes enter trigger is not fired on page load...

@fIa5h
Copy link

fIa5h commented Aug 23, 2016

@achtan did you every find a solution for this? Wondering the same thing. Thank you for any help you can offer, cheers~

@achtan
Copy link
Author

achtan commented Aug 24, 2016

hi, i'm still using FlowRouter.triggers.enter

@ryanbuiltthat
Copy link

Just add a global routeTrigger for this. i use this for my GA scripts with no issues. Occasionally I might need to add a small delay

@achtan
Copy link
Author

achtan commented Nov 14, 2016

@ryanbuiltthat can you show us your code? because in mine (from first comment) ga() is fired on first page load, every other page loads are fine

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

No branches or pull requests

3 participants