-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now that we have collected a decent amount of tracking data on search across GOV.UK, we've come across a couple of trip hazards with the existing tracking. In particular: - suppressing the event if the keyword hasn't changed is a bit brittle (and subtly buggy as we've forgotten to normalise the initial keyword in the JS component state) - Relying on separate tracking in Finder Frontend for filter application has led to duplication and unreliable behaviour (for example, as we only track clicks of the filter button, we do not get events when a user submits the form through other means such as the Enter key or the main search field's submit button) This change updates the behaviour of the `Ga4SearchTracker` module as follows: - update the tracking to _always_ fire a `search` event when the form is submitted - make the action of the `search` event dynamic - update the logic to establish whether the user is searching vs filtering by checking which fields the user has interacted with (instead of checking if the keyword has changed), and set the event's action property accordingly
- Loading branch information
Showing
4 changed files
with
87 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters