• Home
  • Google Analytics
    • Customizations
    • For Ecommerce
  • Speaking
  • About
    • About Me
    • Contact Me
    • Disclaimer and Privacy Policy

Analytics Talk

Digital Analytics for Business

You are here: Home / Analysis / Tracking Zero Result Searches in Google Analytics

Tracking Zero Result Searches in Google Analytics

Posted: September 8, 2009 32 Comments

I <3 Google Analytics Site Search reports. There’s amazingly actionable data in those reports. But they’re missing one vital piece of information: searches that don’t produce any results.

Why is this important? Don’t you want to know when visitors search and don’t get any results? Zero result searches can help your identify missing content on your site or a problem with your site search engine.

fenway-scoreboard

Many search solutions will provide this information for you. For example, I use Search Meter for WordPress and it shows me which search queries generate zero results. But I thought it would be interesting to add this data to Google Analytics. That way all my site search information would be in one place.

Unfortunately there is no easy way to add this data to GA. You need to do some programming to collect the data. So this post is really meant for those folks with programming resources AND for those developers that maintain GA plugins. Like my buddy Joost, who has a great GA plugin for WordPress.

If you’re interested in the data and analysis, skip to the bottom of this post.

Conceptual Overview

Our goal with this hack is to modify site search data in two ways. First, we’re going to put all search queries with zero results in a category. This will allow us to use the Search Categories report to easily find all the search terms that yielded zero results.

Second, we’ll modify the actual search terms to indicate that a term yielded zero results. This will make it easy to scan a list of all the search terms and identify which generated no results.

Before we get into the implementation, a big THANK YOU to Charles Miller, one of the lead consultants here. He wrote the JavaScript below. Thanks Charles.

Step 1: Identify No Result Search

The first step is to identify a zero results search page. Most websites have the same search results page regardless of the number of results. You need to identify some something that differentiates a zero results search page from a non-zero results search page.

This must be done programatically and is the hardest part of the implementation.

For example, a zero results search page on this blog has the text “No posts found. Try a different search?”

No Posts Found

I can create code (or more specifically, Charles can create code) to look for the text “No posts found. Try a different search?” If the code finds this text in the page then I can identify that the visitor’s search yielded zero results and than I can send the data sent to GA. Here’s the code that I’m using on this blog:


