Skip to content

Commit c932b3f

Browse files
authored
Merge pull request #3593 from meilisearch/feat-ignore-search-analytics
feat: how to exclude search from analytics
2 parents 87eadbc + b1c41d6 commit c932b3f

3 files changed

Lines changed: 32 additions & 1 deletion

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: Exclude search requests from analytics
3+
sidebarTitle: Exclude search requests from analytics
4+
description: Learn how to improve your analytics by excluding search requests.
5+
---
6+
7+
import CodeSamplesAnalyticsExcludeSearchRequests from "/snippets/generated-code-samples/code_samples_analytics_exclude_search_requests.mdx";
8+
9+
You may want to exclude specific search requests from analytics in certain use cases, such as:
10+
11+
- When initializing a page and displaying initial results to users
12+
- When building UI components such as category filters
13+
14+
# Exclude searches from your analytics
15+
16+
To exclude specific searches from your analytics, set the `analytics` parameter to `false`.
17+
18+
<CodeSamplesAnalyticsExcludeSearchRequests />

config/navigation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@
298298
"pages": [
299299
"capabilities/analytics/how_to/bind_events_to_user",
300300
"capabilities/analytics/how_to/track_click_events",
301-
"capabilities/analytics/how_to/track_conversion_events"
301+
"capabilities/analytics/how_to/track_conversion_events",
302+
"capabilities/analytics/how_to/ignore_search_requests"
302303
]
303304
},
304305
{
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<CodeGroup>
2+
3+
```bash cURL
4+
curl \
5+
-X POST 'MEILISEARCH_URL/indexes/INDEX_NAME/search?analytics=false' \
6+
-H 'Content-Type: application/json' \
7+
-H 'Authorization: Bearer DEFAULT_SEARCH_API_KEY' \
8+
-H 'X-MS-USER-ID: MEILISEARCH_USER_ID' \
9+
--data-binary '{}'
10+
```
11+
12+
</CodeGroup>

0 commit comments

Comments
 (0)