Skip to content

Payment providers

RevenueCat revenue attribution with CrispStats

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.

Updated

Set up CrispStats on RevenueCat

  1. 01

    Step 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. 02

    Step 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.

    Customers: Read onlySubscriptions: Read onlyPurchases: Read onlyProjects: Read onlyIntegrations: Read and write   (optional: purchases the moment they happen)
  3. 03

    Step 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. 04

    Step 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.

    // 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.

Payments through RevenueCat on the demo site, Quillbook, on generated traffic. Prices are the demo company's. Open it in the demo 
  • 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 cover your whole history.
  • Notes and limits

    • 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, and Paddle purchases through 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.

The docs page covers the optional steps this guide leaves out.

Setup questions. Straight answers.

What people ask before they connect it.

  • 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.

  • 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.

  • 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.

  • CrispStats removes its webhook from the project and destroys the saved key. Purchases 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.

  • Stripe revenue attribution

    Connect Stripe to CrispStats with a restricted key and pass the visitor id at checkout, so every payment, renewal and refund is tied to the visit behind it.

  • Paddle revenue attribution

    Connect Paddle Billing to CrispStats with an API key and pass the visitor id in customData, so each transaction, renewal and refund is tied to its visit.

  • Web analytics for SaaS products

    See which channels bring paying customers, where trials stall in the funnel, and how your app performs for real users, from one cookieless script.

  • 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.

Guides

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.