Get started
Connect payment providers
Connect Stripe, Polar, Whop or Shopify so every payment is matched to the visit that earned it.
Connecting a payment provider puts revenue on top of your web analytics: every payment is matched to the visitor who made it and credited to the channel, campaign, referrer and page that brought them. It is what makes revenue attribution work.
Shopify stores: connecting your store also installs the Calmstats script for you. See the Shopify guide.
Connect a provider
- In your dashboard, open your website and go to Settings → Revenue.
- Choose your provider and paste a read-only key. Each provider guide says exactly which key and permissions to create.
- Copy the webhook endpoint Calmstats shows and add it in your provider's dashboard, so payments arrive in real time. Shopify registers its webhooks for you.
- Pass the visitor to your checkout, so Calmstats knows who paid (see below).
Calmstats imports the last 30 days of payments when you connect and then syncs every day, so a missed webhook never loses a payment.
| Provider | Guide |
|---|---|
| Stripe | Connect Stripe |
| Polar | Connect Polar |
| Whop | Connect Whop |
| Shopify | Connect Shopify |
Pass the visitor to checkout
The script exposes the visitor's ID in the browser:
JavaScriptconst visitorId = window.calmstats?.getVisitorId();
Send it with the checkout you create on your server, as calmstats_visitor_id metadata. Each provider guide has the exact code. Two cases need no code at all:
- Stripe Payment Links: the script adds the visitor to
buy.stripe.comlinks on your pages automatically. - Shopify: the script saves the visitor on the cart.
A payment that arrives without a visitor ID is still recorded in Revenue, but Calmstats can't credit it to a channel, campaign or page.
Next step
See revenue per channel and campaign in Sources, next to traffic on the Overview, and every payment with the visitor who made it in Revenue. Then track goals for the steps before the payment.