Revenue
Lemon Squeezy revenue by traffic source
Lemon Squeezy takes the order. traffic.cx tells you which visit, source and campaign it came from, and keeps crediting that source when the subscription renews. Paste a Lemon Squeezy API key, pass one ID from the visit as checkout custom data, and orders, renewals and refunds show up next to the traffic that earned them. Orders that can't be linked stay in your totals as "Unattributed".
Last updated
Last updated 28 October 2026. Setup details come from the Lemon Squeezy setup guide and revenue docs. Need the step-by-step technical guide? Go to /integrations/lemon-squeezy.
In short
- Connect: create an API key in Lemon Squeezy (Settings → API) and paste it in traffic.cx Settings → Revenue. traffic.cx adds a signed webhook to your store and imports the last 90 days.
- Link: pass the visitor's pageview ID as checkout custom data (
checkout[custom][tcx_pvid]) on your checkout link, or incheckout_data.customwhen you create checkouts through the API. - Read: revenue, paying customers, conversion rate and revenue per visitor by channel, source, campaign, landing page, country and device.
- Cost: included on every plan, Free too: one site, 3,000 events a month, no card.
What Lemon Squeezy orders look like in traffic.cx
traffic.cx reads orders, subscription renewals and refunds. On the Revenue page you compare sources by:
| Metric | Definition |
|---|---|
| Revenue | Payments minus refunds, in the site's currency, by payment time |
| Paying customers | Distinct customers who paid in the period |
| Conversion rate | First-time buyers ÷ unique visitors |
| Revenue per visitor | Revenue ÷ unique visitors |
| Average order value | Revenue ÷ payments that aren't refunds |
| LTV | All the revenue so far of the customers first won in the period, per customer |
Amounts leave out the tax Lemon Squeezy collects. Lemon Squeezy describes itself as a merchant of record (Lemon Squeezy docs, as of Oct 28, 2026), so traffic.cx records revenue without that sales tax and VAT (definitions).
How an order finds its visit
- The visit. The traffic.cx tracker records the visit with its source, campaign and landing page.
- The checkout. When the visitor clicks your Lemon Squeezy checkout link, a small script adds the pageview ID (and, in cookie mode, the visitor ID) as checkout custom data. Lemon Squeezy supports custom data as
checkout[custom][…]parameters on checkout links (Lemon Squeezy docs, as of Oct 28, 2026). - The order. The order webhook arrives with that custom data. traffic.cx credits the visit using last non-direct (default) or first touch, within a 90-day lookback by default (7 to 365 days).
- Renewals inherit the customer's first payment's attribution, so a subscriber keeps crediting the source that brought them.
- Refunds are subtracted on the day they happen, credited to the order they refund. Partial refunds are recorded as one refund that grows with each partial refund.
- No link: the order stays in the totals as Unattributed.
In the default cookieless mode, the pageview ID links an order to the visit where checkout started; visitor IDs rotate daily and don't connect visits across days. Longer journeys need the optional cookie mode (same browser only) or an earlier payment from the same customer (cookieless vs cookie mode).
Connect Lemon Squeezy in three steps
Install and verify the tracker first. You need an owner or admin role in traffic.cx and access to your store's API settings. Connect test mode to a separate traffic.cx test site while you verify.
- Create an API key. In Lemon Squeezy, open Settings → API and create a key (a test-mode key connects your test store). In traffic.cx, open Settings → Revenue, choose Connect next to Lemon Squeezy and paste it. If the account has several stores, enter the store's ID too.
- Pass the visitor's IDs. Add them as checkout custom data on your checkout link when the visitor clicks, or in
checkout_data.customwhen your server creates the checkout. If you use an overlay checkout, pass the custom data through that SDK's checkout configuration before opening it. The setup guide has both code examples. - Test one order. Make a test-mode purchase from a tagged visit, check the webhook's
meta.custom_datafortcx_pvid, and confirm the order appears once with the right source. Check a renewal and a refund if you use them.
The Lemon Squeezy details traffic.cx handles
| Webhook | Recorded as |
|---|---|
order_created | The payment (paid orders only), including a subscription's first payment |
subscription_payment_success | A renewal (the first payment is counted with its order) |
order_refunded, subscription_payment_refunded | The refunded amount, as one refund that grows with each partial refund |
- No double count for a new subscription: its first payment is counted with the order, not again as a subscription payment.
- Unpaid orders don't create revenue.
- Imported history (the last 90 days) doesn't include checkout custom data, so those orders can stay Unattributed.
When an order shows as Unattributed
- The checkout link or API request didn't carry
tcx_pvidin custom data. Check the final checkout URL and the delivered webhook. Don't put the IDs in an unrelated metadata field. - The tracker was blocked or hadn't loaded when the visitor clicked.
- The buyer came back on a later day or another device in cookieless mode.
- It's an imported order from before you connected.
Pricing
Sign up with Google or email and start on the Free plan: every feature on one site, no card and no trial clock. Revenue attribution is included on every plan, Free too. A payment received through a provider integration is not a pageview or custom event. See pricing.
See which traffic pays you
Start free · Lemon Squeezy setup guide · How revenue attribution works · Pricing
Using another provider? See Stripe, Polar or Dodo Payments.
Frequently asked questions
How do I see which traffic source my Lemon Squeezy sales come from?
Install the traffic.cx script, connect Lemon Squeezy with an API key in Settings → Revenue, and pass the visitor's pageview ID as checkout custom data. traffic.cx then credits each order to the visit's source, campaign and landing page.
Do subscription renewals keep their original source?
Yes. A renewal for a known customer inherits the attribution of that customer's first payment.
Does it work with checkout links, or only the API?
Both. Add the pageview ID to a checkout link as checkout[custom][tcx_pvid] when the visitor clicks, or put it in checkout_data.custom when your server creates the checkout.
Is sales tax included in revenue?
No. Amounts leave out the tax Lemon Squeezy collects as the merchant of record.
What if my account has several stores?
Enter the store's ID when you connect, so traffic.cx adds the webhook to the right store.
Do I need cookies for this?
No. In the default cookieless mode, the pageview ID links an order to the visit where checkout started. The optional cookie mode links visits across days in the same browser. Whether you need consent depends on your setup and the rules that apply to you.