Watch our video on setting up Site Search in Google Analytics or read full details below;

Standard two page setup

If you are using a two page setup for SearchUnit, whereby you use a separate page to display the search results, follow these steps;

Enable Site Search

Navigate to the Admin section of your Analytics account. Then click on View Settings option for the View you wish to setup Site Search tracking on and enable 'Site Search Tracking'.

Add the query parameter

A typical URL for the SearchUnit search results page will look like this; http://keyoti.com/searchresults.aspx?query=test

In order that Google Analytics can determine the search term used we just need to set the Query Parameter field to query.

Optional category parameters

For Google Analytics to register the categories used to refine your site's search results, under Site Search Categories enter ‘location’ and ‘contents’.

Once you have finished setting up your parameters click Save.

One page (AJAX) setup

If you are displaying search results within the same page as the search box – so for instance you are using the AJAX method of displaying search results within the same page, follow these steps

Virtual pageview

When using a one page AJAX setup you wont have the opportunity to use the query parameter in the URL to register the search term so you will need to register a virtual pageview with Google Analytics instead. To do this, simply add the following function to your search button's onclick event;

ga('send', 'pageview', '/mysite/?query='+ keyotiSearchBox.getQuery());

Site Search reports

To review your website search activity, navigate to the Reporting > Behaviour > Site Search section of your Analytics account where you can view your site's search usage.