Tracking Site Search is important
Tracking what users search for is one of the best ways to improve your website (Learn how to set up site search). You can find out what users are searching for overall, what they’re searching for when on a specific page, and thanks to advanced segments, you can even track what they’re searching for after having landed on your site via the search engines. This data can be useful for understanding what your visitors are looking for. You may find that they are looking for a product you may have deemed less relevant and therefore relegated to a spot that’s harder to find than the products you deemed more relevant.
The need for a query string
To track search queries, Google requires that your search results append a query string at the end of a URL. In Figure F-2, the query string is kw.
In order to track searches, you have to set kw as your query parameter in your Analytics Profile Information. (Analytics Setting >Profile Settings > Edit Profile Information. See Figure F-3)
How redirects can be a problem
Google is unable to track search results when you redirect users to a different URL when they perform a search. For an example, if whenever a user searches for ‘widgets’ you redirect them to the widget landing page, Google is unable to track it because it lacks the query string ‘kw’ at the end of URL.
The simplest solution is to redirect user to the URL with the query string already in place. See Figure F-4.
In doing so, Analytics will track the resulting page, as though it were a normal search result.