Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix analytics events (CTR, conversion) instructions #2677

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions learn/cloud/analytics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ Every time a user clicks on a search result, your application must send a `click

```sh
curl \
-X POST 'https://edge.meilisearch.com' \
-X POST 'https://edge.meilisearch.com/events' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer DEFAULT_SEARCH_API_KEY'
--data-binary '{
"eventType": "click",
"eventName": "Search Result Clicked",
"indexUid": "products",
"objectID": "0",
"objectId": "0",
"position": 0
}'
```
Expand All @@ -70,15 +70,15 @@ The `click` event must deliver an object with the following fields:
"eventType": "click",
"eventName": "Search Result Clicked",
"indexUid": "products",
"objectID": "0",
"objectId": "0",
"position": 0
}
```

- `eventType`: a string indicating this is a `click` event
- `eventName`: a string describing the event
- `indexUid`: a string indicating the clicked document's index
- `objectID`: a string indicating the clicked document's primary key
- `objectId`: a string indicating the clicked document's primary key
- `position`: an integer indicating the clicked document's position in the list of search results

### Configuring conversion rate
Expand All @@ -89,14 +89,14 @@ Once you have established what counts as a conversion in your application, confi

```sh
curl \
-X POST 'https://edge.meilisearch.com' \
-X POST 'https://edge.meilisearch.com/events' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer Meilisearch_API_Key'
--data-binary '{
"eventType": "conversion",
"eventName": "Product Added To Cart",
"indexUid": "products",
"objectID": "0",
"objectId": "0",
"position": 0
}'
```
Expand Down