Add a reset option into the GA4 scrolltracker #3544
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Why
Scroll tracking works correctly on search pages until users change their filters. At that point the user is effectively on a new page (content and URL change) and we want the scroll tracking to 'reset' (i.e. if the user has scrolled to the bottom of the page previously, we want to also record that happened after the search filters are changed). Unfortunately because the page was updated dynamically using JS, the scroll tracker still thinks its on the same page, and therefore doesn't register GA4 events when users scroll. This PR fixes that - a related PR will be raised in
finder-frontend
to add to required event trigger.Visual Changes
None.
Trello card: https://trello.com/c/fhnLqnKw/669-scroll-tracker-to-refresh-on-dynamic-pages