search mobile facets autocomplete spellcheck crawler rankings weights synonyms analytics engage api customize documentation install setup technology content domains user history info home business cart chart contact email activate analyticsalt analytics autocomplete cart contact content crawling custom documentation domains email engage faceted history info install mobile person querybuilder search setup spellcheck synonyms weights engage_search_term engage_related_content engage_next_results engage_personalized_results engage_recent_results success add arrow-down arrow-left arrow-right arrow-up caret-down caret-left caret-right caret-up check close content conversions-small conversions details edit grid help small-info error live magento minus move photo pin plus preview refresh search settings small-home stat subtract text trash unpin wordpress x alert case_deflection advanced-permissions keyword-detection predictive-ai sso

Clickthrough

Click

Tracking clicks is a way of gathering information about user interaction with your search use case. If a user clicks on a result, you may send an API request to track information about what query they made, what document they clicked on, and other related information. 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 the meta tag of a search API response.
tags
optional
Array of strings representing additional information you wish to track with the clickthrough.
Example
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/click' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer search-o5bk7qpaedd2xmcsavb1d8os' \
-d '{
  "query": "toyota",
  "request_id": "e4c4dea0bd7ad3d2f676575ef16dc7d2",
  "document_id": "441376183",
  "tags": ["firefox", "web browser"]
}'

Example
No Java example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/click' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer search-o5bk7qpaedd2xmcsavb1d8os' \
-d '{
  "query": "toyota",
  "request_id": "e4c4dea0bd7ad3d2f676575ef16dc7d2",
  "document_id": "441376183",
  "tags": ["firefox", "web browser"]
}'

Example
No Node example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/click' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer search-o5bk7qpaedd2xmcsavb1d8os' \
-d '{
  "query": "toyota",
  "request_id": "e4c4dea0bd7ad3d2f676575ef16dc7d2",
  "document_id": "441376183",
  "tags": ["firefox", "web browser"]
}'

Example
No Ruby example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/click' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer search-o5bk7qpaedd2xmcsavb1d8os' \
-d '{
  "query": "toyota",
  "request_id": "e4c4dea0bd7ad3d2f676575ef16dc7d2",
  "document_id": "441376183",
  "tags": ["firefox", "web browser"]
}'

Example
No Python example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/click' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer search-o5bk7qpaedd2xmcsavb1d8os' \
-d '{
  "query": "toyota",
  "request_id": "e4c4dea0bd7ad3d2f676575ef16dc7d2",
  "document_id": "441376183",
  "tags": ["firefox", "web browser"]
}'

Example
const client = SwiftypeAppSearch.createClient({
  hostIdentifier: 'host-2376rb',
  searchKey: 'search-o5bk7qpaedd2xmcsavb1d8os',
  engineName: 'rent-a-car'
})

const options = { query: 'toyota', documentId: '441376183', requestId: 'e4c4dea0bd7ad3d2f676575ef16dc7d2', tags: ['firefox', 'web browser'] }

client.click(options)

What's Next?

Clickthrough data is rich. You can glean deep insights by generating it from your applications. If you want to find even more insights, the Analytics end-point 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!