v0.3.0
New functions to control Search Analytics:
- sendStatsEvent to send search queries and clicks to analytics
- setStatsSessionId and getStatsSessionId to manually control the search session ID or to share the ID between multiple client instances. Only the last keyword of a single session is shown on the Analytics Dashboard.
Deprecated searchResultClicked function and it should be replaced with sendStatsEvent:
// documentId is the 32-character long id that is part of each hit in search results.
// position is the position of the document that was clicked, the first result being 1
client.sendStatsEvent('click', keyword, {documentId: id, position: n});