Note: This only works for websites that use URL parameters for their site search.
Site search analysis is very interesting for many websites. You can get direct insights into what your website visitors are looking for. This can even help you to identify new product opportunities.
In Google Analytics 4 (GA4), it is very easy to set up site search if your website reloads and displays the search query as a parameter in the URL after your users do a search.
After you have ensured that this method will work for your website, you can log in and go to Settings -> select your GA4 Property -> data streams -> and select your web stream. Make sure that Enhanced Measurement is enabled.
Next, click on the gear icon below the toggle and make sure Site search is enabled as well.
Unter advanced settings, you can specify your query parameter, like “q” in the example above.
If you have additional query parameters, like language or searched, you can add those as well.
Finally, we’ll test that everything works correctly. For that, we enable the DebugView in Google Analytics by using the Google Chrome GA Debugger extension or the Google Tag Manager Preview.
Go to “DebugView” and perform a search on your website in another tab or window. Then you should see that “view_search_results” got triggered.
If you click on the event, you’ll see all tracked details, e.g. the search term.
Now it’s time to know where you can analyze how your users use your search bar.
The easiest way is to go to Engagement -> Events -> and click on the event “view_search_results”, but there you get only basic information, like how often users do search queries and where they are coming from.
To get more insights, you need to create a report in the analysis hub.