# Lemon Squeezy revenue attribution: which channel, page and post earned each order

> How to attribute Lemon Squeezy orders to marketing channels: signed webhooks, custom data through checkout, and revenue by source, campaign, page and post.

Canonical page: https://statsy.co/lemon-squeezy-revenue-attribution  
Last updated: 15 September 2026

Lemon Squeezy tells you what you sold and handles the tax. It does not tell you which post, search or newsletter produced the order. Statsy fills that gap: a small script records where each visitor came from, a signed Lemon Squeezy webhook reports each order, and the two are joined so revenue appears next to the channel that earned it.

## Lemon Squeezy revenue attribution in Statsy

- **How orders arrive:** A signed store webhook, verified from the `X-Signature` header with your signing secret
- **Events used:** order_created, subscription_payment_success for renewals, order_refunded, subscription_cancelled and subscription_expired
- **How an order is matched:** The visitor id in `checkout[custom][statsy_vid]`, then the buyer’s email, then the customer id
- **Models:** Last touch, first touch, linear, time decay and position based, with a 1 to 365 day lookback
- **What you get:** Revenue, customers, conversions, refunds and net revenue by source, campaign, referrer, landing page and post
- **Price:** From $9 a month after a 14-day free trial. A card is required; cancel any time.

## 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](https://docs.lemonsqueezy.com/help/checkout/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](https://docs.lemonsqueezy.com/help/webhooks/signing-requests). 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.

1. Add the Statsy script, about 3 KB gzipped, to every page of your site.
2. 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.
3. Paste the signing secret back into Statsy. It is encrypted at rest and never shown again.
4. For checkouts you create through the Lemon Squeezy API, read `statsy.visitorId()` in the browser and pass it as `checkout_data.custom.statsy_vid`.
5. 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](https://docs.lemonsqueezy.com/help/webhooks), [signing requests](https://docs.lemonsqueezy.com/help/webhooks/signing-requests) and [passing custom data](https://docs.lemonsqueezy.com/help/checkout/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](https://statsy.co/pricing), or read how credit is split on [marketing attribution software](https://statsy.co/marketing-attribution-software). Selling through Stripe as well? See [Stripe revenue attribution](https://statsy.co/stripe-revenue-attribution).

## Lemon Squeezy revenue attribution FAQ

### Do I need to change my buy buttons?

Usually not. If a button links to a hosted Lemon Squeezy checkout, the script appends the visitor identifier as custom data when it is clicked, for visitors tracked in Full mode. API-created checkouts need one field.

### Does Statsy need my Lemon Squeezy API key?

No. Statsy only receives webhooks and verifies them against the signing secret you paste in. It cannot read your store, change products or issue refunds, because it never holds an API key.

### Are subscription renewals counted?

Yes. A subscription_payment_success event with a renewal billing reason is recorded as revenue and credited to the same customer, so long-lived subscriptions do not disappear after the first order.

### What happens when an order is refunded?

The order_refunded event is recorded as a negative amount, which reduces net revenue for the channel that was originally credited. Nothing is deleted, so gross revenue and refunds stay visible separately.

### Can I use Lemon Squeezy and Stripe together?

Yes. A site can connect several providers at once, and payments from all of them land in the same revenue reports. Each provider gets its own webhook URL and its own signing secret.

### Does this work without cookies?

Partly. Cookieless visitors are counted and their orders count toward total revenue, but crediting a channel then needs a match by email or customer id, since cookieless visits are not linked across days.

---

Statsy (https://statsy.co) · Contact: support@statsy.co
