Add search query as an attribute on result links
What does this MR do and why?
Adds a data attribute containing the search query on result links on the search-as-you-type style forms.
This will enable us to better track search queries in Google Analytics: https://gitlab.com/gitlab-com/marketing/marketing-strategy-performance/-/issues/1273#note_1422515172
Relates to #1333 (closed)
How to validate
Use the review app here: https://gps-ga-query.docs.gitlab-review.app/
-
Type a search query in the search form on the homepage or an interior content page -
Inspect HTML source in dev tools and verify the query is shown in each result link like this: data-search-query="myquery"
Merge request acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this merge request.
Edited by Sarah German