Clickthrough
Track which results were clicked after a query.
This information will be collected and shown in the Analytics tab of your App Search dashboard.
POST
/api/as/v1/engines/{ENGINE_NAME}/click
- query
- required
- The query that the user searched with.
- document_id
- required
- The
id
of the document that was clicked on. - request_id
- optional
- The request
id
returned in themeta
tag of a search API response. - tags
- optional
- Array of strings representing additional information you wish to track with the clickthrough. You may submit up to 16 tags, and each may be up to 64 characters in length.
Example
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/click' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer search-soaewu2ye6uc45dr8mcd54v8' \
-d '{
"query": "everglade",
"request_id": "e4c4dea0bd7ad3d2f676575ef16dc7d2",
"document_id": "park_zion",
"tags": ["firefox", "web browser"]
}'
Example
No Java example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/click' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer search-soaewu2ye6uc45dr8mcd54v8' \
-d '{
"query": "everglade",
"request_id": "e4c4dea0bd7ad3d2f676575ef16dc7d2",
"document_id": "park_zion",
"tags": ["firefox", "web browser"]
}'
Example
No Node example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/click' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer search-soaewu2ye6uc45dr8mcd54v8' \
-d '{
"query": "everglade",
"request_id": "e4c4dea0bd7ad3d2f676575ef16dc7d2",
"document_id": "park_zion",
"tags": ["firefox", "web browser"]
}'
Example
No Ruby example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/click' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer search-soaewu2ye6uc45dr8mcd54v8' \
-d '{
"query": "everglade",
"request_id": "e4c4dea0bd7ad3d2f676575ef16dc7d2",
"document_id": "park_zion",
"tags": ["firefox", "web browser"]
}'
Example
No Python example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/click' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer search-soaewu2ye6uc45dr8mcd54v8' \
-d '{
"query": "everglade",
"request_id": "e4c4dea0bd7ad3d2f676575ef16dc7d2",
"document_id": "park_zion",
"tags": ["firefox", "web browser"]
}'
Example
No Javascript example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/click' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer search-soaewu2ye6uc45dr8mcd54v8' \
-d '{
"query": "everglade",
"request_id": "e4c4dea0bd7ad3d2f676575ef16dc7d2",
"document_id": "park_zion",
"tags": ["firefox", "web browser"]
}'
What's Next?
Clickthrough data is rich. Generate it from your applications for great insights into searcher behaviour. If you want to learn even more, the Analytics endpoint will provide a clear view into user search activity and document performance. If you want to start improving your results, consider reading about Synonyms and Curations.
Stuck? Looking for help? Contact support or check out the App Search community forum!