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

Integrate reactive search with google analytics #280

Closed
thatbudakguy opened this issue Mar 27, 2019 · 4 comments
Closed

Integrate reactive search with google analytics #280

thatbudakguy opened this issue Mar 27, 2019 · 4 comments
Labels

Comments

@thatbudakguy
Copy link
Contributor

thatbudakguy commented Mar 27, 2019

we need to find the best way to inform google analytics that the user is manipulating the form and requesting new results, since the reactive search uses history.pushState() which doesn't currently count as a "pageview".

it looks like the simplest way might be:

ga('set', 'page', '/new-page-url');
ga('send', 'pageview');

but maybe there are other best practices in use for SPAs, etc.

@thatbudakguy
Copy link
Contributor Author

it would be nice to also configure a global exception handler!

@mnaydan
Copy link
Contributor

mnaydan commented Jan 16, 2024

We want to check if this issue can be solved by the newest version of Google Analytics -- we prefer it to be a configuration in Google rather than a change in our code if possible.

@thatbudakguy
Copy link
Contributor Author

It should be if you turn on "enhanced measurement":

page_view
each time the page loads or the browser history state is changed by the active site
This event is collected automatically. You cannot turn off collection.
An advanced setting on this option controls whether the event is sent based on browser-history events. This measurement option listens for pushState, popState, and replaceState.

@mnaydan
Copy link
Contributor

mnaydan commented Mar 27, 2024

We turned it on!

@mnaydan mnaydan closed this as completed Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants