How do I attribute LemonSqueezy or Paddle sales to a traffic source?
Carry the DataFast visitor ID through checkout and report the sale server-side. For LemonSqueezy, add data-datafast-checkout to the checkout link and point a webhook at your DataFast site URL; signed payments are recorded and deduplicated by order. For Paddle, pass window.datafast.checkoutData as customData and call the revenue API from your webhook.
Steps
- Install the script. Add <script defer src="https://datafast.app/js/script.js" data-website-id="YOUR_SITE_ID"></script> to your site.
- LemonSqueezy. Mark checkout links with data-datafast-checkout. In LemonSqueezy create a webhook for order_created and subscription_payment_success pointing at the URL shown in your site's settings, and use the revenue API key as the signing secret.
- Paddle. Pass window.datafast.checkoutData as the checkout's customData in Paddle.js, then call POST /api/revenue from your Paddle webhook handler with the visitor ID.
- Check the dashboard. Revenue appears per source and campaign. Retries are deduplicated by order or payment ID.
Limits
- The native webhook exists for LemonSqueezy only; other providers use the revenue API.
- The revenue API key is a write key: keep it on your server, never in the browser.
FAQ
Is the LemonSqueezy webhook native?
Yes. DataFast exposes a webhook URL per site for order_created and subscription_payment_success.
Can I use another payment provider?
Any provider that can call an HTTP endpoint after a successful payment can report to the revenue API.
Related
- How do I see Stripe revenue by traffic source?
- How do I find out which marketing channel brings in revenue, not just visits?
- Revenue analytics
Markdown version: /solutions/track-lemonsqueezy-and-paddle-revenue-by-source.md