Site search in Google Analytics requires that the search form passes keyword in the URL of as a query parameter. Google Analytics then uses that query parameter to parse the keywords and show it in Site Search report.
Tracking Site Search
Google Analytics is configured to read the query parameter “s” as the parameter that contains the search keyword.
However, if your form does not pass the keyword in the URL then that becomes an issue. Here are few steps that will help you get your site search report event when the keyword is not passed in the URL. You should have access to your site’s code or have the web developer follow these steps
- The Search form passes the keyword via POST method (if it is not passing it via query string). This keyword can be grabbed on the final search result page via some coding (.net, php or any other programming language your sites uses). Grab the keyword and store it in a variable.
- Once you have the keyword in variable on the use that variable to construct a pseudo URL that passes this keywords in the query parameter. In order to do so modify the Google Analytics code on the search result page from
Where “searchresult.aspx is the name of your Search result page. If the name is different then use that name. “query” is the query paramter that is used to pass the keyword.
- Set up your Google Analytics to read the query parameter “query” as the parameter containing search (see below).
Now you should be able to see your Site Search results in Google Analytics Reports.