Lemon Squeezy shows you every order. It doesn't show you which post, search or newsletter sent the customer. To see that, a visitor id from your website analytics has to ride along with the checkout and come back with the order.
If your store still sells through Lemon Squeezy, the months it has left are worth tracking: they show which channels to keep paying for after you switch.
The quick answer
To attribute Lemon Squeezy revenue to traffic sources until 31 March 2027:
- Record each visit and its source with an analytics script on every page.
- Carry the visitor id into checkout as custom data:
checkout[custom][supr_visitor_id]on checkout links, orcheckout_data.customthrough the API. - Add a Lemon Squeezy webhook for
order_created,subscription_payment_success,order_refundedandsubscription_payment_refunded. - Each paid order is matched to the visitor, and your attribution model picks which of their visits gets the credit.
- When you migrate, connect the new provider on the same website. Lemon Squeezy payments already recorded stay.
Lemon Squeezy's shutdown: the dates that matter
Stripe bought Lemon Squeezy in July 2024 (TechCrunch), and Lemon Squeezy is now closing. Its announcement and its migration guide give these dates (Lemon Squeezy: saying goodbye (Lemon Squeezy documentation, opens in a new tab), Lemon Squeezy: migration (Lemon Squeezy documentation, opens in a new tab)):
| Date | What happens |
|---|---|
| 16 November 2026 | What happens: New store sign-ups closed. Existing stores keep selling. |
| 2 December 2026 | What happens: Migration tooling for Stripe Managed Payments, Stripe's merchant of record product, becomes available. |
| Mid-January 2027 | What happens: The latest Lemon Squeezy suggests starting a migration. It says the whole process can take up to 8 weeks. |
| 31 March 2027 | What happens: Lemon Squeezy stops processing transactions, subscription renewals included. |
Lemon Squeezy's tooling moves eligible subscriptions to Stripe; PayPal subscriptions can't move, and Managed Payments has no storefronts, file delivery, license keys or affiliates. Until the end date, webhooks keep arriving and SuprAnalytics records them as before.
Why Lemon Squeezy alone can't tell you where customers came from
Lemon Squeezy knows the order: the product, the subtotal, tax and total, the customer and their email, and the subscription it started. It also keeps custom data, any fields you pass with the checkout, and returns them in the webhook's meta.custom_data (Lemon Squeezy: passing custom data (Lemon Squeezy documentation, opens in a new tab)).
What it can't see is the visit before the checkout. If a customer read your post on Reddit, came back two days later through Google and clicked the same buy button, the order looks the same either way. The referrer, the landing page and the earlier visits live in your website analytics, which has never seen the order. Joining the two needs an id both sides share, and custom data is where it goes.
Step 1: Track website visitors and their sources
Add the SuprAnalytics script to the <head> of every page (installation guides). Each visit then records its referrer, its UTM tags, its landing page and a visitor id kept in a first-party cookie for a year. A visit with no referrer and no tags counts as Direct. The tracking parameters guide lists the tags it reads, and the Stripe guide explains sources and sessions in more depth.
Step 2: Carry the visitor into Lemon Squeezy checkout
Checkout links: a small snippet
A Lemon Squeezy checkout link accepts custom data as checkout[custom][…] query parameters, such as ?checkout[custom][user_id]=123. Unlike Polar, Dodo Payments and Paddle checkouts, the SuprAnalytics script doesn't change Lemon Squeezy links by itself, so add this after the script. When a visitor clicks a link to .lemonsqueezy.com/checkout, it sets checkout[custom][supr_visitor_id] to their visitor id.
<script>
document.addEventListener("click", function (e) {
var link = e.target.closest && e.target.closest('a[href*=".lemonsqueezy.com/checkout"]');
if (!link || !window.supr || !window.supr.visitorId) return;
var url = new URL(link.href);
url.searchParams.set("checkout[custom][supr_visitor_id]", window.supr.visitorId());
link.href = url.toString();
}, true);
</script>Browser code with no keys in it. It sets the id at the click, so links added later are covered too. Optionally, also set checkout[custom][supr_session_id] from window.supr.sessionId() to credit the order to that exact visit.
Checkouts created with the API: checkout_data.custom
If your server creates checkouts with POST /v1/checkouts, read the supr_visitor_id cookie from the request and put it in checkout_data.custom.supr_visitor_id, with supr_session_id beside it if you like. Your API key stays on the server. See the Lemon Squeezy setup guide.
When there's no id: customer id and email
An order without a visitor id still counts. SuprAnalytics then looks for the Lemon Squeezy customer id on an earlier payment that was matched, then a visitor with the same email, known from an earlier payment or from the identify call your app makes at sign-up. If nothing matches, the order is revenue without a source.
Step 3: Connect the Lemon Squeezy webhook
The connection is one webhook per website and a signing secret. There's no API key to share, and past orders aren't imported: orders are recorded from the moment the webhook is set up.
Copy your webhook URL
In SuprAnalytics, open the website's Settings → Revenue, pick Lemon Squeezy, and copy the URL. It looks like
https://supranalytics.app/api/webhooks/lemonsqueezy/YOUR_WEBSITE_ID.Add a webhook in Lemon Squeezy
In Lemon Squeezy, open Settings → Webhooks and add the URL (Lemon Squeezy: webhooks (Lemon Squeezy documentation, opens in a new tab)). The signing secret is yours to choose, usually a random string of 6 to 40 characters.
Select four events
Select
order_created,subscription_payment_success,order_refundedandsubscription_payment_refunded.Paste the same secret
Enter the same signing secret in Settings → Revenue with Lemon Squeezy selected, and click Connect.
| Lemon Squeezy event | What SuprAnalytics does |
|---|---|
order_created | What SuprAnalytics does: Records the order when its status is paid. Unpaid and free orders are skipped. |
subscription_payment_success | What SuprAnalytics does: Records a renewal when the invoice's billing reason is renewal. The initial payment is skipped, because the order already counts it, and so is updated, a charge for a plan change (Lemon Squeezy: subscription invoices (Lemon Squeezy documentation, opens in a new tab)). |
order_refunded | What SuprAnalytics does: Marks the order refunded. Lemon Squeezy sends it for a full or a partial refund (Lemon Squeezy: event types (Lemon Squeezy documentation, opens in a new tab)). |
subscription_payment_refunded | What SuprAnalytics does: Marks the renewal payment refunded. |
What happens on every delivery
- Signature check. Lemon Squeezy sends an HMAC-SHA256 hex digest of the body, keyed with your secret, in the
X-Signatureheader (Lemon Squeezy: signing requests (Lemon Squeezy documentation, opens in a new tab)). SuprAnalytics checks it against the secret you saved. A wrong secret is answered with 400 "Invalid signature" and nothing is recorded. - Retries. If your endpoint doesn't answer 200, Lemon Squeezy sends the event up to three more times, and you can resend recent webhooks by hand from the webhook settings (Lemon Squeezy: developer guide (Lemon Squeezy documentation, opens in a new tab)).
- Duplicates. Each order and each renewal is stored once, by its Lemon Squeezy id, so a delivery that arrives twice doesn't count twice.
Step 4: Test in Lemon Squeezy's test mode
Lemon Squeezy has a test mode (Lemon Squeezy documentation, opens in a new tab), where you can set up test webhooks and pay with test cards such as 4242 4242 4242 4242. Test there; never make a real purchase just to test attribution.
- In test mode, add a webhook for the test website's URL with the four events and a secret, and enter the same secret in that website's Settings → Revenue.
- Open your staging site in a fresh window with a tagged link, such as
?utm_source=test&utm_medium=email&utm_campaign=attribution_check. - Click your checkout link and pay with the test card.
- In Lemon Squeezy's webhook settings, open the recent deliveries. The
order_createddelivery should show status 200; where the response is shown, look for"attributed": true. - In SuprAnalytics, the payment appears in the visitor's journey and the Campaign report credits
attribution_check.
{
"received": true,
"result": { "visitorId": "…", "attributed": true, "duplicate": false }
}"attributed": false means the order was recorded without a source: check that the checkout carried the visitor id. A resent delivery answers "duplicate": true.


