What is Lemon Squeezy revenue attribution?
It is the practice of crediting each Lemon Squeezy order to the marketing touches that came before it. Lemon Squeezy knows the money and the buyer. Your analytics knows the visit and the source. Attribution joins the two so you can see revenue by channel instead of traffic by channel.
Lemon Squeezy is a merchant of record, which means it owns the checkout and the tax. That is convenient, and it is also why the order record has no referrer, no UTM tags and no landing page in it. The buyer arrived on your site, clicked through to a hosted checkout on another domain and paid there. Unless something carries the visitor across that hop, the trail ends at your site.
The good news is that Lemon Squeezy has a purpose-built mechanism for exactly this, and it is the one Statsy uses.
How does Statsy connect Lemon Squeezy orders to visits?
Custom data carries the visitor across the checkout hop. Lemon Squeezy documents that data passed into a checkout comes back inside the meta field of order and subscription webhooks, so the order arrives already carrying the anonymous visitor identifier that made it.
Custom data through checkout
Lemon Squeezy’s passing custom data documentation describes sending your own identifier through a checkout so that it comes back on the webhook. Statsy uses the key statsy_vid. On a link to a hosted Lemon Squeezy checkout, the script appends checkout[custom][statsy_vid] automatically for visitors tracked in Full mode, so most sites need no code changes.
The signed webhook
Lemon Squeezy signs each webhook with an HMAC of the raw request body, using the signing secret you set when creating the webhook, and sends it in the X-Signature header. Statsy recomputes that HMAC and compares the two in constant time before anything is recorded.
Five events are used. order_created records a one-time order, subscription_payment_success records a renewal, order_refunded records a refund as a negative amount, and subscription_cancelled or subscription_expired marks the customer as churned. Each is stored once per event and order id, so retries never double count.
How do you set it up?
Add the script, create one webhook in your Lemon Squeezy store, paste the signing secret into Statsy, and tag your campaign links. If your buy buttons link to hosted Lemon Squeezy checkouts, that is the whole job; the visitor identifier is appended for you when the link is clicked.
- Add the Statsy script, about 3 KB gzipped, to every page of your site.
- In the site’s integrations, choose Lemon Squeezy and copy the webhook URL. In your Lemon Squeezy store settings, create a webhook with that URL, subscribe it to the five events above, and set a signing secret.
- Paste the signing secret back into Statsy. It is encrypted at rest and never shown again.
- For checkouts you create through the Lemon Squeezy API, read
statsy.visitorId()in the browser and pass it ascheckout_data.custom.statsy_vid. - Tag campaign links with UTM parameters, for example
utm_source=newsletter&utm_campaign=launch. Referrers need no tagging.
Lemon Squeezy references, checked September 2026: webhooks, signing requests and passing custom data.
What do the reports show once orders arrive?
Revenue, customers, conversions, refunds, net revenue and revenue per customer by channel, source, campaign, referrer, landing page and individual post. You choose the attribution model and lookback window, and the same figures are available through the REST API, the CLI and the MCP server.
| Breakdown | What it answers |
|---|---|
| Channel and source | Which categories and specific sources produced paying customers |
| Campaign | Which tagged campaign earned the money, with refunds subtracted |
| Landing page | Which entry page tends to start a buyer’s journey |
| 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 | One customer’s touches and orders in order, so you can check a model against reality |
Renewals matter here more than most tools admit. A digital product sold once looks very different from a subscription renewed for two years, and crediting only the first order flatters whatever channel happened to close it.
What will this not tell you?
Attribution is an estimate everywhere. Ad blockers, browser privacy features and consent choices all reduce what can be measured. Cookieless visitors cannot be linked across days, so their orders count toward revenue but reach a channel only through an email or customer id match.
- An order placed from a checkout link shared elsewhere, with no visit to your site first, has nothing to attribute.
- Statsy reads no ad spend, so it reports revenue and refunds but never return on ad spend.
- Tax and fees are Lemon Squeezy’s business; Statsy records the order total as the webhook reports it.
- Models are rules, not proof of cause. Compare two models and open a few real journeys before you move budget.
How do you try it on your own store?
Start the trial, add the script, create the webhook and let a day of traffic run. On a store with real sales the first attributed order usually appears within a day. Everything is on during the trial, including session replays, heatmaps, funnels and the live visitor globe.
The trial runs 14 days with every feature enabled. A card is required at sign-up, nothing is charged until the trial ends, and plans start at $9 a month priced by monthly events. Cancel in one click at any time; analytics data is deleted 30 days after a cancellation. See pricing, or read how credit is split on marketing attribution software. Selling through Stripe as well? See Stripe revenue attribution.