Tracking WordPress site searches in Google Analytics

I’m going to admit to something when it comes to Google Analytics. Don’t be mad.

I wasn’t using the site search tools available inside GA. We have a Google Mini we use at my campus, and it does reporting, but I wasn’t using the site search stats inside Google Analytics until this past week.

Last week, we relaunched our internal news site, Inside JCU, as a nice, fancy responsive site. One of the goals I had for this relaunch was to do better tracking of what our campus users were reading, clicking on and searching on.




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

http://inside.jcu.edu/?s=term

That query variable makes tracking site searches from WordPress in Google Analytics very easy.

Step 1:

Login to Google Analytics and go to the Admin button. Find your property and select the view you want to edit.

Google Analytics Admin Screen
Click for a larger version

Step 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:

Google Analytics Site Search Button

Once clicked on, you see some additional menu items appear. They look like this:

Google Analytics Site Search Options Turned On

The only other field we need to worry about here is 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:

Google Analytics Site Search Variable Entry

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.

Can you tell when we turned on site search tracking?

Google Analytics Site Search Graph