Lead attribution · Stripe
Stripe payment attribution: every paid Checkout, beside the pages before it
Stripe payment attribution in Skald takes Stripe's signed webhook for each paid Checkout, and joins it to the buyer's journey through the visitor ID you set on the Checkout Session.
Stripe payment attribution is tying each Stripe payment to the source and pages that led to it. Skald counts a paid Stripe Checkout from Stripe's signed webhook, reads the visitor ID from the session's client_reference_id or metadata, and never reads customer details.
30-day free trial · no card · we set it up within one working day · free to self-host
{"object": "event", "type": "checkout.session.completed", "created": 1792843200, "data": {"object": { "id": "cs_test_Sample7Kq2", "payment_status": "paid", "client_reference_id": "skv_Q2xhc3NpY0V4YW1wbGVJRA", "metadata": {"utm_source": "google", "utm_medium": "cpc"}, "amount_total": …, "currency": "…", "customer": "cus_…", "customer_details": {"email": "buyer@example.com", "name": "…"}, "payment_intent": "pi_…" }}}
- kept
- Payments · paid ·
cs_test_Sample7Kq2 - joins
- visitor
skv_Q2xh…, last touch google / cpc - never read
- amount, currency, customer, email
A sample event, shortened. Green lines are read; grey lines are never read or kept.
[01] paid now, or paid later
A bank debit pays after the Checkout ends. Skald waits for Stripe to say so.
A webhook is a message Stripe sends to an address you give it the moment something happens, here a Checkout. Two Checkout events, three cases. A card pays at once. A bank debit finishes the Checkout unpaid, so Skald records a payment started, and the payment itself only when Stripe sends async_payment_succeeded for the same session. Each lands as its own stage in lead attribution.
one session · cs_test_Sample7Kq2 · sample
- Mon 10:04
checkout.session.completed · payment_status "paid"paid · paid - Thu 08:12
nothing more to wait for·
Payments: 1, on Monday. The card paid when the Checkout ended.
Sample session. Each stage is kept once per session id, so a message Stripe sends twice is a repeat, never a second payment.
[02] the signature, part by part
Rolling your Stripe signing secret without losing a payment
The signing secret is a code only Stripe and Skald hold. Stripe signs each message with a time and one or more v1 values, each a check code made from the message and a secret. While you roll a secret, Stripe can sign with the old and the new one. Skald takes the message when any v1 matches the secret it holds, and the time is within 5 minutes of its own clock. Move the clock and swap the secret.
Stripe-Signature: t=1792843200,v1=5f1c9a…new secret,v1=a93e07…old secret
200 The new v1 matches, and the time is 1 minute off. Taken.
Sample header. A Stripe signing secret starts with whsec_; Skald refuses to save one that does not, which is how a pasted API key is caught.
[03] payment to journey
Which pages led to this Stripe payment? Hand the visitor ID along.
Stripe never sees your pages. Your page knows the anonymous visitor ID as skald('id'); your server puts it on the Checkout Session it creates; Stripe sends it back in the webhook. Follow one ID, hop by hop.
const vid = skald('id');
// on: "skv_Q2xhc3NpY0V4YW1wbGVJRA"
// off: null
The page asks the script tag for its visitor ID and sends it with the Buy button's request to your server.
journey joined The payment is listed with the source and pages before it.
Sample code, shortened. Visitor IDs are off by default. With them off, skald('id') gives nothing, and an ID that arrives anyway is dropped before anything is kept. The payment still counts.
[04] payments sit beside leads
A lead that pays is still one lead. The payment is counted beside it.
A lead is a form sent or a demo booked. A Stripe payment is counted on its own, in Payments, so a buyer who signed up first never becomes two leads. Pick what one sample visitor did.
pick a visitor
A payment with no form and no booking. Leads stay at 0.
Sample visitor. Counted as Skald shows them with Count from: Tools.
[05] set up and limits
Set up Stripe payment attribution in five steps
Each step is in Stripe or in Skald's Stripe box. A test event at the end shows it works.
- In Stripe, go to Developers › Webhooks › Add endpoint.
- Paste the address from Skald's Stripe box (Settings › This site › Integrations) as the Endpoint URL.
- Choose the events
checkout.session.completedandcheckout.session.async_payment_succeeded, and save. - Reveal the endpoint's Signing secret, which starts with
whsec_. - In Skald's Stripe box, paste it into Paste the signing secret from Stripe and press Save secret. Then Send a test event.
What it does not do
- Skald reads that a Checkout was paid, never how much: no amounts, revenue or currency.
- Only the two Checkout events above count. Refunds, invoices, subscriptions and renewals are left out.
- A failed bank debit leaves the payment at started.
- The secret is Stripe's: you paste the endpoint's own.
- Your server sets the visitor ID on the session; the script tag stops at your page.
- Journeys need visitor IDs, which are off by default. The payment counts either way.
- Customer details are never read.
keep reading
More on Stripe payment attribution
questions
Stripe payment attribution FAQ
Straight answers, including what Skald does not do.
Which Stripe events does Skald use?
Two: checkout.session.completed and checkout.session.async_payment_succeeded. A paid Checkout counts as a Payment. A Checkout paid by a delayed method counts as started first, then paid when Stripe says the payment succeeded.
How does a Stripe payment join the buyer's journey?
Set the visitor ID as the Checkout Session's client_reference_id, or as metadata.skv, when you create the session. The page knows the ID as skald('id'). Skald reads it back from the webhook. This needs visitor IDs on for the site.
Does Skald read customer details from Stripe?
Never. Skald reads the event, the session's id, its payment status, the visitor ID and any utm_ fields in its metadata. Customer details are never read, and IP addresses, browser strings and phone numbers are always dropped.
Is a Stripe payment counted as a lead?
It is counted as a payment. A lead is a form sent or a demo booked. Payments are counted on their own, so a lead that later pays is still one lead, and its payment is shown beside it.
Where is the Stripe signing secret?
In Stripe, open the webhook endpoint and reveal its Signing secret, which starts with whsec_. Skald cannot make one for Stripe. If Skald says a Stripe signing secret starts with whsec_, you copied something else, such as an API key.
What if Stripe sends the same event twice?
Nothing is counted twice. Skald keeps each conversion once per tool, reference and stage, answers a repeat with OK, and shows it as "already had it" in the delivery log.
$ tail -f access.log | skald
See what AI does with your site. Free for 30 days.
No card. We set up hosted Skald for you within one working day, or you self-host it free. Every line of your log, sorted and added up.