Tracking site searches in WordPress

For various reasons, you may want to start tracking what your visitors are searching in your WordPress site. If you are using Google Analytics, setting up site search is quite straight forward. WPTipster recommends that you setup Google Analytics with Google Tag Manager, as this makes adding additional tracking easier, even from third parties. If you aren’t using Tag Manager with WordPress, view our previous article on how to setup Google Analytics with Google Tag Manager.

Why should I set up site search?

As already mentioned, setting up site search gives you information on what your users search on your site. This information can be used in many ways to improve your site. Based on the information, you can improve for example:

  • Content – Does your site provide the content what users want?
  • Content format – Are users looking for different content formats like videos or infographics?
  • Site structure – Aren’t users finding themselves around without the search?

To summarise, setting up tracking for site search, gives you a better understanding on what your users want to find on your site and this will give you a better idea on how to answer that demand.

How to setup site search with Google Analytics

Site search is activated on View basis in Google Analytics and it is always better practice to create a new View instead of using the, All Website Data -View. This way you will always have the raw data available, if something goes wrong with your modifications. If you aren’t familiar with view, checkout our article on how to create a new view.

What is query parameter

To find you what is your site’s query parameter, type something in the search field and execute the search. After the search results are displayed, take a look at your url.

WPTipster query parameter on site searches
Wordpress Query Parameter

For WPTipster, the query parameter is s, but this may not be the case with your WordPress site. To confirm your query parameter, try your own site search.

Activating site search in Google Analytics

Now that we know our query parameter, it is time to setup the site search and as mentioned before, this is done on the view settings (Admin -> View -> View Settings)

View settings in Google Analytics
WPTipster view settings

Scroll to the bottom of the view settings page and you should be able to see the Site Search Settings. By default, Site search tracking is disabled.

Default setting. Site tracking is turned off
Site search tracking in Google Analytics

Activate the site search tracking, by turning the switch on. Then add your query parameter and hit save. Your site search tracking should be now activated and you can start monitoring the results in Google Analytics.

Search tracking activated in Google Analytics
Site Search tracking activated in Google Analytics