# Creem revenue attribution with CrispStats

Updated 2026-11-24

Connect Creem in CrispStats by pasting an API key, then put the visitor id in the checkout's metadata as crispstats_visitor_id. CrispStats imports your past transactions, reads each new one back from Creem's API, and credits one-time payments, new subscriptions, renewals, refunds and disputes to the visit that led to them.

## Steps

### 1. Open the Creem panel

The CrispStats script must already run on your site. Open the site's **Settings**, select **Integrations**, choose **Connect a payment provider** and pick Creem. You need permission to manage the site's settings.

### 2. Create an API key in Creem

Select **Open API keys in Creem**. Turn off **Test mode** in the sidebar, open **Developers** and create a new API key. Give it **Read** on every scope, and **Write** on **Webhooks** if you want sales to show up the moment they happen. Give it no other write access.

### 3. Paste the key and connect

Paste the key and select **Connect Creem**. CrispStats checks it with Creem, saves it encrypted, creates a webhook when the key allows it, and starts importing past transactions.

### 4. Pass the visitor id at checkout

Call `crispstats.id()` in the browser before the visitor leaves for checkout, and put the id in the checkout's `metadata` when your server creates it. Use your own server key there, not the key you gave CrispStats.

`checkout.js`

```js
// In the browser, before you send the visitor to checkout
const visitorId = await crispstats.id();

// On your server, when you create the checkout
await fetch("https://api.creem.io/v1/checkouts", {
  method: "POST",
  headers: { "x-api-key": process.env.CREEM_API_KEY, "content-type": "application/json" },
  body: JSON.stringify({
    product_id: "prod_...",
    metadata: { crispstats_visitor_id: visitorId },
  }),
});
```

## Check that it works

The Creem 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.

## What you get

- Creem revenue by source, channel, campaign and landing page, credited to the first touch known for the customer.
- Each payment read back from Creem's API before it counts as verified revenue, with one-time payments, new subscriptions and renewals kept apart.
- Each sale stored under Creem's transaction id, so a sale reported by the checkout and by the subscription counts once.
- Refunds, and disputes charged back, recorded as negative payments.
- Past transactions imported when you connect, so revenue and [MRR](/glossary/mrr) cover your whole history.

## Notes for Creem

- With **Write** on **Webhooks**, Creem sends each sale within seconds and CrispStats checks every 15 minutes as a safety net. Without it, CrispStats reads new transactions every 2 minutes, so a sale appears within 2 minutes. Refunds of older sales reach a connection without the webhook through a daily check.
- Creem keeps no checkout metadata for past one-time sales, so those are imported without a visit: they count in revenue but not in the source breakdowns. Past subscription payments take the subscription's metadata.
- Creem keeps test and live keys apart. A test key connects in test mode once you choose **Connect in test mode**; test payments show with a **Test** tag 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. A key connection stores some Creem payments under other ids, so when it replaces one made by hand, the import starts just after the newest payment already recorded. Payments from before stay as they were and are not verified, so nothing counts twice.
- CrispStats does not calculate [churn](/glossary/churn-rate) or [expansion](/glossary/expansion-revenue). Creem, as merchant of record, stays the source of truth for billing and tax.

Full reference: [Creem in the docs](https://docs.crispstats.com/revenue/creem)

## Frequently asked questions

### Which permissions does the Creem key need?

Read on every scope, so transactions, subscriptions and refunds can be read and verified. Write on Webhooks is optional and lets the webhook be created and deleted for you. The key never moves money and is never shown again.

### Will a new subscription count twice?

No. The checkout and the first subscription payment carry the same Creem transaction, and each sale is stored once under its transaction id.

### Do test mode payments show up in my revenue?

No. A test key connects in test mode on purpose only, and test payments show with a Test tag but never count toward revenue, MRR or any total.

### What happens when I disconnect Creem?

CrispStats deletes its webhook in Creem and destroys the saved key. Payments already recorded stay in your reports.

### Is Creem revenue attribution on every plan?

Yes, history import included. Every feature is on every plan and in the 14-day free trial, and payments are kept on every plan.

## Related

- [Revenue attribution: which traffic pays](/features/revenue-attribution)
- [First touch vs last touch attribution](/blog/revenue-attribution-first-touch-vs-last-touch)
- [Dodo Payments revenue attribution](/integrations/dodo-payments)
- [Web analytics for indie hackers](/for/indie-hackers)
- [Revenue per visitor calculator](/tools/revenue-per-visitor-calculator)
