Configuring Google Analytics Site Search

Google Analytics is an incredibly powerful tool. Used correctly it can give you valuable insight into your client base that can help you understand what brings people to your website, what makes them leave and what you can do to increase traffic, return rates or a whole host of other metrics that will increase your website’s value to your business.One of the many things you can do with Analytics is configure it to understand your own site’s search parameters – this is valuable because it can allow you to build better reports on what people are searching for and better understand how they’re using your website.

Configuring for Site Search Query
In the first instance you need to enable Site Search under the website profile settings for the Analytics property you wish to track site search on. This is done by navigating to the Google Analytics profile under the “Admin” tab on the right-hand side of your Google Analytics account menu. Click through to the property you wish to apply the changes to and then choose the profile you wish to edit (usually there’s only one, by default it’s called “All Website Data”).

Next you’ll be brought to a Profile screen with a series of tabs along the top, one of which is called “Profile Settings” – click on that tab and scroll down to the bottom of the page. You should now see a box similar to the one below:

Google Analytics Site Search Settings - Step 1

You’ll need to change the radio button to say “Do track Site Search”, then you’ll be presented with a field for the query parameter your site uses to perform searches. The form should now look like this:

Google Analytics Site Search Settings - Step 2

You can enter up to five values into this field, separated by commas. If we take an arbitrary site search like this one we can see that it uses a parameter called “q” to perform the keyword search. Therefore that’s the keyword we want to use.

Configuring for Site Search Categories
As the more astute of you will probably have noticed, there’s another search parameter you can tell Google Analytics about; the categories parameter. This is useful if you have an advanced search feature like the golf website we looked at before does. If you perform a search on that website with any of the facilities options checked, you’ll see your URL query string adds a parameter for each of them called facilities[], though this gets encoded to become facilities%5B%5D – to ensure we track the categories correctly we’ll need to add that string to the categories field, and you should end up with a screen that looks like this:

Google Analytics Site Search Settings - Step 3

Deciding Whether or Not to Strip Parameters
Stripping the parameters out of the URLs is an option available to you for both the query parameter and the category parameter. Whether or not you choose to do this is entirely up to you. Personally, I do it because it makes the content report easier to read (as all hits to that page will then be recorded under the one search URI rather than having different URIs due to there being query strings in the URL), but it’s totally your choice as to what works best for you.

Once you’re happy with the changes, apply them and you’re done. Bear in mind Google reminds you that it can take up to 48 hours for such changes to take effect.