What Lemon Squeezy revenue SuprAnalytics counts
| Payment | How it's counted |
|---|---|
| Amount | How it's counted: The order's or invoice's total (Lemon Squeezy: the order object (Lemon Squeezy documentation, opens in a new tab)). Lemon Squeezy reports tax separately and SuprAnalytics doesn't take it off, so unlike its Polar, Paddle and Dodo Payments figures, Lemon Squeezy revenue can include tax. Other currencies are converted to your website's currency with daily rates. |
| First order | How it's counted: A paid order_created. Counts toward new customers, conversion rate and revenue. |
| Renewal | How it's counted: A subscription_payment_success with the billing reason renewal. Revenue, but not a new customer. Credited to the same visitor through the custom data the webhook carries, or the Lemon Squeezy customer id of an earlier matched payment. |
| Plan change charge | How it's counted: Not counted: the billing reason updated is skipped. |
| Unpaid or free order | How it's counted: Skipped: there's no revenue to attribute. |
| Full refund | How it's counted: Marks the payment refunded; it drops out of revenue. |
| Partial refund | How it's counted: Marks the whole payment refunded too. SuprAnalytics doesn't lower it by the refunded amount. |
So SuprAnalytics totals won't always match Lemon Squeezy's. Payment tracking also isn't subscription analytics: SuprAnalytics doesn't calculate MRR, ARR or churn. What it adds is where paying and renewing customers came from (subscription revenue).
Keep your attribution history when you migrate
Payments SuprAnalytics has recorded from Lemon Squeezy are stored in SuprAnalytics, on your website. Moving to another provider doesn't remove them, and neither does Lemon Squeezy closing.
| What | What happens |
|---|---|
| Lemon Squeezy payments already recorded | What happens: They stay, with their sources, in every report, journey, customer list and lifetime value. Reports read the payments of every provider together. |
| Disconnecting Lemon Squeezy | What happens: Forgets the signing secret only, so new Lemon Squeezy webhooks are refused. What is already recorded stays. |
| Orders from before the webhook | What happens: Never recorded, and not importable. Export them from Lemon Squeezy for your records. |
| The new provider | What happens: Connected on the same website, beside Lemon Squeezy: a website can record several providers at once, each with its own secret, so you can run both during the switch. |
| A customer who moves | What happens: Credited to the same visitor when the new provider's payment carries their visitor id, or its email matches a visitor SuprAnalytics already has from a matched Lemon Squeezy payment. The customer list then shows their payments from both providers as one customer. |
| The first charge on the new provider | What happens: Depending on how the new provider creates a moved subscription, its first charge can be recorded as a new payment rather than a renewal, so migrated subscribers may count as new customers that month. |
| Resetting the website's data | What happens: Deletes its payments too, with its visits. Don't reset a website to tidy up after migrating. |
A migration checklist
- Keep Lemon Squeezy connected until it stops. Renewals and refunds keep arriving until 31 March 2027, and they belong in the same history.
- Connect the new provider on the same website, in Settings → Revenue. Lemon Squeezy stays connected beside it. A new website would start with no history.
- Carry the visitor id into the new checkout, as in the table below, before the first customer pays there.
- Keep the customer's email on the new checkout. Without a visitor id, it's what links a moved customer to their Lemon Squeezy payments.
- Disconnect Lemon Squeezy after its last payment and refund. Recorded payments stay.
- Export your Lemon Squeezy data (customers, orders, subscriptions), as Lemon Squeezy recommends. SuprAnalytics doesn't import it.
| Provider | How the visitor id reaches checkout |
|---|---|
| Stripe | How the visitor id reaches checkout: Metadata on Checkout Sessions, or client_reference_id on Payment Links, which you add. How to track Stripe revenue |
| Polar | How the visitor id reaches checkout: Checkout links are tagged by the script; Checkout API sessions take it as metadata. How to track Polar revenue |
| Paddle | How the visitor id reaches checkout: Checkout buttons are tagged by the script; Paddle.Checkout.open() takes it as customData. How to track Paddle revenue |
| Dodo Payments | How the visitor id reaches checkout: Payment links are tagged by the script; checkout sessions take it as metadata. How to track Dodo Payments revenue |
| Anything else | How the visitor id reaches checkout: Send each payment from your server with the visitor id. Payment API |
First touch or last touch?
Each payment keeps two visits: the visitor's first visit ever and their last visit before paying. Last touch is the default and credits the visit that converted, even a direct one. First touch credits the visit that brought them in. Change it in Settings → Revenue → Attribution model; the switch re-credits past payments too, Lemon Squeezy's included. The first-touch vs last-touch guide works through examples.
Common Lemon Squeezy attribution problems
| Problem | Likely cause and fix |
|---|---|
| No Lemon Squeezy orders show up | Likely cause and fix: Open the webhook's recent deliveries in Lemon Squeezy. 400 "Lemon Squeezy is not configured for this website" means no secret is saved for that website; 400 "Invalid signature" means the two secrets differ, or test mode and live mode are mixed up. |
| Orders have no source | Likely cause and fix: The checkout carried no visitor id. Check that the snippet runs after the script on the page with the checkout link, or that your server sets checkout_data.custom, and identify signed-in users before checkout. |
| Too much Direct revenue | Likely cause and fix: Untagged links, apps that drop the referrer, or last touch crediting direct returns. Tag the links you share, or compare with first touch. |
| Revenue differs from Lemon Squeezy | Likely cause and fix: SuprAnalytics counts the order's total, skips plan-change charges and marks a partially refunded payment fully refunded. |
More on this: Lemon Squeezy revenue attribution · Lemon Squeezy setup guide · Renewals and refunds · How revenue attribution works · Pricing