Find Content Gaps by Blending Your Site Search and Search Ranking Data

Your internal site search data is a valuable source of content ideas. But what if we took it a step further? In this article, I’ll show you how to combine your site search data with your organic search ranking data from Google to identify potential content gaps: terms that your users are searching for on your site but you aren’t appearing for in Google search results pages.

We’ll do this in Looker Studio by blending data from two sources: Google Analytics 4 and Google Search Console. All these tools are free to use.

What is site search and why is this data valuable?

Site search is when users who are already on your site use your search functionality to find content on a particular topic. That’s different to organic or paid search, which takes place on a search engine such as Google and sends users to your site.

Not all sites offer site search: for example, if you have a single-page marketing site, site search wouldn’t be helpful to your users. But if your site contains a blog or an article section, then site search is a great way to let users find very specific content. Flying Cat puts its site search prominently at the top of its blog:

Not all sites offer site search: for example, if you have a single-page marketing site, site search wouldn’t be helpful to your users. But if your site contains a blog or an article section, then site search is a great way to let users find very specific content. Flying Cat puts its site search prominently at the top of its blog:

Flying Cat’s “Blog List”, with the site search function visible between the title and the first posts
Site Search helps users to find article and blog content, such as here in Flying Cat’s own “Blog List” (highlighted in yellow)

As well as benefiting your users, site search benefits you, the site owner: it gives you insight on the kind of content your users expect to find on your site. And if that content doesn’t already exist, you could create it. In short, site search data is a powerful way of generating relevant ideas for future content.

Site search data is generally more valuable on higher-traffic sites. If your site has low traffic, you’re unlikely to have many site searches—so it can be difficult to spot trends in the data. 

A traffic graph from GA4 showing a site that is receiving between one and five active users per day
Low-traffic sites such as this one are unlikely to collect much site search data

So, to take advantage of site search data and follow along with this guide, you’ll need three things:

  • Site search functionality on your site
  • Enough searches for the data to be useful
  • Tracking in place to see what your users are searching for

I can’t help with the first two points, but I can help with the third. Let’s look at how to configure site search tracking in Google Analytics 4 (GA4). I’m going to assume you already have a GA4 property set up and tracking your site, but if not, Google has a solid guide.

How to configure site search in GA4

The first step is finding out what your site’s “search term query parameter” is. This is a small value that appears in the URL (the web address shown in the browser title bar) after a user has carried out a site search. For example, if I go to the BBC website and search for my home city of “London”, the URL of the search results page is:

https://www.bbc.co.uk/search?q=london&d=SEARCH_PS

The BBC website showing search results for “london”
The search term query parameter for the BBC website is “q” (highlighted in yellow)

The relevant part here is “q=london”. This means the search term query parameter for this site is “q”. Generally, sites will use something like q, s, query or search.

Now we have that, we can move on to configuring site search. Fortunately for us, Google Analytics 4 has a feature called “enhanced measurement” which makes it easy to track interactions such as form submissions, link clicks, and… site search.

It isn’t the one way to track site search, but it is the simplest—you can complete the entire setup in GA4 without needing other tools such as Google Tag Manager (GTM).

When you originally set up your GA4 property, you may or may not have enabled enhanced measurement. (The default is “on” but I’ve worked with plenty of clients who had it set to “off” for one reason or another.) And, even if it is enabled, it may be that the site search tracking isn’t enabled or configured properly.

Here’s how to check both:

  1. In your GA4 property, go to Admin > Data Streams 
  2. Click on your web data stream
  3. Under “Events”, toggle “Enhanced measurement” on
The Event section of GA4’s Web Stream Details page, with a blue tick showing that enhanced measurement has been toggled on
 Here enhanced measurement has been toggled on
  1. Click on the cog icon to “configure enhanced measurement”
  2. Toggle “site search” on
  3. Click Show advanced settings
  4. Make sure the “search term query parameter box” includes the value you found out earlier
  5. Hit Save

But what if your site doesn’t show a search term query parameter at all? In that case, you won’t be able to use enhanced measurement to track site search and you’ll need a more advanced technique.

How to view your site search data in GA4

Now that you’ve completed the setup, every search on your site will generate an analytics event called “view_search_results”. You’ll see this coming through in GA4’s Realtime Overview, in the “Event count by Event name” card:

The “Event count by Event name” card in GA4’s Realtime Overview, showing one “view_search_results” event
 The “view_search_results” event coming through in GA4’s real-time reporting

Click on the event to see its parameters (additional pieces of information about the event). There will always be a “search_term” parameter: this is the phrase that the user searched for and that GA4 picked up from the search page URL. You can click on this parameter to see all the searches that your users have carried out in the past 30 minutes.

After a day or two, your new event will be available to use in GA4’s regular reporting too. The two options are customizing a pre-built report or building an exploration from scratch: I prefer explorations as I feel they give me more control and are less cluttered. 

Here’s a simple exploration looking at site searches on the Google Merch Shop (one of Google’s demo accounts):

A GA4 exploration for site search, showing the configuration on the left and the top search results on the right. Data is from the Google Merch Shop demo account
Building a simple exploration for site search in GA4 only takes a few clicks

