Connect payments
Add one webhook in Stripe, Lemon Squeezy, Paddle, Polar or Razorpay and every sale is credited to the source that brought the buyer.
This is the step that turns Statsy from an analytics dashboard into a revenue dashboard. It takes a webhook URL and a signing secret, and it is the same three moves whichever provider you use.
Copy the webhook URL from Statsy
Open Site settings › Integrations and choose your provider. Statsy shows a URL of the form
/api/hooks/<provider>/<site key>, already filled in for your site.Add it as a webhook endpoint in the provider
In the provider's own dashboard, add that URL as a webhook destination and subscribe it to their payment, refund and cancellation events.
Paste the signing secret back into Statsy
The provider gives you a signing secret when you create the endpoint. Paste it into the dialog and save. It is encrypted at rest with AES-256-GCM and never shown again, so keep your own copy if the provider only shows it once.
That is the whole setup. From then on, every payment the provider confirms is checked against the signing secret, stored, and matched back to the visitor who made it.
How the visitor gets through checkout
For a sale to be credited to a channel, the payment has to carry the visitor along with it. In most setups that happens by itself: when someone clicks a hosted checkout link, the script adds the visitor identifier to the link before the browser follows it.
If you create checkouts on your own server, read the identifier in the browser with statsy.visitorId() and pass it through as statsy_vid in the checkout's metadata, custom data or notes — or, for Stripe, as client_reference_id.
Note. Revenue is counted only from signed webhooks and the authenticated Payment API. Amounts reported by a browser are never counted, because a browser can be made to say anything.
See the money by source
Once a payment or two has arrived, revenue, customers and revenue per visitor appear beside visitors in every breakdown — channel, referrer, campaign, page, country, device. The Revenue page adds the attribution report, which splits credit across every touch a buyer had before paying.
- Per-provider setup, exact webhook events and matching rules: Revenue attribution.
- Payments from anywhere else, sent from your own server: Payment API.
- Nothing showing up yet? Payments not showing up.
Last updated · Markdown version