var content = document.getElementById('content');
if (content.innerHTML.search('No posts found.')) {

The code looks for a section of the page called ‘content’ and then searches that section for the phrase ‘No posts found.’. If ‘no posts found.’ is found (oh, the irony!) then we will modify the data sent to GA.

Important! The way you detect a zero result search page may be different. It’s VERY difficult to create an example that will work for everyone. Take this as a conceptual overview.

Step 2: Tweak GA Tracking Code

Once we know what differentiates a zero results search page we can add some code that tweaks the data. Remember, we want to modify the data in two ways: 1. by placing it in a special search category and 2. by modifying the search term to indicate it did not yield any results.

To create the category all we need to do is add an extra query string parameter to the URL.

To manipulate the search term we need to split apart the page URL and then put it back together with the phrase no-results.

Here’s the complete code.




The code starts with the section that identifies a zero result search page.

Then we deconstruct the URL to identify the search term. Finally we add the category named ‘no_results’ and the phrase ‘no-results’ to the search term.

If the code does NOT find the term ‘No posts found.’ then a pageview is created as normal.

That’s it for the coding part (thank goodness!)

Step 3: Configure Site Search Settings

The last step is to add the new category parameter to the Site Search settings so GA can identify the no-results search category. This is easy, it’s in the profile setting section of Google Analytics.

How to set a search Category parameter in Google Analytics

I also like to set the ‘Strip Query Parameter’ to YES. This removes the category parameter after site search is done processing and normalizes your pageview data.

That’s it for the configuration! We’re cleared for insight-hunting!

Analyzing The Data

When a visitor performs a search that yields zero results the search term will be placed in a category named ‘no_results’. To find this data navigate to the Content>Site Search>Categories Report:

site-search-categories-google-analytics-2

Immediately you’ll be able to see what percentage of your searches yield zero results. Hopefully it’s very low! Want to see if this impacts conversions or revenue? Click the Goals or Ecommerce tab to check the conversion rate:

Zero Result Searches Impact on Website Outcomes

This is a bad picture, but you get the point.

Next you can click on the no-results line in the data and see exactly which search terms yielded zero results.

Search terms that had no results in Google Analytics

This is super-actionable data. Now you know where you may be missing content or if your site search engine might be broken. You should be asking yourself, “Why are there no results for these terms? Is there missing content or is there a problem with my site search engine?”

You’ll also notice that the search terms now have ‘no-results’ in them. This provides a lot of flexibility for view the search data other ways. Example, let’s use the Search Terms report:

Google Analytics site search queries

Here we can see the search terms ranked by searches. What percent of your top 10, 20 or 50 are no-result searches? How is that impacting your bottom line?

This is just the start. You can use other metrics, like %Search Exists to understand if visitors who receive zero results refine their search or exit.

While this is not the easiest thing to configure, I hope you see the value of the data. More so, I hope that all those folks that maintain plugins add this type of feature to their GA plugins. Joost, you listening!?

Filed Under: Analysis, Tips, Tracking Tagged With: enhancements, site search

Comments

  1. Michal Janik says

    September 8, 2009 at 11:11 pm

    My advice. I think that for a similar purpose:

    When you set the zero search results page special title, eg: Not found – “search phrase” – Yourweb.com, the results report will be in Google Analytics: Content -> Content by Title.

    It is necessary to filter pages containing “Missing -“.

    Reply
    • Justin Cutroni says

      September 9, 2009 at 6:18 am

      Michal,

      Absolutely! Another great way to identify zero result searches. As long as your site has a unique title for those searches. Great suggestion, thanks!

      Justin

      Reply
  2. Diogenes Passos says

    September 9, 2009 at 12:32 pm

    Hey Justin, another great post!

    The michal’s suggest is something that I worked on some sites. That was kind of easy using Joomla (great CMS indeed!) to provide a unique title for each search.

    About your suggest, it’s great AND provide a faster visualization of the user intention. I love Google Analytics (so you do I think) and for sure the most popular “hacks” from great analysts eventually can be implemented on the tool. So I apreciate your action and I wanna send a big Thank You for Charles Miller too.

    Best,
    @diogenespassos

    Reply
    • Justin Cutroni says

      September 9, 2009 at 8:30 pm

      Peter & Diogenes,

      Thanks to both of you. It really important to me to explain the what, why and how. I know this post came out a bit ‘techie’ (according to my good friend Daniel) but I hope it inspires some developers to add it to plugins, etc.

      Thanks again.

      Justin

      Reply
  3. PeterC says

    September 9, 2009 at 6:22 pm

    Justin,
    Great article! I admire your perseverance to get past the technical stuff and get such useful analytical result.

    Well done
    Pete

    Reply
  4. Tara Pingle says

    September 14, 2009 at 1:32 pm

    Thanks for this, Justin! I love all the info in the comments as well. I am about to start a keyword analysis project with one of our programmers using Google Analytics – this will help! :D

    Reply
  5. Dan Croxen-John says

    September 15, 2009 at 6:47 am

    Hi Justin,

    Well done for an illuminating post. I have been looking at producing a failed search report for a while.

    I think ‘failed search’ reports are one of two *gateway* reports. Gateway in they get people not particularly convinced by analytics that it can produce improvements in revenue quickly.

    The second report that I think has this evangelical potential is to Look-to-Book ratios. I have been able to get page views by product code, but I have not been able yet to get Added to Basket by Product Code (in GA, at least).

    Any ideas?

    Thanks

    Dan

    Reply
  6. David says

    September 30, 2009 at 12:29 pm

    Justin,

    Another great tip, thank you just need time to work with developers implement it…

    This is very powerful for understanding what people are expecting to find on a shopping site but dont…

    The only potential problem I would see would be around the unique title and how quickly you could get flooded with data? I just checked one client and they had close to 15,000 search terms, and i’m scared to think how many would have resulted in “0” results.

    Reply
    • Justin Cutroni says

      October 26, 2009 at 8:24 pm

      @Dan: I love it! Gateway reports, what a great saying! Can I use it in a presentation? As for the report you are looking for, trying using the Required Step feature in the Funnel configuration. It won’t give you look to book for every product code, but the general product page. Check out this post for more information.

      @David: Thanks for the feedback! GA has a table size of 50,000 unique search terms per day. So, in theory, yes, you could hit some limits. If you’re concerned with the data you could collect it on a secondary profile. And I will say that analyzing site search data, in general, is a lot of work due to all the variations. It just takes some time to wade through it all. And, if you do gain some insights from searches with 0 results, perhaps you could change the site and reduce the number of 0 result searches! :)

      Reply
  7. Corné says

    October 14, 2009 at 3:38 pm

    Hi Justin,

    I just set up my own blog and this kind of settings are very useful!

    Reply
  8. Qing Ru says

    October 28, 2009 at 9:10 pm

    Great, great post here Justin. Great hack, Charles!

    Being able to quantify and qualify what is being missed out is so important – if we don’t know what we don’t know, we won’t ever fix it.

    Reply
  9. Vicki Kuehnel says

    February 15, 2010 at 11:09 am

    I am encountering technical problems with the goal funnel visualization in GA. I set up all the goals based on virtual page view URLs in GA a month a go. Since then we are able to see the total CVR for each metric we have set up to track however the goal funnel visualization is not matching up to the totals and in some cases contains no data at all. I realise its very hard to assess without seeing the problem. Please could you send me an area where I can upload some screen grabs or alternatively I can send a temporary login to the account to see for yourself. I would appreciate any help from anyone who is experienced with Goal reporting in GA. Thanks Vicki

    Reply
    • Justin says

      March 4, 2010 at 11:20 pm

      Vicki,

      If you’re getting pageviews for the virtual pageviews then I bet your problem is with the Required Step setting in the funnel. This setting will force GA to only track data in the funnel report IF the visitor hits the first page in the funnel setup. My guess is that the virtual pageview for the first step of the funnel may be wrong and specified as a required step.

      Hope that helps,

      Justin

      Reply
  10. Pavel Sabatka says

    October 26, 2011 at 2:35 am

    I thing that Required Step setting in the funnel excludes visits only from funnel visualization. Conversion will be counted even if a first step is required and custommer doesn’t visit first step page.

    Great post, thanks!

    Reply
  11. Jan says

    December 7, 2011 at 9:08 am

    Hi Justin, can you please provide version of this code for asynchronous version of GA? By the way, bought your book ‘Google Analytics’. Very, very good. Use it all the time as an reference book. Unfortunately this bit is missing there as well.

    Reply

