What works without any setup
Every payment you take through Khaime is already counted:- Revenue and orders, in each currency you are paid in
- The revenue timeline
- Checkouts Khaime priced (
/cart/validate), payments started, and paid orders
Turn on visitor tracking
1
Get your tracking key on your server
Call Not using React? Call
getKhaimeTracking with your API key. The first call turns tracking on for your business; later calls return the same key. Your API key must stay on the server. The tracking key it returns is safe to put in the page.app/layout.tsx
GET /api/v1/analytics/tracking with your X-API-Key header and load script_url with window.KhaimeCA = { key: tracking_key, apiBase: api_base } set first.2
Pass the visitor to Khaime at checkout
This is what joins a visit to the cart, payment and order it led to. Read the ids in the browser and send them to your server with your checkout request:Then forward them on your Khaime calls as headers:Send the same headers on
/product-payment/intent or /payment/intent.3
Review your funnel in Store Pulse
Once visits arrive, Store Pulse shows Tracking is live on your site and suggests your checkout funnel from what it saw: the pages where products were viewed, the buttons shoppers used to add to cart, and the checkouts and payments Khaime recorded. Open Review funnel to:
- Rename, reorder, add or remove steps
- Point a step at a page pattern (
/shop/:id,/checkout) or an event, optionally a click on a button containing some text - Tick the domains your site runs on
Report actions yourself (optional)
By default the tracker recognises product pages and “Add to cart” or “Checkout” buttons from the page. If your site is built differently, report actions explicitly and setautoDetectCommerce={false} so nothing is counted twice:
How the funnel is measured
Steps measured by Khaime can be renamed but not remapped, so revenue and conversion always match your payments. A step that needs your site shows Not tracked until your site reports it, instead of a misleading zero.
Privacy
The tracker stores a random visitor id in the browser and records page views, product views and the text of buttons and links shoppers click. It never records what shoppers type into forms. Mention Khaime analytics in your privacy notice, and passdisabled to <KhaimeAnalytics /> until a visitor consents if your site requires it.
Reference
string
required
From
getKhaimeTracking(). Tracking does nothing without it.string
From
getKhaimeTracking(). Defaults to Khaime’s production tracker.string
From
getKhaimeTracking().boolean
default:"true"
Recognise product views and add to cart / checkout clicks from the page. Turn off if you call
trackKhaimeEvent yourself.boolean
default:"false"
Load nothing while true, for example before cookie consent.
