Payment providers
Lemon Squeezy revenue attribution with CrispStats
Connect Lemon Squeezy in CrispStats by pasting an API key and choosing your store, then pass the visitor id as checkout custom data. CrispStats imports your past orders, creates its own webhook on the store, and credits each order, renewal and refund to the first touch known for the buyer. Lemon Squeezy closes on 31 March 2027: when you move to Stripe, connect Stripe to the same site.
Updated
Set up CrispStats on Lemon Squeezy
- 01
Step 1: Open the Lemon Squeezy panel
The CrispStats script must already run on your site. Open the site’s Settings, select Integrations, choose Connect a payment provider and pick Lemon Squeezy. You need permission to manage the site’s settings.
- 02
Step 2: Create an API key in Lemon Squeezy
Select Create an API key in Lemon Squeezy. Choose the + next to API keys, name the key after this site, pick the latest expiry date offered and copy the key. It is a long code that starts with
eyJ. - 03
Step 3: Paste the key and choose the store
Paste the key. CrispStats checks it with Lemon Squeezy and lists your stores under Store; with one store it is picked for you. Select Connect Lemon Squeezy: CrispStats creates one webhook on the store, saves the key encrypted and starts importing past orders.
- 04
Step 4: Pass the visitor id at checkout
Call
crispstats.id()in the browser before the visitor leaves for checkout and add it to the checkout’s custom data ascrispstats_visitor_id. On a hosted checkout link it goes in the URL; on a checkout you create through the API it goes incheckout_data.custom.checkout.js// In the browser, before you send the visitor to checkoutconst visitorId = await crispstats.id();// A hosted checkout link: add the id as custom dataconst url = new URL("https:/ / your-store. lemonsqueezy. com/ buy/ . . . ");if (visitorId) url. searchParams. set( "checkout[custom][crispstats_visitor_id]", visitorId);window.location.href = url.toString();// Or, when you create the checkout through the API:// checkout_data: { custom: { crispstats_visitor_id: visitorId } }
Check that it works
The Lemon Squeezy row in Settings, Integrations shows Connected, whether it is live, and when it last updated. Make a purchase from a page with the script: it appears under Payments on the Revenue screen with the source of that visit. If the key stops working or loses a permission, the row says so and names the way out.
CrispStats on Lemon Squeezy
What you get
- Which sources, campaigns and landing pages bring paid Lemon Squeezy orders, credited to the first touch known for the buyer.
- Every paid order with its product and variant name, read back from Lemon Squeezy’s API so it counts as verified revenue, and renewals recorded as subscription renewals.
- Refunds on orders and on subscription payments recorded as negative payments.
- Past orders, subscription payments and refunds of the chosen store imported when you connect.
- MRR on the Revenue screen, counted from each subscription’s first renewal.
Notes and limits
- Lemon Squeezy sends each order within seconds, and CrispStats checks for new orders every 15 minutes as a safety net. An order seen both ways is stored once.
- Lemon Squeezy closes on 31 March 2027. After that date it can no longer be connected; payments already recorded stay. Connect Stripe to the same site when you move.
- Lemon Squeezy keys cannot be limited to reading, and they expire. The key is used only to read payments and to create one webhook. 14 days before the saved key expires, the row asks for a new one.
- A Lemon Squeezy order does not say whether it started a subscription, so the first payment of a subscription is recorded as a one-time payment. It counts toward revenue and new revenue at once, and toward MRR from its first renewal.
- Lemon Squeezy reports the total refunded so far, not the latest refund, so only the difference is stored. A partial refund of 10.00 followed by another of 5.00 becomes two refunds, 10.00 and 5.00.
- A test key connects in test mode once you choose Connect in test mode. Test payments show with a Test tag on the Revenue screen and are kept out of revenue, MRR and every total.
- A payment without a visitor id is still recorded and counted in revenue, MRR and every total. It is left out of the source, campaign and channel breakdowns rather than filed under Direct.
- Connections made earlier with a webhook you added by hand keep working, but cannot import history or verify payments. Connect again with a key to add both.
The docs page covers the optional steps this guide leaves out.
Setup questions. Straight answers.
What people ask before they connect it.
Lemon Squeezy closes on 31 March 2027. Orders already recorded stay in your reports. Connect Stripe to the same site when you move, and new sales are attributed the same way.
The order that reports the first payment does not say it started a subscription, so it is recorded as a one-time payment. The subscription enters MRR with its first renewal, which Lemon Squeezy does mark as a subscription payment.
Yes. Connecting with a key starts the import at once: every order, subscription payment and refund of the chosen store since your first.
CrispStats deletes its webhook on the store and destroys the saved key. Orders and refunds already recorded stay in your reports.
Yes, history import included. Every feature is on every plan and in the 14-day free trial, and payments are kept on every plan.
Not answered here? Write to hello@crispstats.com
Go further
Related
- Revenue attribution: which traffic pays
See which source, page and campaign each payment came from.
- Stripe revenue attribution
Connect Stripe to CrispStats with a restricted key and pass the visitor id at checkout, so every payment, renewal and refund is tied to the visit behind it.
- Revenue per visitor calculator
Enter visitors, conversion rate and average order value to get revenue per visitor, monthly revenue, and what a 10% improvement is worth.
- First touch vs last touch attribution
First touch, last touch and multi-touch attribution in plain terms, with a worked example and how to join a payment to the visit that caused it.
- Web analytics for indie hackers
Traffic, revenue by source, uptime and errors for every side project in one dashboard.
Guides
- The best marketing and revenue attribution tools for SaaS and indie makers
Twelve marketing attribution tools that tie payments to traffic sources, compared by payment providers read, price and limits.
Other integrations
Payment providers
Frameworks
Site builders
Ecommerce platforms
Tag managers
Your traffic, crisp and clear
One script, no cookies, and every feature from the first day. Set up takes about as long as pasting a snippet.