Trackbacks

  1. Analytics Talk » Blog Archive » Tracking Zero Result Searches in …- SFWEBDESIGN.com says:
    September 9, 2009 at 12:32 am

    […] more from the original source: Analytics Talk » Blog Archive » Tracking Zero Result Searches in …Share this on del.icio.usDigg this!Share this on RedditBuzz up!Stumble upon something good? Share it […]

    Reply
  2. Tweets that mention Analytics Talk » Blog Archive » Tracking Zero Result Searches in Google Analytics -- Topsy.com says:
    September 9, 2009 at 3:35 am

    […] This post was mentioned on Twitter by Eivind Savio, Kleiber Nicolas, Tim Ceuppens, Jos and others. Eivind Savio said: Tracking Zero Result Searches in Google Analytics: http://bit.ly/jV8yu #measure #ganalytics by @justincutroni […]

    Reply
  3. The Product Guy’s Weekend Reading (September 11, 2009) « The Product Guy says:
    September 14, 2009 at 1:00 pm

    […] http://www.epikone.com/blog/2009/09/08/tracking-ero-result-searches-in-google-analytics/ Finding value in tracking the experience of Zero Search Results. […]

    Reply
  4. Patrick M. Lozeau (pmlozeau) 's status on Tuesday, 22-Sep-09 18:49:15 UTC - Identi.ca says:
    September 22, 2009 at 1:49 pm

    […] http://www.epikone.com/blog/2009/09/08/tracking-ero-result-searches-in-google-analytics/ a few seconds ago from web […]

    Reply
  5. Searching Without Result - Yoast - Tweaking Websites says:
    October 1, 2009 at 4:00 pm

    […] 2009 Joost de Valk No comments, leave your own!Justin Cutroni wrote a great post a while back on Tracking Zero Result Searches in Google Analytics. Tracking zero result searches on your website (corporate site, e-commerce website or blog for that […]

    Reply
  6. Migliora il tracciamento della ricerca interna · Google Analytics in 30 secondi says:
    October 2, 2009 at 3:39 am

    […] forniamo. Questo è il motivo per cui Justin Cutroni ha scritto questo interessante post su come tracciare le ricerche con zero risultati. Purtroppo è un post molto tecnico e non credo riuscirei e renderlo meno “spesso” di […]

    Reply
  7. Searching Without Result - Programming Blog says:
    October 2, 2009 at 5:57 am

    […] Cutroni wrote a great post a while back on Tracking Zero Result Searches in Google Analytics. Tracking zero result searches on your website (corporate site, e-commerce website or your blog) is […]

    Reply
  8. Migliora il tracciamento della ricerca interna « Web Management says:
    November 9, 2009 at 7:23 am

    […] forniamo. Questo è il motivo per cui Justin Cutroni ha scritto questo interessante post su come tracciare le ricerche con zero risultati. Purtroppo è un post molto tecnico e non credo riuscirei e renderlo meno “spesso” di così […]

    Reply
  9. » Searching Without Result says:
    November 23, 2009 at 10:44 am

    […] Cutroni wrote a great post a while back on Tracking Zero Result Searches in Google Analytics. Tracking zero result searches on your website (corporate site, e-commerce website or your blog) is […]

    Reply
  10. using web analytics to value on-site searches with no matches | Facts and Figures says:
    December 9, 2009 at 7:24 am

    […] moment, but it wouldn’t surprise me if they introduced in their next release. Here’s a link to a blog post I found on the Analytics Talk that explains what you need to do get failed search terms into a GA […]

    Reply
  11. 30+ More Google Analytics Tools, Apps, Hacks, Tweaks and Other Resources | SEOptimise says:
    April 6, 2010 at 1:54 pm

    […] Tracking Zero Result Searches in Google Analytics – Analytics Talk […]

    Reply
  12. Important website performance KPIs to monitor and optimize | Facts and Figures says:
    April 23, 2010 at 8:40 am

    […] No, but ROI Revolution have suggested an easy way to capture the search term used in and number of times you get a failed search. But it does require some changes to your GATC […]

    Reply
  13. Boekreview: Search Analytics van Louis Rosenfeld says:
    January 16, 2012 at 11:10 am

    […] op? In Google Analytics zijn deze resultaten te filteren met een kleine aanpassing van je tracking code. Dit vond ik zeer nuttige informatie. Ik was namelijk niet op de hoogte van deze mogelijkheid […]

    Reply
  14. 35 step plan to beat your e-commerce website into shape. : Webdistortion says:
    July 2, 2012 at 1:59 pm

    […] and how they can be made infinitely more useful. For retailers, implementing a good onsite search, recording failed searches, iterating and learning from them is key to a healthy site, and healthier sales. […]

    Reply
  15. Analytics Advocate Justin Cutroni Answers Your Burning Questions (Part 2) | Analytics Expert Blog says:
    July 26, 2012 at 7:25 pm

    […] the zero-result search. In this case, I would probably create an Event rather than use the zero-result tracking technique. The reason is that sending a virtual pageview, with a parameter for the zero-result search, will […]

    Reply
  16. Welke features ontbreken er nog in Google Analytics? - Webanalisten.nl says:
    September 18, 2012 at 10:27 am

    […] meten, maar niet de zoekopdrachten zonder resultaten. Je kunt met een aanpassing in de code, deze zoekopdrachten eruit filteren. Om dit te realiseren ben je toch weer afhankelijk van de […]

    Reply
  17. Entiende a tu usuario gracias a la búsqueda interna | Con Tu Negocio says:
    February 6, 2013 at 9:50 am

    […] debemos tener en cuenta es el porcentaje de búsquedas que no devolvieron resultados (requiere de configuración en Google Analytics). Aunque cierto porcentaje de búsquedas sin resultados es admisible, cuando éste es alto […]

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

My Books

Google Analytics by Justin Cutroni
Learn More on Amazon.com

Performance Marketing co-authored by Justin Cutroni
Learn More on Amazon.com

Recent Posts

  • Understanding the Google Analytics Cohort Report
  • Using Offline and Online data to drive Google Analytics Remarketing
  • Understanding Cross Device Measurement and the User-ID
  • Universal Analytics: Now out of beta!
  • Advanced Content Tracking with Universal Analytics

Categories

  • About Google Analytics (25)
  • Analysis (52)
  • Analytics Strategy (3)
  • Campaign Tracking (14)
  • Ecommerce (8)
  • Event Tracking (10)
  • Remarketing (2)
  • Reporting (10)
  • Resources (7)
  • Tag Management (5)
  • Tips (25)
  • Tracking (52)
  • Uncategorized (64)
  • Universal Analytics (9)
  • Web Analytics (15)

Copyright © 2023 ·News Pro Theme · Genesis Framework by StudioPress · WordPress