Everything here sits underneath the snippet and the two calls covered in the Developer Quickstart. Most integrations only ever need those two: the snippet, and the server side sale event. This page is for anyone who needs the raw HTTP behind them, or the full conversion API.
Core ids
Site key (
sm_pk_...), public, identifies your domain to the tracking endpoints. Safe to expose in client side code.Visitor id (
sm_vidcookie), a first party id for the browser, minted on first contact.Touch id (
sm_idcookie, also calledsmid), identifies one specific click. This is the id you forward assmidwhen reporting a sale.API key (the
x-codeheader), private, authenticates the server side conversion API. Never expose this in browser code.
Browser SDK, served from sm.js
All public, unauthenticated beyond the site key, and rate limited per site key and IP. Called automatically by the snippet, you do not normally call these directly.
Endpoint | What it does |
|---|---|
| Serves the tracking script itself, already configured for your site key. |
| Called on every page load. Binds the attribution id to the visitor and sets first party cookies where possible. |
| What |
| Records a named browser side lead event, for example a signup. Sales are never sent from the browser, only from your server. |
| Returns the current attribution (touch id, creator, campaign, UTM values) for this browser. Used internally by the SDK and the setup checklist. |
Server side conversion API
Authenticated with your API key in the x-code header. This is what you or a connected store call when something worth crediting happens.
POST /api/v2/conversion/track/sale
Field | Required | Notes |
|---|---|---|
| Yes | Your own user id for the customer. |
| Yes | In the smallest currency unit, cents for usd. |
| No | 3 letter code, defaults to usd. |
| No | Attribution hints, send whichever you have. Only set |
| No | Used for identity matching and the Activity feed. |
| No | Free form record keeping. |
POST /api/v2/conversion/track/lead
Same attribution hints and identity fields as track/sale, for events before a purchase (signup, trial start, demo booked). Also takes eventName (required) and a mode of async, wait, or deferred (defaults to wait).
How a match is scored
Every conversion is matched by the strongest signal available, in this order. Only the top three count as deterministic, the rest are surfaced to you as lower confidence rather than presented as certain.
Method | Confidence | What it means |
|---|---|---|
| 1.0 | Click id sent with the conversion. |
| 0.99 | Attribution id captured from the landing URL. |
| 0.95 | First party browser id. |
| 0.9 | Known customer id, from an earlier identify call. |
| 0.85 | Hashed email match. |
| 0.8 | An earlier event from the same customer. |
| 0.5 | Device and network match, only used if enabled in Settings. |
See Settings & Privacy for the attribution window and model that decide which touch wins when more than one is eligible, and the Developer Quickstart for the three calls almost every integration actually needs.
Published with LeafPad