Skip to content

Payment providers

Creem revenue attribution with CrispStats

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.

Updated

Set up CrispStats on Creem

  1. 01

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

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

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

    Step 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
    // In the browser, before you send the visitor to checkoutconst visitorId = await crispstats.id();// On your server, when you create the checkoutawait 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.

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

    • 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 or expansion. Creem, as merchant of record, stays the source of truth for billing and tax.

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

Setup questions. Straight answers.

What people ask before they connect it.

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

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

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

  • CrispStats deletes its webhook in Creem 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

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.