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

Capture GA4 native "view_search_results" event on turbolinks search #546

Open
marlo-longley opened this issue Mar 10, 2023 · 0 comments
Open

Comments

@marlo-longley
Copy link
Collaborator

marlo-longley commented Mar 10, 2023

To be clear, this issue does not impact our ability to capture search terms on the live site. We can still get this data, but using a more roundabout method.

Currently the "view_search_results" data is only captured on a full static refresh of a page. When you search using the Blacklight searchbar, where the result is loaded by turbolinks, the result is not captured. This must be related to turbolinks, but not sure how.

To reproduce:

  1. Go to https://virtualtribunals.stanford.edu/nuremberg
  2. Type "something" in the search bar, and hit search
  3. Your URL is now https://virtualtribunals.stanford.edu/nuremberg?search_field=all_fields&q=something
  4. In the GA4 Realtime panel, you WILL see a page view registered for "something - Virtual Tribunals Search Results". You will NOT see a view_search_results event registered with the search_term parameter value as "something"
  5. Now, while still on https://virtualtribunals.stanford.edu/nuremberg?search_field=all_fields&q=something, manually refresh the page. To make your results in GA4 more clear and distinct from your first search, you could manually edit the q param to something like https://virtualtribunals.stanford.edu/nuremberg?search_field=all_fields&q=somethingx2 before refreshing.
  6. Back in the GA4 Realtime panel, you will see a pageview registered for "something x2- Virtual Tribunals Search Results". You will ALSO see a view_search_results event registered with the search_term parameter value as "somethingx2".
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

1 participant