How to Track WordPress Site Searches in Google Analytics

Track WordPress Site Searches in Google Analytics

In this tutorial, we will look at how to track WordPress site searches in Google analytics.

This is particularly important as it enables one to track the kind of content one’s users are looking for. For example, as a hosting company we provide articles on how to manage your hosting account and CMS. Whilst we have written a number of articles on the same, some particular client specific articles might have been left out. As such, when a client or other internet user come across our site and they need help with say, Cloudflare related issue, they will search for it. If they don’t find it, tracking what the user search might help the site owner write up the article for future refences.

We use WordPress as our CMS at WHK, and while far from perfect, the built-in search is good enough. When a user searches, WordPress using a URL structure like this:

That query variable makes tracking site searches from WordPress in Google Analytics very easy using the following steps:


  1. Login to Google Analytics and go to the Admin button. Find your property and select the view you want to edit.
  2. Click on the view settings link for that property. One that page is loaded, scroll down and find the site search area. If the slider is clicked to off, click on. Here’s what that looks like:
  3. Once clicked on, you see some additional menu items appear. They look like this:
  4. Key in the query parameter. This is the variable your CMS or search tool sends to signify its a search query. For WordPress, this is super simple, just enter the letter s in that box. That looks like this:
  5. That’s it, you’re good to go. Give Google Analytics a day or so to gather up some search terms and you have data on what your users are searching for. You can use that data to determine if you’re having navigation issues, content strategy and much more.



Leave a Reply

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