Payment providers
Dodo Payments revenue attribution with CrispStats
Connect Dodo Payments in CrispStats by pasting an API key, then put the visitor id in the payment's or subscription's metadata as crispstats_visitor_id. CrispStats imports your past payments and refunds, reads each new one back from Dodo's API, and credits payments, subscription charges, refunds and lost disputes to the visit that led to them.
Updated
Set up CrispStats on Dodo Payments
- 01
Step 1: Open the Dodo Payments panel
The CrispStats script must already run on your site. Open the site’s Settings, select Integrations, choose Connect a payment provider and pick Dodo Payments. You need permission to manage the site’s settings.
- 02
Step 2: Create an API key in Dodo Payments
Select Open API keys in Dodo Payments, then open Developer, API keys and choose Create new key. Give it the permissions below and leave everything else at None. Webhooks: Write is optional: with it, sales show up the moment they happen. Copy the key: it starts with
dodo_live_, ordodo_test_in test mode.Payments: ReadRefunds: ReadSubscriptions: ReadProducts: ReadWebhooks: Write (optional: sales the moment they happen) - 03
Step 3: Paste the key and connect
Paste the key and select Connect Dodo Payments. CrispStats checks it with Dodo, saves it encrypted, creates a webhook when the key allows it, and starts importing past payments and refunds.
- 04
Step 4: Pass the visitor id at checkout
Call
crispstats.id()in the browser before the visitor leaves for checkout and add it to themetadataof the payment, subscription or checkout session you create. Call it in the click handler, not on your server: the id belongs to the browser that asks.checkout.js// In the browser, before you send the visitor to checkoutconst visitorId = await crispstats.id();// On your server, in the body of the payment or subscription you createconst body = {// ...your product cart and customermetadata: { crispstats_visitor_id: visitorId },};
Check that it works
The Dodo Payments row in Settings, Integrations shows Connected, whether it is live, and when it last updated. Make a purchase from a page with the script: it appears under Payments on the Revenue screen with the source of that visit. If the key stops working or loses a permission, the row says so and names the way out.
CrispStats on Dodo Payments
What you get
- Dodo Payments revenue by source, channel, campaign and landing page, credited to the first touch known for the customer.
- Each payment read back from Dodo’s API before it counts as verified revenue: one-time payments, first subscription charges and renewals kept apart.
- Refunds, and disputes the business lost or accepted, recorded as negative payments that never exceed the payment.
- Past payments and refunds imported when you connect, so revenue and MRR cover your whole history.
- Customer email stored only hashed and masked; renewals without a visitor id take the attribution of the customer’s earliest attributed payment.
Notes and limits
- With Webhooks: Write, Dodo sends each payment within seconds and CrispStats checks every 15 minutes as a safety net. Without it, CrispStats reads new payments and refunds every 2 minutes, so a sale appears within 2 minutes. A lost dispute without the webhook can take up to a day.
- Dodo payments are stored without a product name. The payment’s metadata is merged over the customer’s metadata, so an id on the customer also counts.
- A test key connects in test mode once you choose Connect in test mode. Test payments show with a Test tag on the Revenue screen and are kept out of revenue, MRR and every total.
- A payment without a visitor id is still recorded and counted in revenue, MRR and every total. It is left out of the source, campaign and channel breakdowns rather than filed under Direct.
- Connections made earlier with a webhook you added by hand keep working, but cannot import history or verify payments. Connect again with a key to add both.
- CrispStats does not calculate churn or expansion. Dodo Payments, as merchant of record, stays the source of truth for billing, tax and payouts.
The docs page covers the optional steps this guide leaves out.
Setup questions. Straight answers.
What people ask before they connect it.
Read on Payments, Refunds, Subscriptions and Products. Write on Webhooks is optional and lets the webhook be created and deleted for you. Leave Customers and everything else at None. The key never moves money and is never shown again.
Yes. A renewal carries the subscription's metadata, and one without a visitor id takes the attribution of the same customer's earliest attributed payment, matched by a hash of the email.
Yes. Connecting with a key starts the import at once: every succeeded payment and refund since your first.
CrispStats deletes its webhook in Dodo Payments and destroys the saved key. Payments already recorded stay in your reports.
Yes, history import included. Every feature is on every plan and in the 14-day free trial, and payments are kept on every plan.
Not answered here? Write to hello@crispstats.com
Go further
Related
- Revenue attribution: which traffic pays
See which source, page and campaign each payment came from.
- First touch vs last touch attribution
First touch, last touch and multi-touch attribution in plain terms, with a worked example and how to join a payment to the visit that caused it.
- Creem revenue attribution
Connect Creem to CrispStats with an API key and pass the visitor id in checkout metadata, so payments, renewals and refunds are tied to the visits behind them.
- Web analytics for indie hackers
Traffic, revenue by source, uptime and errors for every side project in one dashboard.
- Revenue per visitor calculator
Enter visitors, conversion rate and average order value to get revenue per visitor, monthly revenue, and what a 10% improvement is worth.
Other integrations
Payment providers
Frameworks
Site builders
Ecommerce platforms
Tag managers
Your traffic, crisp and clear
One script, no cookies, and every feature from the first day. Set up takes about as long as pasting a snippet.