LinkTrace docs

Install one script globally, then track business success from the backend

LinkTrace conversion tracking is server-side by design. The client script only persists click attribution. Your backend decides what counts as a lead or a sale.

Install the script once

Put the tracking script in your shared layout or document head. Do not scatter one-off copies across every page.

html
<script src="https://api.linktrace.cc/api/v1/track/client.js"></script>

Load it early. Avoid async for conversion-critical flows where a user can click a tracked short link and submit a form immediately afterward.

Form attribution

If you want hidden click ids on form submits, mark the form and let the script inject the field.

html
<form data-linktrace-track method="post" action="/signup">
  <input name="email" type="email" />
  <button type="submit">Create account</button>
</form>

Track leads and sales from your backend

Once your app confirms success, call the Node SDK or send an authenticated HTTP request.

bash
npm install @finndean/linktrace-node
ts
import { LinkTrace, withFormAttribution, fromExpressRequest } from "@finndean/linktrace-node"

const linktrace = new LinkTrace({
  apiKey: process.env.LINKTRACE_API_KEY!,
})

await linktrace.trackLead(
  withFormAttribution(fromExpressRequest(req), req.body, {
    eventName: "signup",
    email: req.body.email,
    customerId: user.id,
  }),
)

Attribution model

LinkTrace does not define success for your product. Your application does.

  • A tracked redirect can create an lt_click_id.
  • That click id can be attached directly to a lead or sale payload.
  • Sales can also fall back to the most recent attributed lead in the same workspace by customerId or email.
  • The dashboard can then report click → lead, click → sale, and click → lead → sale using the same attribution chain.
Related guides