The query may contain other parameters too. It would be a shame to not collect all the data that is available.
These can collect additional information for every search query. An Amazon search query, for example, contains “ref, refresh, prefix”.
Before you continue, try to figure out what these parameters advertising data actually mean.
Talk to your developer, or consult the documentation of the software your site uses to display search results on your site.
To illustrate how important that is, I want to quote Fred Pike, who is also a highly experienced member of our community:
If you use a dedicated search engine like Coveo, which tracks and further refines all the search terms, it's a good idea to also recreate the GA4 view_search_results tag, which won't fire by default with Coveo
Fred Pike, Managing Director and GA & GTM Practice Lead at NwsDigital.com
Now you know the search query parameters of your site, you can do the simple part: activating the site search enhanced measurement.
How to activate site search terms in Google Analytics 4?
GA4 can collect the search terms your visitors type in a site search box. To activate this functionality, follow these steps.
Step 1: Go to the admin panel
Google Analytics 4 admin button
Click Admin in the left bottom corner.