As you can see, I’ve added the dimension “Search term” and the metric “Event count”. This shows me how many times each search term has been searched for.

I’ve also added a filter based on the dimension “Event name”, so that “Event name exactly matches view search results”. This prevents a blank row appearing in the results counting all the events that didn’t have a site search at all:

Limitations of analyzing site search data directly in GA4

Whether you use reports or explorations, there are two big limitations with GA4 site search data that can’t be fixed in GA4 itself.

First, the data is case-sensitive. By that I mean that “Mexico”, “mexico” and “MEXICO” will show up as three separate search terms. Perhaps “Mexico” has 100 searches, “mexico” has 70 and “MEXICO” has 60. With the search volumes spread like this, you can’t see at a glance that Mexico is a popular search term with 230 searches. The risk here is that you will underestimate your users’ interest in this topic.

You can see this problem in my earlier example exploration, where the fifth and sixth most popular searches on the Google Merch Shop are “YouTube” and “Youtube”. If you were to combine the volumes, the term would be fourth instead.

Second, the data contains stray characters. In my experience, searchers often accidentally add a space either at the start or end of their search term. This again can mislead you, because “Mexico” will be listed separately to “Mexico “.

One option is to fix these issues at source—your website. If your site always rendered your search term query parameter in lower-case, then GA4 would only ever pick up lower-case search terms and all your data would be consistent. But, even if you have development resource to do this, it’s unlikely to be a commercial priority.

Another, lower-tech option would be to manually tidy up your data outside of GA4. In your exploration, click Export data to export your data to a CSV or Google Sheets:

The “Export data” button in a GA4 button has been clicked on, showing the export options: Google Sheets, TSV, CSV, PDF and PDF (all tabs)

There, you can knock all the search terms to lower case, search and remove and stray spaces, then consolidate the data. 

That’s OK for a one-off job, but not the best solution if you want to analyze your site search data regularly (as you should). Let’s look at a different approach.

Cleaning your site search data in Looker Studio

Looker Studio (formerly Google Data Studio) is a free data visualization tool from Google. It lets you work with data from Google tools such as Google Analytics, as well as other sources. And you can use Looker Studio to address those limitations in GA4’s site search data.

First, you’ll need to create a Looker Studio report and connect your GA4 property as the data source:

  1. Sign in to Looker Studio
  2. Use the button in the top left to Create a Report
  3. In the “Add data to Report” panel that appears, click on Google Analytics
 Looker Studio has a wide range of “connectors” enabling you to work with different data sources
 The “Add data to report” panel in Looker Studio, listing some of the many connectors available. The Google Analytics connector is highlighted
  1. Select your GA4 account and property from the dropdown list
  2. Click the blue Add button
  3. Click ADD TO REPORT

The next step is adding a table of your site search data to the report:

  1. In the main menu, select Insert > Table
  2. Click on the report canvas to add the table to it
  3. In the chart setup panel on the right, choose the dimension “Search term”
  4. In the same panel, choose the metric “Event count”
  5. Still in the chart setup panel, click on ADD FILTER and add a filter to exclude the row with the blank search term. Configure your filter like this:
The “Edit Filter” panel in Looker Studio, with one condition added: “Exclude Search term Equal to (=)”. The final value field is empty.
Leave the final field empty in order to exclude the blank row from your table

The table is now very similar to the GA4 Exploration we built earlier. But Looker Studio lets you go a step further. Let’s take the Search term dimension and combine a couple of functions to create a new, clean-up field:

  • LOWER() will convert all the text to lower case
  • TRIM() will remove any leading or trailing spaces

Here’s how:

  1. Back in the chart setup panel, click X to remove the Search term dimension we added
  2. Click Add dimension then ADD CALCULATED FIELD
  3. Give your new field a name, for example “Search term (Cleaned)”
  4. In the formula box, paste in: TRIM(LOWER(Search term))
  5. A green tick should appear at the bottom of the New field box to show that your formula is valid. Click Apply
The formula panel for a calculated field in Looker Studio. The formula “TRIM(LOWER(Search term))” has been added and is ready to be applied
 To combine multiple functions in one formula, nest one inside another

Your site search data is now cleaned! Terms such as “Mexico”, “mexico” and “mexico “ will all be combined into one.

If you want to export your cleaned data:

  1. Click View in the top right to switch from Looker Studio’s edit mode to view mode
  2. Hover over the table with your site search data in
  3. Click on the More icon (three dots)
  4. Click Export
A Looker Studio table showing cleaned site search data. The “More” menu is open in the top right, with the “Export” option highlighted
The Export option is slightly hidden in the “More” menu in the top right

Introducing Google Search Console as the second data source

Your site search terms are a rich source of content ideas. But for some of the terms, you’ll already have content that is ranking well on Google. They don’t represent content gaps, and writing more content for those terms could even lead to keyword cannibalization.

So we need a way to work out which of our site search terms we aren’t yet ranking for. To do this, we’ll use a second source of data, Google Search Console.

