Google Analytics 4 is a powerful tool that provides valuable insights into a user’s desires for their usage of your website. An often-looked feature is an ability to track search terms, which can provide valuable information about what users are searching for and how they’re finding your site. However, many users find that setting up search term tracking in Google Analytics 4 can be frustrating and confusing, leading to incomplete or inaccurate data. In this tutorial article, I’ll explore some of the common issues that arise when trying to track search term results in Google Analytics 4, and provide step-by-step instructions for configuring this feature correctly.
Note, this article is distilled from the excellently detailed Analytics Mania article How to Find Search Terms in Google Analytics 4 and the super extensive Track Site Search with Google Analytics 4. I’m just repeating it here for my own reference. Maybe it’ll help you as well.
1) Click on the gear icon to configure your account to track what we need to define manually
2) Click on custom definitions
3) Create a new custom dimension for the search terms to populate. I recommend using search_term as the dimension name, which is the exact same as the Event Parameter. “search_term” is the parameter name that is sent with every view_search_results event.
Frustratingly, without additional configuration, the view_search_results page only shows the search_terms that have been entered on the website in the last 30 minutes, as seen here:
Some additional configuration is needed, which will record search terms going forward but will not reveal those from the past. That report will be showing data only from the moment you created that custom dimension. So you must do this BEFORE you launch your new site.
Come back later and you should have results populating in a widget on this report dashboard:
This is how you’ll get there:
- Click on the reports section of GAv4
- Click on “Events”
- Look for “view_search_result” among the list of events. If you don’t see it in your top 10 events listed, click on “rows per page” above the table and expand to more rows.
The “view_search_results” event was present on several of my client websites, but on one of them, it was not. I went in and added the “search_term” as a custom parameter. Then I went to see the view_search_results report window under another account, switched the account that I was viewing, and then I could see that there were in fact, events being recorded at least for the live last 30 minutes view.
After adding the parameter added, I noticed the view_search_results start to show up in my table as the very last.
The lack of data regarding file download events is similar, in that the number of times some file has been downloaded will be tracked by Google Analytics automatically, but to know specifically which files are saved is something you’ll have to set up manually.