> ## Documentation Index
> Fetch the complete documentation index at: https://www.algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# clickAnalytics

> Whether to compute a query ID for the current query

\<ul><li>**Type:** `boolean`</li>
      \<li>**Default:** `false`</li>
      
      
      \<li>**Scope:** [`search`](https://www.algolia.com/doc/api-reference/api-parameters)</li></ul>The `clickAnalytics` parameter determines, if the response includes a `queryID`
parameter for linking click and conversion events to searches.
This query ID is required for all [events related to a search](https://www.algolia.com/doc/guides/sending-events/concepts/event-types.md).For more information about sending events, see [Click and conversion events](https://www.algolia.com/doc/guides/sending-events).## UsageSetting `clickAnalytics` to `true` doesn't add any new analytics data.
It only ensures that the `queryID` is generated and added to the search response.
You have to pass this `queryID` when sending search-related events to the Insights API.## Example> [accordion] Current API clients
>
> ```cs C# theme={"system"}
> var response = await client.SearchSingleIndexAsync<Hit>(
>   "INDEX_NAME",
>   new SearchParams(new SearchParamsObject { ClickAnalytics = true })
> );
> ```
>
> ```dart Dart theme={"system"}
> final response = await client.searchSingleIndex(
>   indexName: "INDEX_NAME",
>   searchParams: SearchParamsObject(
>     clickAnalytics: true,
>   ),
> );
> ```
>
> ```go Go theme={"system"}
> response, err := client.SearchSingleIndex(client.NewApiSearchSingleIndexRequest(
>   "INDEX_NAME").WithSearchParams(search.SearchParamsObjectAsSearchParams(
>   search.NewEmptySearchParamsObject().SetClickAnalytics(true))))
> if err != nil {
>   // handle the eventual error
>   panic(err)
> }
> ```
>
> ```java Java theme={"system"}
> SearchResponse response = client.searchSingleIndex("INDEX_NAME", new SearchParamsObject().setClickAnalytics(true), Hit.class);
> ```
>
> ```js JavaScript theme={"system"}
> const response = await client.searchSingleIndex({ indexName: 'indexName', searchParams: { clickAnalytics: true } });
> ```
>
> ```kotlin Kotlin theme={"system"}
> var response =
>   client.searchSingleIndex(
>     indexName = "INDEX_NAME",
>     searchParams = SearchParamsObject(clickAnalytics = true),
>   )
> ```
>
> ```php PHP theme={"system"}
> $response = $client->searchSingleIndex(
>     'INDEX_NAME',
>     ['clickAnalytics' => true,
>     ],
> );
> ```
>
> ```python Python theme={"system"}
> response = client.search_single_index(
>     index_name="INDEX_NAME",
>     search_params={
>         "clickAnalytics": True,
>     },
> )
> ```
>
> ```ruby Ruby theme={"system"}
> response = client.search_single_index(
>   "INDEX_NAME",
>   Algolia::Search::SearchParamsObject.new(click_analytics: true)
> )
> ```
>
> ```scala Scala theme={"system"}
> val response = Await.result(
>   client.searchSingleIndex(
>     indexName = "INDEX_NAME",
>     searchParams = Some(
>       SearchParamsObject(
>         clickAnalytics = Some(true)
>       )
>     )
>   ),
>   Duration(100, "sec")
> )
> ```
>
> ```swift Swift theme={"system"}
> let response: SearchResponse<Hit> = try await client.searchSingleIndex(
>     indexName: "INDEX_NAME",
>     searchParams: SearchSearchParams.searchSearchParamsObject(SearchSearchParamsObject(clickAnalytics: true))
> )
> ```> [accordion] Legacy API clients
>
> ```cs C# theme={"system"}
> index.Search(
>   new Query("query") {
>     ClickAnalytics = true
>   }
> );
> ```
>
> ```go Go theme={"system"}
> index.Search(
> 	"query",
> 	opt.ClickAnalytics(true),
> )
> ```
>
> ```java Java theme={"system"}
> index.search(
>   new Query("query")
>     .setClickAnalytics(true)
> );
> ```
>
> ```js JavaScript theme={"system"}
> index
>   .search("query", {
>     clickAnalytics: true,
>   })
>   .then(({ hits }) => {
>     console.log(hits);
>   });
> ```
>
> ```php PHP theme={"system"}
> $res = $index->search('query', [
>   'clickAnalytics' => true
> ]);
> ```
>
> ```python Python theme={"system"}
> res = index.search("query", {"clickAnalytics": True})
> ```
>
> ```ruby Ruby theme={"system"}
> results = index.search(
>   "query",
>   {
>     clickAnalytics: true
>   }
> )
> ```
>
> ```swift Swift theme={"system"}
> let query = Query("query")
>   .set(\.clickAnalytics, to: true)
>
> index.search(query: query) { result in
>   if case .success(let response) = result {
>     print("Response: \(response)")
>   }
> }
> ```