Google Search Console is another free tool from Google, one that helps you understand how Google sees your site and how your content is performing in organic search. To use Search Console, you’ll first need to verify your site (to prove that you own it).

Then you can bring your organic search data into your Looker Studio report: 

  1. Have your Looker Studio report open in Edit mode
  2. In the menu, go to Resource > Manage added data sources
  3. Click ADD A DATA SOURCE
  4. Click Search Console—use the search box if you can’t see it:
Looker Studio’s “Add data to report” panel. The text “search console” has been entered into the search box, and the Search Console connector is the only matching result
The Search Console connector is quite far down the list so it’s easier just to search
  1. Select your site and choose the Site Impression table
  2. Choose the search type web
  3. Click Add
  4. Click Add to Report

Now insert another table into your report (Insert > Table). This time, in the setup panel, make sure Search Console is your chosen data source. Add the dimension “Query” and the metric “Average position”:

 Feel free to experiment with other metrics too, such as “Clicks” or “Impressions”
The chart setup panel in Looker Studio, with Search Console as the data source. The dimension “Query” and the metric “Average Position” have been added to the chart

This table will show you which search queries you are ranking for in Google’s web search, and your average position (with 1 being the top position).

If you’ve followed along so far, your report will have two tables: one with your GA4 site search data, and one with your Search Console average position data. All that remains is to blend the two!

How to blend site search and GSC data in Looker Studio

Blending data in Looker Studio can be quite fiddly. I prefer to start with two tables that have the relevant dimensions and metrics already added. That way I can be confident my blended data source will contain just what I need. That’s why we built our GA4 and Search Console tables first.

  1. Hold down the “shift” key on your keyboard
  2. Click on your GA4 table followed by your Search Console table—the order is important here
  3. Release the “shift” key and right click on either of the selected tables
  4. Select Blend data from the contextual menu
A Looker Studio report with two tables selected and the right-click contextual menu displayed. The menu option “Blend data” is highlighted
The “Blend data” option is right at the bottom of this massive contextual menu

A new table will appear on your report, containing data from your existing two tables. We’re not done yet though, as some of the options for this newly merged data source need to be tweaked.

  1. In the main menu, go to Resource > Manage blends
  2. Find your “Blended data” and click Edit
  3. In the Edit window, click on Cross Join and change it to Left outer
  4. Under Join conditions, Add field “Search term (Cleaned)” on the left and “Query” on the right, so they are on the same row. Like this:
The “Join configuration” panel in Looker Studio’s “Blend data” edit screen. The option “Left outer” is selected and one join condition has been added.
Left outer” returns all rows from our GA4 data but only matching rows from our Search Console data
  1. Click Save in the “Join Configuration” panel—this will close
  2. Click SAVE in the edit window (bottom right)
  3. Click Close in the edit window (top right)

What have we done here? If we’re ranking for a term in Google, but users haven’t searched for it on our site, we don’t need to see it in the table. The left join ensures you see all your site search data but only Search Console data for terms that match.

That’s why the order we selected the tables in for the blend was important. Clicking on the GA4 table first means it is listed on the left so we use a “left outer” join.

Now all you need to do is give your new table the dimension “Search Term (Cleaned)” and the metrics “Average position” and “Event count”. While you’re in the Chart Setup panel, you could also set a default date range—depending on the amount of search data you have, you might want to look at a month or even an entire quarter.

Interpreting the results to identify potential content gaps

The most important step is interpreting the newly blended data in order to act on it.

View your report and click on the “Event count” column header to see the site search terms that are most popular. (You could alternatively export the data at this stage and work on it in Excel or Google Sheets if you prefer.)

What you are looking for are terms that have a high level of site search but little or no organic ranking (a “null” average position means you aren’t ranking at all). These represent potential content gaps: terms you aren’t currently covering on your site that could gain you additional organic traffic.

Competition is still a consideration. It may be that you aren’t ranking for terms not because there is a content gap but because the terms are very broad and very competitive. In other words, just because your users are looking for a particular term on your site doesn’t mean it will be easy to rank for.

For example, this niche travel website receives a lot of site searches for countries such as “vietnam” and “mexico”. It’s unlikely they would ever rank highly for these very general terms, even with unique, quality content:

A table showing blended site search and organic search ranking data. Terms include “mexico” with a high number of site searches but “null” average position
Many of the popular site search terms here are both broad and competitive

In this situation, you may be better identifying long-tail keywords with a smaller level of site search. For this travel website, that could be something like “estrada nacional 2”—a scenic road in Portugal. The site searches are lower, but the keyword will be much less competitive.

However, organic search traffic isn’t the only benefit of providing your users with the content they are looking for. You may be able to improve engagement or drive conversions with this content even if it doesn’t rank. Our travel website could create content for the countries its users are interested in (if it hasn’t done so already). So don’t completely discount competitive terms.

This analysis of your site search data isn’t a one-off exercise but something you should carry out regularly, on a quarterly or even monthly basis. Wider trends in the marketplace might cause new site search terms to bubble up to the top—and, of course, you’ll want to monitor the impact of any new content you’re creating.