Conversion tracking

Report explicit actions after a LinkDevi redirect. A recorded event is a report from your application, not payment verification.

1. Enable a destination you control

In Conversion settings, an owner or admin on a paid workspace registers an exact HTTPS origin, such as https://shop.example.com. Confirming enables a signed _ldc query parameter on workspace links whose final HTTP redirect destination matches that origin. Different subdomains or ports need their own entry. Existing URL parameters and fragments are retained. Tracking is off by default.

Configuration caches expire within 30 seconds. Disabling a destination immediately blocks new ingestion, including receipts already issued. If configuration or signing is unavailable, the normal redirect continues without a receipt. Share/countdown/cloaked intermediary pages and crawler preview paths do not issue receipts in this release.

2. Capture the receipt on your site

After obtaining any consent your website requires, load the snippet shown in settings. The site ID is public. Never put an API key in browser code or the script URL. The old /api/pixel?key= integration returns 410 without reflecting the key.

The SDK captures the signed URL receipt into sessionStorage on your own origin and removes _ldc from the current URL. It never reads another domain’s cookie and does not automatically record a conversion. Storage is best effort. The latest matching receipt in that site/session is used, with a fixed 30-minute window from the redirect; another visit does not extend an old receipt. Navigating to another origin or closing the session can lose attribution. A browser may block scripts, storage or requests.

3. Report the actual action

Call only after your application observes the action, using a stable UUID for that action. Keep this UUID for retries; do not generate a new one on every attempt. Wait for the deferred script to load before calling.

await window.LinkDeviTracking.track({
  type: "signup",
  eventId: "YOUR_STABLE_UUID"
});

Browser types: conversion, signup, lead, download, custom. Browser requests cannot include value, currency, purchase or refund. Responses identify them as browser_reported. Failed requests remain retryable using the same eventId; the SDK never marks a failed action as delivered. clear() clears the stored receipt; stop loading/calling the script when consent is withdrawn.

Server reporting and retries

POST /api/conv uses a private Bearer API key with conversions:write. Keep it on your server. Read the captured receipt with window.LinkDeviTracking.receipt() and send it to your own authenticated backend. Do not accept a browser-supplied purchase value as a verified payment. Send receipt, event_id, type and optional nonnegative value, currency and metadata. A signed receipt avoids waiting for ClickHouse ingestion. A receipt with the wrong workspace, expired signature or disabled destination is rejected. If also supplied, click_id must match the receipt.

{
  "receipt": "SIGNED_RECEIPT_FROM_YOUR_APPLICATION",
  "event_id": "YOUR_STABLE_EVENT_ID",
  "type": "purchase",
  "value": 199,
  "currency": "THB"
}

Same event ID and normalized payload: 200 with the original conversionId and replayed:true. First write: 201. Reusing an ID for different data: 409. Server and browser event IDs have separate namespaces; they are separate reports and are not automatically reconciled into a single sale. No automatic refund, settlement, currency conversion or payment verification is performed. Even server_reported is not proof of payment.

Legacy click_id-only requests remain supported and deduplicate atomically per click. ClickHouse may not yet have ingested that click, in which case retry the 404 later. With no event_id, an existing conversion for the click returns 409. New integrations should send a signed receipt plus stable event_id. The maximum request body is 16 KiB.

Bounds and records

Up to ten configured origins per workspace, including disabled entries. Browser admission: 100 requests per minute per site and 30 per IP. All channels share a protective ceiling of 100,000 new records per workspace per UTC calendar month; replays do not consume new slots. API calls also follow the workspace/key API allowance. When admission is unavailable, recording returns 503 and normal redirects continue.

Settings show the latest 20 records. GET /api/v1/conversions requires analytics:read and returns paginated records, evidenceSource and attributionMethod. createdAt is server receipt time, not purchase time. Legacy records remain labelled legacy. Never sum different currencies or call reported counts verified revenue. Workspace roles and API scope remain separate.

Each newly committed conversion can emit one link.conversion event through the durable webhook outbox, including evidenceSource and attributionMethod. An idempotent replay emits none. Receivers still deduplicate webhook event IDs because delivery is at least once. Removing a destination retains historical records and prevents old receipts from being accepted for that removed site ID.

API guide