What is recorded
Every payment is read back from Stripe’s API with your key before it counts as verified revenue. The product name comes from the Checkout Session’s line items, or from the product on a renewal invoice. The customer’s email is hashed and masked before it is stored. See email hashing.
Connect Stripe
You need permission to manage the site’s settings in CrispStats.1
Open the Stripe panel
In CrispStats, open the site’s Settings, then Integrations. Select Connect a payment provider and choose Stripe.
2
Create the restricted key
Under Stripe restricted key, select Create a restricted key in Stripe. Then:
- Stripe opens with the name and permissions filled in.
- Scroll down and choose Create key. Leave the permissions as they are.
- Copy the key and paste it here.
- Keep the key. Deleting it stops new sales from reaching CrispStats.
rk_live_.3
Paste the key and connect
Paste the key into Stripe restricted key. CrispStats checks it with Stripe at once. Then select Connect Stripe.CrispStats creates one webhook endpoint for this site in your Stripe account, saves its signing secret and your key encrypted, and starts importing past payments. The row shows Connected. Live: sales arrive the moment Stripe sends them.
4
Pass the visitor id at checkout
See pass the visitor id at checkout below.
- A secret key (
sk_live_): “That is a secret key with full access to your Stripe account. Create a restricted key with the link instead.” - A publishable key (
pk_live_) or a webhook signing secret (whsec_): the panel asks for a restricted key, which starts withrk_. - A restricted key without the webhook permission: “This key cannot manage webhooks. Create the key again with the link: it fills in every permission.”
What the key can do
The link opens Stripe’s Create restricted key form with these six permissions. Only the first can change anything:
Leave every other resource at None. The key cannot create charges, refunds, customers or payouts, and CrispStats never moves money. The key does not ask to read your account details, so the row may show Connected without your account’s name.
The key is used only on CrispStats’ servers, only with Stripe’s API, and is never shown again.
The link fills in the form with parameters Stripe does not document. If the form opens without the six permissions ticked, tick them by hand from the table above.
How fresh the numbers are
Stripe sends each payment to the webhook within seconds, and CrispStats reads it back from Stripe’s API before storing it. Every 15 minutes CrispStats also asks Stripe for recent events, so a payment the webhook missed appears within 15 minutes at worst. A payment seen both ways is stored once.Past payments
When you connect, CrispStats imports every Checkout payment, subscription invoice, Payment Intent with a visitor id and refund since your first payment. Progress shows on the Stripe row. See revenue history.Test mode
A key from a Stripe sandbox or test mode starts withrk_test_. The panel says “This is a test key. Test payments show with a Test tag and never count as verified revenue.” and offers Connect in test mode or Use a live key. Test payments appear on the Revenue screen with a Test tag and are left out of every total.
Pass the visitor id at checkout
Put the id fromcrispstats.id() in the Checkout Session’s metadata as crispstats_visitor_id. For subscriptions, put it in subscription_data.metadata too, so renewals carry it:
client_reference_id:
client_reference_id that is not 32 hexadecimal characters is ignored, so your own order ids there never become visitor ids. When both are set, the metadata wins. For a Payment Intent created without Checkout, put crispstats_visitor_id in the Payment Intent’s metadata.
A payment without a visitor id is still recorded and counted. It is not linked to a visit. See pass the visitor id to your checkout for proxies, single-page apps and attributing across days.
Disconnect
Select Disconnect on the Stripe row. CrispStats deletes its webhook endpoint in Stripe and destroys the saved key and signing secret. Payments already recorded stay. You can then delete the key in Stripe. If Stripe does not let CrispStats delete the endpoint (the key was already deleted, for example), the message says so: delete the endpoint in Stripe under Workbench, then Webhooks.Connections made earlier by pasting a webhook signing secret keep working. They cannot import history or verify payments: connect again with a key to add both.
Next steps
Pass the visitor id
Proxies, single-page apps and Payment Links.
Refunds and renewals
How each payment kind is recorded and deduplicated.
Revenue history
What the import reads and how it avoids counting twice.