> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.kelp.click/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Search analytics and attribution

Kelp tracks the journey from search to click, add to cart and purchase, so you can see which searches drive revenue.
## How attribution works
1. Search responses, and most browse responses, include a `queryId`.
2. Your storefront keeps it and sends it with later product click and add-to-cart events.
3. Kelp credits those actions to the search that surfaced the product.
## Events Kelp tracks
* Search and browse: `search`, `collection_viewed`
* Product: `product_viewed`, `product_clicked`, `product_wishlisted`, `product_added_to_cart`
* Conversion: `purchase`
* Session: `session_started`
* Email: `email_subscribed`, `email_unsubscribed`
## Good to know
* Events go to your analytics host, not your search host, and are sent in batches.
* The SDK fills in session, user and timestamp fields for you. Direct API callers must send them.
* Send add-to-cart events when the add succeeds, not when the button is clicked.
Developer reference: [Events / analytics API](https://docs.kelp.click/api/events)