EaserixDocs
DevelopersAPI referenceLinksAnalytics

Record a conversion for a click

Attributes a conversion to a click. Links with trackConversions enabled append ?esrx_id=<click id> to their destination; the customer's backend captures it and posts it here (typically with an org API key) when the visitor signs up or pays. Clicks are written asynchronously, so an instant conversion can 404 once — retry after a second. Idempotent on clickId+name: retrying the same clickId with the same name (a dropped response, an at-least-once webhook relay) returns 200 with the already-recorded conversion instead of creating a second one. A different name for the same clickId (e.g. "signup", then later "purchase") is a distinct event and is always accepted as a new 201.

View as Markdown
POST
/v1/track/conversion
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/track/conversion" \  -H "Content-Type: application/json" \  -d '{    "clickId": "string"  }'
{  "conversion": {    "id": "string",    "linkId": "string",    "name": "string",    "amountCents": 0,    "currency": "string",    "created": "2019-08-24T14:15:22Z"  },  "duplicate": true}

Live click feed for one link (SSE)

EAS-83: a Server-Sent Events stream of new clicks on this link as they're recorded. Layered on top of the existing ~500ms click-batch pipeline (never a separate capture path): the connection emits `data: <Click>` for each click as its batch is durably persisted (bot clicks excluded, same as recentClicks), one JSON object per click, plus `: ping` heartbeat comments roughly every 25s. One-way and stateless — any replica can serve any client. Same readable scope as GET /v1/links/{id}: the owner, or anyone in the organization when the link's visibility is "org". EAS-83 follow-up: each Click also carries `clicksUsed`/`qrScansUsed` — the same live Redis usage-cap counts GET /v1/links/{id} returns at the top level — so a client can track the Click/QR-scan-limit stats live instead of only refreshing them on the next full reload. Both are omitted if the usage limiter isn't wired server-side (same best-effort degrade as GET's own clicksUsed/qrScansUsed). Open streams are capped per link and per user on each replica; past a cap the response is 429 with a plain-language message and the client retries on its own. The server ends the stream when the caller's access token expires, so a client reconnects (refreshing its token) and refetches — clicks in the gap are not replayed. Every couple of minutes the server also re-checks that the caller still has access (their identity has not changed, and the link still exists and is readable by them) and ends the stream if not.

Account-wide link analytics

Account-wide totals, the top five links by clicks, a daily click series, and country/device/browser/referrer breakdowns across all links for the requested window. Bot traffic is excluded from series and breakdowns.