govuk-design-system
govuk-design-system copied to clipboard
Use GA4 event parameters to collect extra data about site_search
What
Update the events sent for tracking the search queries so they expose data as GA4 event parameters.
We can use the following from the current event structure and add what we thought we wouldn't need from GOV.UK's implementation as well:
-
action
to distinguish between the 'click' and 'results' -
text
to store the text being searched for -
length
for the number of results (rather than just a boolean of whether there were results or not)
Not quite sure where the title of the clicked result would fit, possibly in section
(and we could also add the URL as url
)?
Why
We need to distinguish between the 'click' and 'results' events, as well as be able to run reports on relevant data associated to these events.
Who needs to work on this
Developers
Who needs to review this
Developers
Done when
- [ ]
site_search
events store extra parameters