Connect Lemon Squeezy
Send your Lemon Squeezy orders, renewals and refunds to Clakta over a webhook, and credit each sale to the visitor who made it.
Connecting Lemon Squeezy sends every sale, renewal and refund to Clakta as it happens. That is the first half of measuring Lemon Squeezy performance; the second is carrying the visitor's session into the checkout, so each sale is credited to the traffic that produced it.
Both halves are covered below, and the second one is automatic if you already install the tracking script.
Connect
- Go to Project settings → Sales platforms.
- Choose Lemon Squeezy, name the connection, and click Create connection. Clakta generates a webhook URL — copy it.
- In Lemon Squeezy, go to Settings → Webhooks and click +.
- Paste the URL, choose a signing secret between 6 and 40 characters, and select the four events in the table below.
- Back in Clakta, paste the same signing secret and click Finish.
The card reads Added once the secret is saved.
Lemon Squeezy keeps test-mode and live-mode webhooks apart, and a webhook only ever receives events from the mode it was created in. Create the connection in the mode whose sales you want in Clakta — and if you test first, create a second connection when you go live.
Leaving before you paste the secret is safe. The connection stays Setup incomplete, and any delivery that arrives meanwhile is held and retried rather than dropped — so a real sale during setup is not lost.
Events to select
| Event | What it does in Clakta |
|---|---|
order_created | Records the sale. |
order_refunded | Marks the order refunded. |
subscription_payment_success | Records each subscription renewal. |
subscription_payment_refunded | Marks a refunded renewal. |
A subscription renewal fires no order_created at all — Lemon Squeezy reports
it as an invoice instead. Without subscription_payment_success, your first
month is recorded and every renewal after it is invisible.
Selecting extra events is harmless: anything Clakta does not handle is acknowledged and ignored.
Attribute sales to visitors
Lemon Squeezy checkouts happen on Lemon Squeezy's own domain, so the visitor's
session has to travel with them. It rides in a checkout[custom] value that
Lemon Squeezy stores against the order and returns on the webhook.
If you link to a checkout from a page running the Clakta script, this is
automatic. When a visitor clicks a link to *.lemonsqueezy.com/checkout/buy/…
or /buy/…, the script appends the session for you. Lemon.js overlay buttons
are covered too.
If you create checkouts through the Lemon Squeezy API, pass it yourself. This is the most reliable option, because it never depends on the browser:
If you open overlays yourself, decorate the URL first:
clakta_session_id is the same key Clakta uses for Stripe metadata, so if you
sell through both you only have one name to remember.
Once a checkout link is opened it becomes a .../checkout/?cart=… URL that is
unique to one customer and single-use. Always share the /checkout/buy/… form.
Clakta leaves cart URLs untouched.
Privacy-friendly projects
Projects in privacy-friendly mode have no client-side session id to send, so
Lemon Squeezy sales are recorded but not linked to a visitor. If you need
attribution there, report the sale from your thank-you page instead — set the
Lemon Squeezy button link to include ?order_id=[order_identifier] and call
clakta.purchase({ orderId }) with that value. Use [order_identifier], the
UUID, not [order_id]: the UUID is the id Clakta records the order under.
What gets recorded
- Revenue, in the order's own currency. If Clakta does not support that currency, the amount is kept and your project currency applies.
- Customer name and email, unless the project is privacy-friendly.
- Products — the first line of the order.
- Status, and the date the sale was approved.
- Attribution — the session, plus the click token and UTMs when the checkout carried them.
An order with several different products records only its first line, because that is all Lemon Squeezy puts in the webhook. The order total is always the full amount, so revenue is exact either way.
The payment method reads Other for one-off sales — Lemon Squeezy is the merchant of record and does not report one. Renewals show the card that was charged.
Refunds and chargebacks
A full refund marks the order refunded. A partial refund leaves it paid, because Clakta records a sale as one amount and flipping the whole order would erase revenue you actually kept.
Lemon Squeezy absorbs chargebacks on your behalf and refunds the buyer, so a chargeback reaches Clakta as a refund rather than as a dispute.
Disconnect
Remove the connection from Project settings → Sales platforms. Deliveries stop being accepted immediately. Orders already recorded stay where they are — disconnecting never deletes history.
Delete the webhook in Lemon Squeezy too, so it stops retrying against an endpoint that no longer exists.
Troubleshooting
Related articles
Connect Shopify
Install the Clakta app on your Shopify store. It sets up checkout tracking, imports your recent orders and matches each sale to the ad that produced it.
Connect Stripe
Link your Stripe account in one click so every payment, refund and dispute reaches Clakta — and each sale is matched to the visitor who made it.
Connect Dodo Payments
Point Dodo Payments at Clakta with a webhook so your payments, refunds and chargebacks arrive automatically — and each sale is matched to the visitor who made it.