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

Add page route changes to Google Analytics reporting #117

Closed
mateoclarke opened this issue Dec 18, 2017 · 0 comments
Closed

Add page route changes to Google Analytics reporting #117

mateoclarke opened this issue Dec 18, 2017 · 0 comments

Comments

@mateoclarke
Copy link
Contributor

Problem

We have enabled Google Analytics to log user search, url parameters that include ?search=some_term. However, it appears these events are not being sent to GA from the client and these searches are not getting logged.

Potential Solutions

I have a hunch that it has to do with the way URL parameters work in Gatsby. In order to save requests, it has its own routing like a single page javascript app. So changing the url might never notify the GA. I think there is some manual coding we need to do to trigger GA submits on certain events.

@toribr found this thread on the Gatsby repo:
gatsbyjs/gatsby#64

onRouteChange seems like a great place to start.

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

No branches or pull requests

1 participant