What is Stripe revenue attribution?
Stripe revenue attribution is the practice of crediting each Stripe payment to the marketing touches that came before it. Stripe knows the money and nothing about the visit. Your analytics knows the visit and nothing about the money. Attribution is the join between the two.
The Stripe dashboard answers “how much did we make?” perfectly well. It cannot answer “was that from the launch post or from search?”, because a Stripe payment carries no referrer, no UTM tags and no landing page. Most teams bridge that gap with a tag manager and an ecommerce event schema, which works until a refund arrives, a subscription renews, or someone pays from a link in an email client that strips parameters.
Doing it properly needs three things:
- A record of where each visitor came from, every time they arrive.
- A trustworthy record of each payment, including renewals and refunds.
- A reliable way to link the two, and a rule for splitting the credit.
How does Statsy connect Stripe payments to visits?
The script stores every visit that has a source as a touch. Checkout links carry the visitor’s anonymous identifier through to Stripe. When Stripe confirms the charge with a signed webhook, Statsy verifies the signature, matches the payment to that visitor and credits the touches before it.
The webhook
Stripe signs every event with a Stripe-Signature header containing a timestamp and an HMAC-SHA256 signature of the raw body, computed with your endpoint’s whsec_ secret. Statsy verifies both, and rejects anything outside a five-minute tolerance, which is what Stripe recommends against replay attacks.
Four event types are used. checkout.session.completed records a one-time payment, invoice.paid records a subscription renewal, charge.refunded records a refund as a negative amount, and customer.subscription.deleted marks the customer as churned. Each payment is stored once per Stripe event id, so Stripe’s automatic retries never double count.
The match
Stripe documents client_reference_id on a Checkout Session as “a unique string to reference the Checkout Session… used to reconcile the Session with your internal systems”, which is exactly what it is used for here. Statsy looks for the visitor identifier there first, then in metadata.statsy_vid, then falls back to the email address on the payment, then to a known customer id.
A payment that matches none of those still counts toward total revenue. It simply is not credited to a channel, and the reports say so rather than guessing.
How do you set up Stripe revenue attribution?
Three steps, and the middle one is copy and paste. Add the Statsy script to every page, connect Stripe by pasting a webhook URL into Stripe and its signing secret back into Statsy, then tag your campaign links. Hosted Stripe checkout links need no code change at all.
- Add the Statsy script, about 3 KB gzipped, to every page of your site.
- In the site’s integrations, choose Stripe. Copy the webhook URL into Stripe’s Webhooks settings, subscribe it to the four event types above, and paste the
whsec_signing secret back into Statsy. - For Payment Links and hosted Checkout links placed on your site, nothing else is needed: the script appends the visitor identifier for visitors in Full mode.
- For Checkout Sessions created on your own server, pass
statsy.visitorId()from the browser and set it asclient_reference_idormetadata.statsy_vidwhen you create the session. - Tag campaign links with UTM parameters, for example
utm_source=newsletter&utm_campaign=launch. Referrers are recognised without any tagging.
Stripe references, checked September 2026: receiving webhook events and the Checkout Session object.
What do the reports actually show?
Revenue, customers, conversions, refunds, net revenue and revenue per customer, broken down by channel, source, campaign, referrer, landing page and individual post. You pick the attribution model and the lookback window, and the same numbers are available through the API, CLI and MCP server.
| Breakdown | What it answers |
|---|---|
| Channel and source | Which categories and specific sources produced paying customers, not just visits |
| Campaign | Which tagged campaign earned the money, with refunds subtracted |
| Landing page | Which entry page tends to be the first step for buyers |
| Posts | Which exact post on X or LinkedIn sent visits, sign-ups and revenue, via its t.co or lnkd.in short link |
| Search queries | Which Google queries earn, when Search Console is connected |
| Visitor journeys | The ordered touches and payments for one customer, so you can sanity-check the model |
If you also want to watch what those buyers did on the page, session replays can be filtered to sessions that paid, and heatmaps can switch from clicks to revenue. That side of the product is covered on the Hotjar alternative page.
What are the limits of Stripe attribution?
Attribution is an estimate, here and everywhere else. Ad blockers, privacy settings and consent choices all reduce what can be measured. Cookieless visitors cannot be linked across days, so their payments count toward revenue but reach a channel only through an email or customer id match.
- Payments made in a mobile app or by invoice outside the website have no visit to attribute unless the customer is matched by email.
- Direct visits earn credit only when the buyer had no other source inside the lookback window, so returning customers do not erase the campaign that found them.
- Statsy reads no ad spend, so it reports revenue but never return on ad spend.
- Models are rules, not proof of cause. Compare two models and open a few real journeys before moving budget.
How do you try it on your own Stripe account?
Start the free trial, add the script, paste the Stripe webhook URL and signing secret, and let a day of traffic run. The first attributed payment usually lands within a day on a site with real sales. Everything is on during the trial, including replays and heatmaps.
The trial runs for 14 days with every feature enabled. A card is required at sign-up and nothing is charged until the trial ends; plans start at $9 a month and are priced by monthly events, so a small site stays small on the bill. Cancel in one click at any time, and analytics data is deleted 30 days after a cancellation. See pricing or read how the models split credit on marketing attribution software.