API Reference / API Parameters / clickAnalytics
Type: boolean
Engine default: false
Parameter syntax
'clickAnalytics' => true|false

Can be used in these methods:

About this parameter

Add a query ID parameter to the response for tracking click and conversion events.

If true, the search response contains a queryID parameter, which uniquely identifies a search query. This queryID can be used in Click and conversion analytics.

Usage notes

Setting 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 with the clickedObjectIdsAfterSearch or convertedObjectIdsAfterSearch methods.

For more information about sending events, see Getting Started with events.

Examples

1
2
3
$res = $index->search('query', [
  'clickAnalytics' => false
]);
1
2
3
$res = $index->search('query', [
  'clickAnalytics' => true
]);
Did you find this page helpful?