Zero Results Search Terms in Google Analytics (async edition)
Posted 14. Červen 2011on:
Why should we bother? Because it is actionable!
Internal search is the best place to gather feedback from your potential customers. They come to your website and tell you:
- what they want to find there;
- where did they gave up trying to navigate there and used search functionality instead.
But what do they do if they see an empty results page? Some might try to refine their search phrase, but I would say that it really doesn’t improve their overall experience.
It also might be the good signal for you to:
- deliver content that is not currently present on your website;
- change copywriting a bit in case you have picked a different words for the content;
- or try to implement a manually added results for those searches.
This article is meant to describe possible solutions when you are using a newer asynchronous Google Analytics tracking code placed in the head section of your website.
Google Analytics doesn’t provide this report by default. So we will have to do some extra work to achieve this. The first thing that is necessary to do is to be sure that you are able to identify a zero search results page programmatically.
Options to consider
You certainly don’t want to use an extra
_trackPageview call, because this would inflate your data (especially Pages per Visit metric).
In certain cases you actually might be able to modify the tracked URL, but it can be achieved only in particular Web Content Management Systems that are able to pass in all the variables from the page into any template fragment of the generated page. With this capability, you could manipulate the tracked URL as described in this article by Justin Cutroni. The resulting code might look a bit like this:
Afterwards you can proceed with the Site Search functionality configuration by the instructions from Justin’s article.
If you don’t have such a comfortable CMS, you can still measure some extra data with the two following features of Google analytics.
This method was already described in the article Using Google Analytics to Track ‘Zero Results Found’ for Site Searches by Bob Scavilla. I would just point out that it might be a lot easier if the actual search term would be generated by the CMS so you won’t have to suck it from the URL with a regular expression. The resulting code looks much simpler thought:
The first thing you can do is to use a page-level custom variable. You can store the actual zero results search terms like this:
or you can store the particular results count:
Then if you are a little advanced, you can use the API to show all search terms and their count of results in one report (using ga:searchKeyword and ga:customVarValue1 dimensions and ga:pageviews metric).
The only downturn of some of these methods is that the Site Search Terms report still includes all the searches that ended up with no results and you cannot really distinguish them.