Beyond the UI – How to filter Google Search Console (GSC) data using regular expressions in Google Analytics (GA)

Filtering GSC data in GA.

Update: April 2021
Google has finally rolled out filtering via regular expressions (regex) directly in Google Search Console! That’s great news and it’s something the SEO community has been requesting for a long time. You can access the filters in the Performance reporting directly in GSC. You can still do this in Google Analytics like this post explains when you connect Search Console to GA, but you can now also use regex right in GSC.

Regex filtering in Google Search Console (GSC).

How To Filter GSC Data In Google Analytics Using Regular Expressions (regex):
Yes, it’s possible to filter GSC data using regex. Like many of you, I’ve been asking for regex support in GSC for a long time. But as we know, the search analytics reporting unfortunately only provides basic filters for queries and landing pages. In addition, you can’t export more than one thousand rows in the GSC UI, which is limiting. And… you can’t export just filtered the data (which is a pain in the neck). It’s maddening.

But I’m here to show you a different way to slice and dice GSC data. And it’s been right under your nose the entire time. In this post, I’ll explain how to use regex to filter GSC data by using Google Analytics. And if you follow my Search Engine Land column, then you know I just wrote a post about filtering crawl data using advanced filters. So, you can consider this the sequel to that post. They say the sequel isn’t as good as the original, so let’s see if I can change that. Let’s rock and roll.

Requirement – Connecting GSC and GA
First, in order to do this, you need to connect Google Search Console to Google Analytics. To be honest, you should have done this already, but if you haven’t yet, better late than never. :)

I won’t cover how to connect the two, since there is solid documentation about how to connect them. Once you do, then you’ll begin seeing historical GSC data soon. Then you can start using regex in GA like I’m about to show you below. Note, you will still only be able to see the past ninety days of data. I’m hoping that changes at some point in the future, but we just have ninety days now.

Connecting GSC and GA.

Using regex in GA, it’s available and ready to go.
Once you connect GSC to GA, you will see the reporting under the Acquisition bucket of reports. There is a section labeled Search Console with a “NEW” tag. Within that set of reports, you will see landing pages, countries, devices, and queries. We’ll focus on queries and landing pages reports for this post.

GSC reporting in Google Analytics.

Let’s start by accessing the queries report. Once you click the link in the left navigation, you’ll see your queries listed in the report. Make sure to adjust the date to show you the past ninety days.

GSC Queries report in Google Analytics.

Now we’re ready to slice and dice data via regex. In order to filter the report using a simple text search, you can easily enter some text in the filter box. But don’t stop with a simple text filter. That’s the same type of lame filtering you get in GSC. Let’s take this a step further and use regex. Click the “advanced” link next to the search box to access advanced search filters.

Advanced filtering in Google Analytics.

After clicking the “advanced” link, make sure to keep “Include” and “Search Query” for the first two options, but you should change the next dropdown that defaults to “Containing” to “Matching RegExp”. That will enable you to enter a regular expression versus a simple text search.

Using regular expressions in Google Analytics.

Simple example: Filter queries using pipes (OR)
One of the easiest, but still powerful, regular expressions can be achieved by using pipe characters. A pipe {|} represents “or” in a regex. So if you were trying to filter the list of queries by three different text searches, you could enter them like this:


And when you do, GA will list only the queries in the report that match either of those conditions.

Using pipe characters in regex.

And as you can guess, you don’t need to limit the queries to simple text. You can use any regular expression for each entry in your statement. For example, let’s filter by any query that starts with query A or ends with query B.

Using regex to filter queries that start with or end with keywords.

You can go crazy here, and your own regular expressions will be based on your own analysis. The key point is that you can slice and dice GSC data in GA to your heart’s delight.

Layer on average position.
The other benefit you get when using GA to filter GSC data is the ability to layer on dimensions and/or metrics. Under your GA filters, you’ll see an option for “Add a dimension or metric”. When you click that dropdown, you can add other GSC metrics like Average Position, Clicks, CTR, and Position. So you can create more advanced filters quickly and easily.

Below, I’ll add a metric to a pipe-based regex to show us any query that matches the text we enter AND has an average position of less than 5.

Layering average position on regex filtering.

Layer on clicks and/or impressions.
And you can do the same with clicks or impressions. This will enable you to filter specific queries that also have a minimum or maximum number of impressions or clicks. For example, how about queries that contain certain keywords plus have at least 500 clicks over the past ninety days:

Adding filters for clicks and impressions in GA.

Add exclude vs. include to create advanced filters.
Previously, we kept “Include” as the first option for including the filters we were applying. But you can switch that to “Exclude” to hone your reporting. The exclude option when filtering by regex is powerful and enables you to drill down by excluding queries or landing pages that match your regex. I also mentioned this technique in my Search Engine Land post when explaining how to filter crawl data using DeepCrawl.

Excluding regex to hone reporting.

You can also filter landing pages using regex!
You can use a similar approach for filtering landing page data. If you want to find out if certain page types are gaining impressions and clicks, then you can use regex to surface them. For example, imagine you wanted to find all urls that have a certain parameter.

Filtering landing pages using regex in GA.

Or how about any landing page url containing certain keywords that have more than 3000 impressions?

Filtering landing pages by query and impressions.

You get the picture! The possibilities are endless.

Hunting featured snippets
Let’s go hunting for featured snippets by filtering the report by certain queries and then entering an average position of less than two. Featured snippets will rank #1 in GSC since they hold the top position. That was covered in the help documentation provided by Google about clicks and impressions. But you can enter “Less than 2” versus equaling one since the query will not always rank number one. It simply helps you capture more queries that might be yielding a featured snippet. Here I’m filtering by “how to” or “what is” queries with an average position of less than two.

Filtering for featured snippets in GA.

Export it!
As I mentioned earlier, the GSC UI limits your exports to just one thousand rows. That’s extremely limiting for many sites. In GA, you can export five thousand rows at a time by using the dropdown at the bottom of the report. In addition, you can export in stages by clicking the next page in the pagination and then exporting another five thousand rows. It’s not optimal, but better than an absolute limit of one thousand rows.

Exporting reports using advanced filters in GA.

Summary – Regex is available for GSC data (with the help of GA)
If you’re like me, then you’ve wanted regex support in GSC for a long time. But by using GA, you can essentially get that regex support, but just not in GSC proper. If you need to drill into your data, slice and dice query and landing page data, etc., then I recommend using the approach I listed above. I think you’ll dig it. Now brush up on your regex skills and dig in. :)