# Site Search Tracking

Site search tracking is a google analytics feature, where you can track the search requests on your site separately from pageviews.

To fully understand how site search tracking works, please read [this official article from google](https://support.google.com/analytics/answer/1012264?hl=en\&ref_topic=1031951).

## Step 1: Setup a correct pageview string

On the **Analytics Integration** plugin subm-menu page, change the `Google Analytics Pageview string` option to this format:

```
?ajax_search={asp_term}
```

.. like so:

![](/files/eWZE3yuPPZmdjNEQc2Sd)

The value between the question mark "?" and the "=" is going to be the query variable, so in this case the "*ajax\_search*" string.

You can replace the "*ajax\_search*" variable name with anything you want, just make sure to remember it.

## Step 2: Setup Google Analytics to track search

Log-in to your Google Analytics account, select the correct account, property and view.

On the **Admin** section, click on the **View Settings** Option:

![](http://i.imgur.com/ZgHxOpI.png)

Scroll down to the **Site search Tracking** option, and turn it on, and to the **Query parameter** option enter the "ajax\_search" or the query variable you have choosen before:

![](http://i.imgur.com/P2V6sCR.png)

Save the options, and it's done!

## Step 3: Check the reports

After a couple of hours the new search phrases should start to appear in the Site Search report.

![](http://i.imgur.com/dE4UoGU.png)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.ajaxsearchpro.com/analytics-integration/site-search-tracking.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
