govuk_publishing_components
govuk_publishing_components copied to clipboard
Add new custom analytics tracker for search
What
This adds a new Ga4SearchTracker analytics tracker and replaces the use of the generic Ga4FormTracker in the layout super navigation header with it.
In the near future, we will also use it to replace:
- the usage of the generic
Ga4FormTrackeron the homepage in Frontend - the custom search event code on the all content finder ("site search") in Finder Frontend
For now, this fires exactly the same event with the same data as the existing use of the form tracker/custom search event code.
Why
This new module allows us to share consistent logic in search event data between all the different places we offer a search box across GOV.UK. This will be particularly important once we add the ability to track usage of the upcoming autocomplete functionality as well.