The dreaded "No search results found" like the one below is a terrible user experience and can mean lost sales. So let's see how we can track these lost searches and make a difference to our customers experience and increase revenue on the website.
Video tutorial
👍 Important correction: Use the ".ex-emptysearchresults" and NOT ".noproductsfound" in your Element Selector within the GTM trigger. This is a correction to the video at minute 03:37
Custom Javascript: copy and paste this into the variable configuration
function (){
var search = window.location.search.substring(7).split('&').shift(),
regex1 = /[+]+/gm,
searchText = search.replace(regex1, "%20");
return decodeURIComponent(searchText);
}
Saved Report: https://analytics.google.com/analytics/web/template?uid=zqxIzVLmTyeN54sjvSPrAQ
once you have the setup done in the video then click the link while logged into Google analytics.
🎉 In under 10 mins you are now able to review your failed searches and decide on how to handle them.
What to do next?
Once you identified a failed search knowing how to fix it is key. Here are some examples.
Misspelling or similar terms: add the terms to the product keywords
Determining a better result page: use the redirect module to redirect this search page to a more appropriate results page.
That's it, now go off and be awesome!