A short introduction
Site search analysis is an important element for understanding the needs and interests of users. In on of the previous publications, you already learned how to set up site search tracking. So, after setting up search tracking, a logical question arises: “How can we evaluate what users are most often searching for on the site?”. A special report in Google Analytics can answer this question.
In Google Analytics 4, you can create a report that will allow you to track queries entered in the search bar for subsequent analysis and evaluation of how they affect the behavior of visitors.
In the article, we will look at the following site search reports options:
Creating a detailed site search report in Google Analytics
This option is suitable for you if you need to have constant access to information about what users are most often searching for on your site. To solve this problem, we will create a report in the main Google Analytics 4 report library, which will allow us to display the report on the main Google Analytics dashboard.
First, we need to go to the Library section (2), which is located on the reports tab (1). Next, we need to click on Create new report (3) – Create detail report (4):
On the next screen, select Blank:
We are now presented with a new report setup screen. There is two sections are important to us now:
- Report data.
- Report filter.
In the report, we will need Search term as Dimensions. Search term is a standard Google Analytics 4 parameter that contains search query values and is transmitted with the view_search_results and search events. We will also need metrics such as Total users, Event count. They will allow us to estimate how many users search for specific queries (Total users), as well as the number of such queries (Event count).
After adding these three fields, the report looks like this:
But there is a problem — the presence of an empty search query. This is not a Google Analytics error, since the Event count parameter displays the number of all events, and most of them do not have the search_term parameter, which is why the empty value appears. In the Event count field, you can select the view_search_results or search event to fix the problem, but in this case, you will have to change the event every time you open the report, which is not very convenient. Therefore, you need to apply filtering.
In Google Analytics 4, there is no way to filter data in reports by event name, so we will apply a filter by the search query itself. To do this, click “Add filter” and create a filter with the following configuration:
- Dimension – Search term,
- Match type – does not match regex,
- Value – ^(\(not set\)|)$
With this condition, we not only cut off empty search queries, but also (not set) values, which can be displayed in case of errors.
Important! If you can’t find the Search term parameter when setting up the filter, you need to create it in Custom definitions – Custom dimensions. Parameter configuration:
After creating the Search term parameter, its data will appear in Google Analytics within 24 hours. Therefore, it is better to create the report after adding the Search term parameter.
After adding dimensions, metrics and filters, the report is looks like this:
Now we can save the report by clicking the “Save” button:
Let’s name the report “Site search” and save it.
Now we can add it to one of the report folders, for example, to Engagement section. To do this, in the report library, click on the three dots next to the Life cycle folder and select Edit:
In the report folder settings, you only need to drag the created Site search report from the right side to the left and click “Save”.
As a result, the report looks like this:
Creating a summary card for overview reports in Google Analytics
We have already created a detailed report. Now let’s add a summary card for Overview reports. This will allow to display information on site searches in overview reports.
We need to go back to the created report and edit it. This can be done in the report itself, if you added it to a folder with reports, for example, Life cycle, or from the report library. Let’s go to the library and open the edit report:
We need to click on “Create new card” in the “Summary cards” section to add a summary card:
In the card settings, we need to add dimension, metrics and filters. We will set Dimension – Search term, Metrics – Total users and Event count, Filter – Apply current report filter option and visualization type – Bar chart. Your settings should be as follows:
To complete the setup, it remains to click “Apply” and then save the changes to the Site search report.
Let’s add a new card to the Engagement overview report. To do this, go to the report library and find the Engagement overview report, we need to edit it:
Click on “Add cards” in the report overview settings:
In the window with cards, look for a card called “Site search”, or we can use the search bar (1). To add a card, we need to click on the check mark (2) and click “Add card” (3):
Once added, the card will appear at the end of the report. If desired, it can be moved up by dragging it in the right part of the report settings:
Let’s drag the card a little higher and save the report by clicking on “Save” to save the changes.
Go to the Engagement overview report to view the card:
Considering that we have added two metrics to the summary card (Total users, Event count), we can change the metric by selecting it in the drop-down list:
Creating a site search exploration in Google Analytics
Creating an exploration with search queries will allow us to work with search queries in more detail, filter data, display data of individual users, and include the report in large sets of explorations.
To create an exploration, go to the appropriate section and select “Blank”:
The exploration configuration will be similar to what we specified when creating a detailed report using the report library:
- Dimensions: Search term,
- Metrics: Total users, Event count,
- Filter: Search term – does not match regex – ^(\(not set\)|)$
In addition to the presented dimensions and metrics, you can add additional ones at your exploration, for example, Sessions, Session campaign, Country, etc.
A short afterword
Reporting in Google Analytics 4 is a powerful tool for analysing user behavior, especially when it comes to site search. We’ve covered three ways to set up site search reports: a detailed report, a summary card, and an exploration, each useful for different purposes. Depending on your needs, you can choose the right option to analyse search queries and use that data to improve your content and user experience.