Lemon Squeezy + SuprAnalytics

See which traffic sources bring your Lemon Squeezy sales

Lemon Squeezy handles your payments. SuprAnalytics shows where your customers came from: connect the two and every source, campaign and page shows the Lemon Squeezy revenue it brought, with each customer's journey from first visit to purchase.

14-day free trial · No card required · From $9/monthExplore the live demo

The referrer report of the live demo sorted by revenue: Google, direct visits, ChatGPT, a newsletter, LinkedIn and X, each with visitors, bounce rate, session duration, customers, conversion rate, revenue and revenue per visitor.

See which visitors become customers

Traffic analytics tells you where visitors came from. Lemon Squeezy tells you what sold. Payment attribution joins the two: which visits turned into which orders, so every source shows the revenue it brought, not just the people.

The channel with the most visitors is often not the one that pays. Attribution shows where paying customers came from; it doesn't cover a payment that can't be tied to a visit, and it doesn't prove a channel caused a sale on its own.

Illustrative example: visitors and Lemon Squeezy revenue by traffic source
SourceVisitorsLemon Squeezy revenue
Google1,400$240
Reddit520$480
X360$120
Direct780$160
Illustrative example, not actual customer data. Google sends the most visitors; Reddit, with about a third as many, brings twice the revenue.

Connect website visits to Lemon Squeezy payments

One webhook in Lemon Squeezy, its secret in SuprAnalytics, and the visitor id carried through checkout as custom data.

  1. Visitor arrives
  2. Checkout opens
  3. Payment completes
  4. Revenue is attributed
  1. Install the SuprAnalytics script

    One line in the <head> of your pages, or the guide for your platform. Every visit is then recorded with its source, campaign and landing page, and each visitor gets an id.

  2. Add a webhook in Lemon Squeezy

    In Lemon Squeezy, Settings → Webhooks, add the URL SuprAnalytics shows for your website with a signing secret of your choice, and select order_created, subscription_payment_success, order_refunded and subscription_payment_refunded.

  3. Paste the same secret in SuprAnalytics

    In Settings → Revenue, with Lemon Squeezy selected. Every delivery's X-Signature is checked against it, so nothing but your Lemon Squeezy store can report a payment.

  4. Pass the visitor id as checkout custom data

    Add checkout[custom][supr_visitor_id] to your checkout links, or checkout_data.custom.supr_visitor_id when your server creates checkouts with the API. Both are below.

  5. See attributed revenue

    Each paid order arrives through the webhook, is tied to the visitor and their visits, and shows up on the dashboard, the live view and the customer's journey within seconds.

When the checkout carries no visitor id. The script keeps a random id in the visitor's browser, the supr_visitor_id cookie. Lemon Squeezy returns whatever custom data the checkout had in the webhook's meta.custom_data, and SuprAnalytics reads the id from there. Without it, the order is matched through Lemon Squeezy's customer id to that customer's earlier payment with a visitor, or by an email SuprAnalytics has already seen. Failing both, the payment is still recorded and counts in your revenue, without a source.

The Lemon Squeezy setup guide

Keep visitor attribution connected through checkout

Lemon Squeezy carries custom data from the checkout to the webhook. Put the visitor id in it one of two ways, depending on how your checkouts are made.

Checkout links

A small script in the browser

The SuprAnalytics script doesn't change Lemon Squeezy links on its own. Add this snippet after it: when a visitor clicks a link to .lemonsqueezy.com/checkout, it sets checkout[custom][supr_visitor_id] on the link.

<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-side code from the guide, with no keys in it. It sets the id at the click, so links added later are covered too. Optionally, checkout[custom][supr_session_id] from window.supr.sessionId() credits the order to that exact visit.

Checkout links, in the guide

Checkouts created with the API

On your server

When your server creates a checkout through Lemon Squeezy's API, read the supr_visitor_id cookie from the visitor's request and put it in checkout_data.custom.supr_visitor_id. Your API key stays on the server.

  • The same custom-data keys as links: supr_visitor_id, and optionally supr_session_id
  • Nothing to change on your products or prices in Lemon Squeezy: the id rides on each checkout

