How-to

How to Track Lemon Squeezy Revenue by Traffic Source (and Keep It When You Migrate)

Connect Lemon Squeezy orders and renewals to the visits, sources and UTM campaigns behind them while Lemon Squeezy still takes payments, and keep that history when you move to another provider.

Last reviewed 13 min readBy the SuprAnalytics team at SuprApps

Lemon Squeezy is winding down. It closed new store sign-ups on 16 November 2026 and stops processing payments, subscription renewals included, on 31 March 2027. It suggests starting your migration by mid-January 2027, and points merchants to Stripe Managed Payments (Lemon Squeezy: saying goodbye (Lemon Squeezy documentation, opens in a new tab), migration guide (Lemon Squeezy documentation, opens in a new tab)). This guide covers tracking for existing stores until then, and keeping your attribution history when you move.

Illustration: a Lemon Squeezy checkout link carrying the visitor id as custom data, a visit from X and a $19 order credited to X, and the same visitor kept when payments move to another provider before 31 March 2027

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:

  1. Record each visit and its source with an analytics script on every page.
  2. Carry the visitor id into checkout as custom data: checkout[custom][supr_visitor_id] on checkout links, or checkout_data.custom through the API.
  3. Add a Lemon Squeezy webhook for order_created, subscription_payment_success, order_refunded and subscription_payment_refunded.
  4. Each paid order is matched to the visitor, and your attribution model picks which of their visits gets the credit.
  5. 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)):

Lemon Squeezy's wind-down dates
16 November 2026What happens: New store sign-ups closed. Existing stores keep selling.
2 December 2026What happens: Migration tooling for Stripe Managed Payments, Stripe's merchant of record product, becomes available.
Mid-January 2027What happens: The latest Lemon Squeezy suggests starting a migration. It says the whole process can take up to 8 weeks.
31 March 2027What 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.

From the SuprAnalytics Lemon Squeezy guide
<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.

  1. 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.

  2. 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.

  3. Select four events

    Select order_created, subscription_payment_success, order_refunded and subscription_payment_refunded.

  4. Paste the same secret

    Enter the same signing secret in Settings → Revenue with Lemon Squeezy selected, and click Connect.

The Lemon Squeezy events SuprAnalytics handles
order_createdWhat SuprAnalytics does: Records the order when its status is paid. Unpaid and free orders are skipped.
subscription_payment_successWhat 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_refundedWhat 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_refundedWhat SuprAnalytics does: Marks the renewal payment refunded.

What happens on every delivery

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.

  1. 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.
  2. Open your staging site in a fresh window with a tagged link, such as ?utm_source=test&utm_medium=email&utm_campaign=attribution_check.
  3. Click your checkout link and pay with the test card.
  4. In Lemon Squeezy's webhook settings, open the recent deliveries. The order_created delivery should show status 200; where the response is shown, look for "attributed": true.
  5. In SuprAnalytics, the payment appears in the visitor's journey and the Campaign report credits attribution_check.
The response SuprAnalytics sends Lemon Squeezy for a recorded, matched order
{
  "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.

The Referrer report of the demo website sorted by revenue, on a phone.
Revenue by referrer, with payments from several providers combined.

What Lemon Squeezy revenue SuprAnalytics counts

How SuprAnalytics counts Lemon Squeezy orders and subscription payments
AmountHow 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 orderHow it's counted: A paid order_created. Counts toward new customers, conversion rate and revenue.
RenewalHow 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 chargeHow it's counted: Not counted: the billing reason updated is skipped.
Unpaid or free orderHow it's counted: Skipped: there's no revenue to attribute.
Full refundHow it's counted: Marks the payment refunded; it drops out of revenue.
Partial refundHow 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 happens to Lemon Squeezy attribution in SuprAnalytics when you move to another provider
Lemon Squeezy payments already recordedWhat 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 SqueezyWhat happens: Forgets the signing secret only, so new Lemon Squeezy webhooks are refused. What is already recorded stays.
Orders from before the webhookWhat happens: Never recorded, and not importable. Export them from Lemon Squeezy for your records.
The new providerWhat 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 movesWhat 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 providerWhat 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 dataWhat happens: Deletes its payments too, with its visits. Don't reset a website to tidy up after migrating.

A migration checklist

  1. Keep Lemon Squeezy connected until it stops. Renewals and refunds keep arriving until 31 March 2027, and they belong in the same history.
  2. 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.
  3. Carry the visitor id into the new checkout, as in the table below, before the first customer pays there.
  4. 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.
  5. Disconnect Lemon Squeezy after its last payment and refund. Recorded payments stay.
  6. Export your Lemon Squeezy data (customers, orders, subscriptions), as Lemon Squeezy recommends. SuprAnalytics doesn't import it.
How the visitor id reaches checkout with each provider SuprAnalytics supports
StripeHow the visitor id reaches checkout: Metadata on Checkout Sessions, or client_reference_id on Payment Links, which you add. How to track Stripe revenue
PolarHow the visitor id reaches checkout: Checkout links are tagged by the script; Checkout API sessions take it as metadata. How to track Polar revenue
PaddleHow 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 PaymentsHow 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 elseHow 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

Common Lemon Squeezy attribution problems, what causes them and what to do
No Lemon Squeezy orders show upLikely 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 sourceLikely 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 revenueLikely 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 SqueezyLikely 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

Frequently asked questions

Is Lemon Squeezy shutting down?

Yes. Lemon Squeezy closed new store sign-ups on 16 November 2026 and stops processing payments, subscription renewals included, on 31 March 2027. It suggests starting a migration no later than mid-January 2027 and points merchants to Stripe Managed Payments.

Can I still track Lemon Squeezy revenue by traffic source until then?

Yes. Existing stores keep taking payments, and sending webhooks, until 31 March 2027. Put the visitor id in the checkout's custom data and connect the webhook, and each order and renewal is credited to the visit that brought the customer.

Does the SuprAnalytics script tag Lemon Squeezy checkout links by itself?

No. It tags Polar, Dodo Payments and Paddle checkouts only. Add the snippet from the setup guide, which sets checkout[custom][supr_visitor_id] on click, or put supr_visitor_id in checkout_data.custom when your server creates checkouts with the API.

Which Lemon Squeezy webhook events do I need?

order_created, subscription_payment_success, order_refunded and subscription_payment_refunded, with a signing secret you choose, sent to your website's webhook URL.

What happens to my Lemon Squeezy revenue in SuprAnalytics after I migrate?

It stays. Payments are stored in SuprAnalytics, not read from Lemon Squeezy, so they keep their sources in every report, journey and lifetime value. Disconnecting Lemon Squeezy only forgets its signing secret. Only resetting the website's data or deleting the website removes recorded payments.

Will customers who move to my new provider keep their traffic source?

When the new provider's payment carries the SuprAnalytics visitor id, or its email matches a visitor SuprAnalytics already knows, it is credited to the same visitor, and their payments from both providers belong to one customer. Without either, it counts without a source.

Does SuprAnalytics support Stripe Managed Payments?

It hasn't been tested, so this guide doesn't say it works. SuprAnalytics supports Stripe through Stripe's webhooks, as well as Polar, Paddle and Dodo Payments.

How are Lemon Squeezy refunds counted?

order_refunded marks the order refunded and subscription_payment_refunded the renewal, and refunded payments drop out of revenue. Lemon Squeezy sends order_refunded for partial refunds too, and SuprAnalytics then marks the whole payment refunded.
All articles

See which traffic sources bring paying customers.

Connect Lemon Squeezy, and the provider you move to, to your website analytics and see which visits and campaigns lead to revenue.

14-day free trial · No card required