Blog · Guide

Which source made money?

A Stripe payment reaches Highseat through a webhook, often days after the visit. One id passed to your checkout joins the two.

Piotr Kulpinski

· 2 min read

All posts

Most analytics tools stop counting at the signup. The money arrives later, in Stripe, and the two never meet. Highseat records each payment against the visit that led to it, so every breakdown can show revenue beside visitors.

The attribution id

The tracker gives every visit an attribution id. getAttributionId() resolves to it, and your checkout passes it to Stripe as attribution_id metadata.

checkout.ts
import { getAttributionId } from "highseat"const attributionId = await getAttributionId()await createCheckout({ metadata: { attribution_id: attributionId } })

When the buyer signs in first

A buyer who visits on Monday and pays on Friday looks like two visitors. identify() links both visits to one user id from your own system, so the payment still finds its source. Most sites pass the signed-in user's id to the component instead, and the package calls identify() each time it changes.

app/layout.tsx
import { Highseat } from "highseat/next"<Highseat site="site_…" userId={user?.id ?? null} />

What the dashboard shows

Revenue appears on every breakdown, net of refunds, so a source that sends few visitors but many buyers stands out. A refund comes off the sale it belongs to.

A site's dashboard over the last 30 days: visitors, sessions, views and revenue, with Pages and Sources each showing a revenue column beside their visitors.
Revenue sits beside visitors in every breakdown.

Setting it up

  1. Connect Stripe or Polar under Revenue in your site's settings.
  2. Pass the attribution id to every checkout you create.
  3. Identify signed-in users, through userId or useIdentify().

With a provider connected, send purchase from the page without revenue. The webhook already records the money, and sending both counts the sale twice. The payment provider guide walks through each provider's webhook.

Start with 14 days free.No card required.