Checkouts with the API, in the guide

Know which channels bring paying customers

Are Google visitors buying? Are your Reddit posts making sales? Which newsletter issue sold, and which sources bring customers who keep paying? Every breakdown shows revenue beside the visitors.

The referrer report of the live demo sorted by revenue: Google, direct visits, ChatGPT, a newsletter, LinkedIn and X, each with visitors, bounce rate, session duration, customers, conversion rate, revenue and revenue per visitor.

By channel and referrer

Search, social, AI assistants, email, referrals and direct visits, and the websites behind them, each with its customers and revenue.

By campaign

UTM tags and ref links read on arrival, so a sponsored post or a newsletter issue gets its own revenue line.

By landing page, page and country

Which pages people arrive on and read before they pay, and where in the world they pay from.

Over time

Revenue on the traffic chart as its own series, new and renewals apart, with the period before to compare.

Conversion rate and revenue per visitor

The two numbers that rank channels fairly, on every row, so a small source that pays well stands out.

Lifetime value

What customers from each source have paid in total, renewals included and refunds left out.

How revenue attribution works

Understand where customers first came from and where they converted

Most customers don't pay on their first visit. Choose, per website, which visit gets the credit.

  1. Mon · visit 1

    Finds you on Google

    Reads the pricing page, leaves

  2. Thu · visit 2

    Comes back directly

    Types your address in

  3. Thu · visit 2

    Opens a Lemon Squeezy checkout

    Pays $49

An illustrative journey: Google, then a direct return, then a Lemon Squeezy checkout and payment.

First touch

The $49 is credited to

Google

Revenue goes to the first visit SuprAnalytics recorded for this visitor, however long ago. It answers which channels find new customers.

Last touch

The $49 is credited to

Direct

Revenue goes to the visit the payment belongs to. This is plain last touch, and the default: a direct return gets the credit, it isn't skipped for an earlier source. It answers which visits close.

With supr_session_id in the custom data, the last touch is that exact visit; without it, the visitor's most recent visit before the order. Both models need the returning visitor to be recognised: someone who browses on one device and pays on another is two visitors until an email or your app's identify call joins them, and in cookieless mode the visitor id changes daily, so earlier days' visits can't be linked. More on attribution models

Follow revenue beyond the first purchase

One-time purchases, subscription renewals and refunds stay on the customer's record, so their second month and a refund in their third belong to the same story.

What SuprAnalytics does with each Lemon Squeezy webhook event
order_createdPaid ordersRecorded as a new payment for the order's total, credited through the custom data, the customer id or the email. Orders that aren't paid, and free ones, are skipped.
subscription_payment_successRenewalsRecorded as a renewal when the billing reason is renewal, and credited to the customer's original visit. The first payment is skipped (the order already counts it), and so are charges for a plan change mid-cycle.
order_refundedOrder refunds, full or partialThe whole order is marked refunded, even for a partial refund: SuprAnalytics doesn't lower it by the refunded amount.
subscription_payment_refundedRenewal refundsThe renewal payment is marked refunded, in full.
Other eventsSubscription created, updated or cancelled, failed payments, license keysAcknowledged and ignored: they aren't revenue.
  • Each order and each renewal is stored once, by its Lemon Squeezy id, so webhook retries don't double your revenue
  • Refunded payments drop out of revenue, conversion and lifetime value, and the chart shows them on top of the revenue bars
  • Renewals are counted apart from new revenue, and conversion rate counts new customers only
  • Payments in other currencies are converted to your website's reporting currency with daily rates

Amounts are Lemon Squeezy's total, which includes any tax it charged, and a partial refund removes the whole payment, so SuprAnalytics' totals won't always match Lemon Squeezy's. This is attribution, not accounting: Lemon Squeezy stays the record for tax, invoices and payouts, and it remains your merchant of record and subscription manager.

Renewals, refunds and currencies

The overview of the live demo: revenue of $50,897 split into new and returning beside visitors, conversion rate and revenue per visitor, with a daily chart showing revenue under the visitors line.

Understand what happened before the purchase

