POST /v1/stats/{index public key}
Reports search and click events.
{ "action": "click", "session": "session_name", "keyword": "test query", "docid": "abc123", "position": 1 }
{ "action": "search", "session": "session_name", "keyword": "test query", "numberOfResults": 4 }
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. |
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.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 unless you have the collectAnalytics parameter set to false. Click events should be reported via this endpoint to reflect your search performance in the AddSearch analytics dashboard and adjust ranking based on your users’ behaviour.
We’re always happy to help with code or other questions you might have. Search our documentation, contact support, or connect with our sales team.