> For the complete documentation index, see [llms.txt](https://documentation.ajaxsearchpro.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.ajaxsearchpro.com/analytics-integration/site-search-tracking.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