A Lemon Squeezy order is the last line of a story: how someone found you, the pages they read, the goals they completed, maybe a question in the chat. SuprAnalytics keeps all of it, for every website you run, in one account.

  • Traffic analytics, the visitor's journey and funnels that end at the payment, on the same dashboard
  • Built-in live chat, to answer questions before someone buys, beside that visitor's analytics
  • Revenue by source and campaign across every provider you connect (revenue attribution)

A chat and a payment meet on one journey when they come from the same tracked visitor, which means the same browser, or when the email Lemon Squeezy sends matches one SuprAnalytics has already seen.

Start tracking Lemon Squeezy revenue

The Lemon Squeezy integration is part of every plan, for every website. Plans differ only in monthly analytics events, storage and how long data is kept.

  • Payments never count as events: only pageviews, goals and outbound clicks do
  • Unlimited websites, each with its own Lemon Squeezy webhook, attribution model and reporting currency
  • Every plan starts with a 14-day free trial, with no card. One trial per person.

Plans start at

$9 / month

100,000 analytics events a month, unlimited websites, every feature. Bigger allowances up to 5 million.

14-day free trial · No card required

Questions, answered.

How do I connect Lemon Squeezy to SuprAnalytics?

Install the SuprAnalytics script on your website. In Lemon Squeezy, Settings → Webhooks, add the webhook URL SuprAnalytics shows for your website with a signing secret, and select order_created, subscription_payment_success, order_refunded and subscription_payment_refunded. Paste the same secret into Settings → Revenue with Lemon Squeezy selected. Then pass the visitor id as checkout custom data, on your checkout links or through the API.

Can I track Lemon Squeezy sales by traffic source?

Yes. Once an order carries the visitor id, SuprAnalytics ties it to that visitor's visits, so every channel, referrer, campaign, landing page and country shows its customers, conversion rate and revenue beside its visitors.

How does Lemon Squeezy checkout attribution work?

Lemon Squeezy lets a checkout carry custom data and returns it in the webhook's meta.custom_data. You put the SuprAnalytics visitor id in it as supr_visitor_id: checkout[custom][supr_visitor_id] on a checkout link, or checkout_data.custom.supr_visitor_id when creating a checkout with the API. When the order_created webhook arrives, SuprAnalytics reads the id and credits the order to that visitor's first or most recent visit.

Do I need to pass visitor information through checkout?

Yes, for reliable attribution. The SuprAnalytics script doesn't tag Lemon Squeezy links by itself, so add the snippet from the guide to your checkout links, or set the custom data when your server creates checkouts. Without it, an order can still be matched by Lemon Squeezy's customer id or by an email SuprAnalytics has already seen, and otherwise counts in your revenue without a source.

Can I track subscription renewals?

Yes. subscription_payment_success events with the billing reason renewal are recorded as renewals and credited to the customer's original visit, through the custom data or Lemon Squeezy's customer id. The first payment is counted once, from the order. Charges for a mid-cycle plan change aren't counted. Revenue is shown split into new and renewals.

Can I track Lemon Squeezy refunds?

Yes. order_refunded marks the order refunded and subscription_payment_refunded marks the renewal payment refunded, and refunded payments drop out of revenue and lifetime value. Partial refunds aren't prorated: Lemon Squeezy sends order_refunded for them too, and SuprAnalytics marks the whole payment refunded.

How does first-touch vs last-touch attribution work?

First touch credits a payment to the visit that first brought the customer to your website. Last touch, the default, credits the visit the payment belongs to, even a direct return: it isn't last non-direct touch. It's a setting per website, and every report recalculates when you change it. Both depend on recognising the returning visitor; in cookieless mode the visitor id changes daily.

What happens if a payment cannot be linked to a visitor?

It's still recorded and counts in your total revenue, without a source. That happens when the order has no visitor id in its custom data and Lemon Squeezy's customer id and the email don't match anything SuprAnalytics has seen, for example a purchase from a Lemon Squeezy store page the buyer reached without passing through your website.

Find out where your Lemon Squeezy customers come from

Connect your website traffic to Lemon Squeezy revenue and discover which channels bring paying customers.

14-day free trial · No card requiredHow revenue attribution worksPolarDodo PaymentsEvery feature