Track revenue
Attach an amount to any event, from the browser or your backend, and see revenue by source, campaign, country and device.
Amounts are integers
Revenue is always the smallest currency unit: cents, paise, pence. 4900 means $49.00. Floats are rounded and values are clamped to 0–1,000,000,000 cents. Amounts are stored as sent; there is no currency conversion.
From the browser
window.linqry('purchase', { plan: 'pro' }, 4900);Revenue sent from the browser is untrusted: anyone can call window.linqry() from your page. It is capped at 1,000,000,000 cents and useful for dashboards, but for anything money-critical send it from your backend with the write key.
From your backend
Send the event where the payment is actually confirmed: a Stripe/Razorpay webhook, a background job. Pass the landing url (with its UTM parameters) and referrer you captured at signup if you want the revenue attributed to a channel; without them it is reported under direct / (none).
curl -X POST https://linqry.com/api/track \
-H 'authorization: Bearer YOUR_WRITE_KEY' \
-H 'content-type: application/json' \
-d '{
"siteId": "YOUR_SITE_ID",
"event": "subscription-renewed",
"url": "https://yourdomain.com/pricing?utm_source=newsletter",
"properties": { "plan": "pro" },
"revenue": 4900
}'The full payload reference, rate limits and error codes are on the HTTP API page.
/api/revenue
curl -X POST https://linqry.com/api/revenue \
-H 'authorization: Bearer YOUR_WRITE_KEY' \
-H 'content-type: application/json' \
-d '{ "siteId": "YOUR_SITE_ID", "amount_cents": 4900, "currency": "USD",
"visitor_id": "<optional>", "email": "<optional>", "ts": "2026-09-05T10:00:00Z" }'Attaches a revenue event to the visitor’s most recent event (last 30 days) when visitor_id is given. ts is optional and must be within 7 days of now. email is never stored, only a SHA-256 hash of the lower-cased address (props.emailHash) so you can de-duplicate. Same auth and error shape as /api/track; success is 200 { "ok": true, "attributed": true|false }.
How attribution works
Every event carries the referrer and UTM parameters of the visit it happened in, plus the visitor’s country, device, OS and browser. The Insights page sums revenue, counts buyers and computes conversion rate by each of those dimensions.
Because visitor IDs rotate daily, attribution is scoped to the day the revenue event happened: a visitor who arrived from a campaign last week and paid today is, today, a direct visitor unless your backend passes the original landing URL with the revenue event. That is the trade-off for having no persistent identifier.