POST /v1/stats/{index public key}
Reports search and click events.
Payload for a click event
{
"action": "click",
"session": "session_name",
"keyword": "test query",
"docid": "abc123",
"position": 1
}
Payload for a search event
{
"action": "search",
"session": "session_name",
"keyword": "test query",
"numberOfResults": 4
}
Search event parameters
| Parameter | Description | Type | Note |
|---|---|---|---|
| action | The type of the user's action | string | Must be "search" |
| session | User's search session identifier | string | A sequence of characters, not longer than 32 characters |
| keyword | Search terms | string | Multiple keywords may be split with spaces |
| numberOfResults | The number of results returned for the search query | int | If 0, the search is recorded as "No hit" in the analytics overview |
| tag | A tag that can be used to filter analytics in the dashboard. For more information read the article. | string | The maximum length of a tag is 50 characters. |
Click event parameters
| Parameter | Description | Type | Note |
|---|---|---|---|
| action | The type of the user's action | string | Must be "click" |
| session | User's search session identifier | string | A sequence of characters, not longer than 32 characters |
| keyword | Search terms | string | Multiple keywords may be split with spaces |
| docid | The id of the clicked document | string | Document id is the MD5 hash of a full URL with protocol and possible query parameters. For example the doc id of https://www-dev.addsearch.com/ is 3b1d053e2fdf65f178dc5d1b5bd00f75 The maximum length of a docid is 32 characters. |
| position | The position of the clicked document in the search results | int | Numeration starts with 1. |
| tag | A tag that can be used to filter analytics in the dashboard. For more information read the article. | string | The maximum length of a tag is 50 characters. |
Returns HTTP 200 OK if successful.
Note: searches made via search API endpoint are reported automatically. For custom implementations we recommend setting the collectAnalytics parameter to false and report both search and click events with dedicated API calls. This is needed to reflect your search performance in the AddSearch analytics dashboard and adjust ranking based on your users’ behaviour.