# RevenueCat revenue attribution with CrispStats

Updated 2026-11-24

Connect RevenueCat in CrispStats with a secret API key (v2), and sign customers in with the same id in your app and on your site. CrispStats imports every customer's App Store and Google Play purchases, reads each one back from RevenueCat's API, and credits new subscriptions, renewals, one-time purchases and refunds to that user's first visit.

## Steps

### 1. Open the RevenueCat panel

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

### 2. Create a secret API key (v2)

Select **Open API keys in RevenueCat**. In your project's settings, open **API keys**, choose **New**, pick version 2 and set the permissions below. **Integrations: Read and write** is optional: with it, purchases show up the moment they happen. Leave everything else at **No access**. A public SDK key (`appl_`, `goog_`, `amzn_` or `rcb_`) is refused.

```text
Customers: Read only
Subscriptions: Read only
Purchases: Read only
Projects: Read only
Integrations: Read and write   (optional: purchases the moment they happen)
```

### 3. Paste the key and connect

Paste the key. CrispStats checks it with RevenueCat and shows the project's name; a v2 key belongs to one project, so there is nothing to choose. Select **Connect RevenueCat**: the key is saved encrypted, a webhook is added when the key allows it, and the import of every customer's purchases starts.

### 4. Sign customers in with the same id

An in-app purchase does not start on your website, so purchases are linked through your own user id. Log the customer in to RevenueCat with your user id in the app, and call `crispstats.identify()` with the same id on your site. When the app knows the visitor id, set it as the subscriber attribute `crispstats_visitor_id` instead.

```swift
// In the app (iOS), when the customer signs in.
// On your site, call crispstats.identify(user.id) with the same id.
let (customerInfo, created) = try await Purchases.shared.logIn(user.id)
```

## Check that it works

The RevenueCat 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

- App Store and Google Play revenue by source, channel, campaign and landing page, credited to the first visit of the user who bought.
- Each purchase read back from RevenueCat's API before it counts as verified revenue, stored under its store transaction id so it counts once.
- New subscriptions, renewals and one-time purchases kept apart; a free trial is skipped and the renewal that ends it is the first payment.
- Refunds made through the store's customer support recorded as negative payments.
- Every customer's past purchases imported when you connect, so revenue and [MRR](/glossary/mrr) cover your whole history.

## Notes for RevenueCat

- With **Integrations: Read and write**, RevenueCat sends each purchase within seconds and CrispStats reads every customer once a week as a safety net. RevenueCat has no list of recent purchases, so without the webhook CrispStats reads every customer once a day; on a project with many thousands of customers a pass can take longer.
- Refunds of subscription renewals arrive only by webhook, because RevenueCat's API does not mark them. Refunds of one-time purchases are found either way.
- RevenueCat keys have no test mode. Each purchase says whether it was made in the sandbox: sandbox purchases show with a **Test** tag and are kept out of revenue, MRR and every total.
- Purchases through Web Billing and Stripe are counted through [Stripe](/integrations/stripe), and Paddle purchases through [Paddle](/integrations/paddle), when you connect those, so nothing counts twice. PayPal purchases made through RevenueCat are not counted.
- Anonymous RevenueCat ids (`$RCAnonymousID:`) are not used as user ids, so a customer who never signs in is linked only through the subscriber attribute.
- 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 RevenueCat 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.

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

## Frequently asked questions

### Can it attribute in-app purchases on iOS and Android?

Yes, through your own user id. When the customer signs in with the same id in the app and on your site, each purchase is credited to that user's first visit to your site.

### Do I need RevenueCat's webhook?

No, but it makes purchases arrive within seconds and brings refunds of renewals. Without Integrations: Read and write on the key, CrispStats reads every customer once a day.

### Can I import RevenueCat purchases from before I connected?

Yes. Connecting starts the import at once: it reads every customer of the project and imports their purchases. If the project was connected earlier with a webhook added by hand, the import starts after the newest purchase already recorded, so nothing counts twice.

### What happens when I disconnect RevenueCat?

CrispStats removes its webhook from the project and destroys the saved key. Purchases already recorded stay in your reports.

### Is RevenueCat 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)
- [Stripe revenue attribution](/integrations/stripe)
- [Paddle revenue attribution](/integrations/paddle)
- [Web analytics for SaaS products](/for/saas)
- [First touch vs last touch attribution](/blog/revenue-attribution-first-touch-vs-last-touch)
