# Freemius revenue attribution with CrispStats

Updated 2026-11-28

Connect Freemius in CrispStats by pasting your product's API Bearer Authorization Token and numeric Product ID. CrispStats imports your past payments, renewals and refunds, then polls Freemius every 2 minutes while separating production and sandbox transactions.

## Steps

### 1. Open the Freemius panel

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

### 2. Copy your API Bearer token and Product ID

Open your product in the **Freemius Developer Dashboard**, then go to **Settings** and **API & Keys**. Copy your numeric **Product ID** at the top of the page and your **API Bearer Authorization Token** (generate one if none is shown).

### 3. Paste the token and Product ID

Paste them into **API Bearer token** and **Product ID**, then select **Connect Freemius**. CrispStats checks them with Freemius, reads your product name, saves the token encrypted and imports past payments.

### 4. Link checkout sessions (optional)

Freemius REST payment responses do not carry custom checkout metadata fields. When embedding Freemius Checkout on your site, call `crispstats.identify()` inside `purchaseCompleted` with the customer's Freemius user id so sales link back to their visit.

`checkout.js`

```js
// In Freemius Checkout's purchaseCompleted callback
handler.open({
  plan_id: "1234",
  purchaseCompleted: function (response) {
    var uid = response?.purchase?.user_id || response?.user?.id;
    if (uid) window.crispstats?.identify(String(uid));
  },
});
```

## Check that it works

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

- All Freemius one-time payments, new subscriptions and subscription renewals broken out cleanly.
- Tax-inclusive totals (`gross + vat`) in each customer's payment currency with minor-unit precision.
- Refunds and lost disputes recorded as negative payments tied back to their original sale.
- Production (`environment: 0`) and sandbox (`environment: 1`) transactions separated automatically.
- Complete payment history imported on connect, so revenue and [MRR](/glossary/mrr) cover past activity.

## Notes for Freemius

- Freemius webhooks are managed only in the Developer Dashboard UI, so CrispStats polls Freemius every 2 minutes. New payments appear within 2 minutes.
- If you also add a webhook in Freemius pointing to CrispStats, signed events are verified against Freemius's API and deduplicated by payment id.
- Live and sandbox payments arrive on the same API token. Sandbox purchases are marked with a Test badge and never count toward verified revenue.
- 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.
- CrispStats does not replace Freemius payout or VAT accounting reports. Freemius remains the source of truth for taxes and payouts.

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

## Frequently asked questions

### How fresh are Freemius numbers?

CrispStats checks Freemius every 2 minutes, so new sales, renewals and refunds appear within 2 minutes.

### Are sandbox payments kept out of revenue?

Yes. Freemius returns both live (environment 0) and sandbox (environment 1) records on one token, and sandbox transactions stay in test mode only.

### Can I import past Freemius payments?

Yes. Connecting imports your past payments, renewals and refunds automatically.

### What happens when I disconnect Freemius?

CrispStats destroys the saved API token and stops polling. Already imported payments stay in your dashboard.

### Is Freemius supported on every plan?

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

## Related

- [Revenue attribution: which traffic pays](/features/revenue-attribution)
- [First touch vs last touch attribution](/blog/revenue-attribution-first-touch-vs-last-touch)
- [Web analytics for SaaS products](/for/saas)
- [Revenue per visitor calculator](/tools/revenue-per-visitor-calculator)
