# Revenue by source

> Send a value with the event that means someone paid, and Clerion shows visitors, payers, pay rate and revenue for each source, AI assistants included.

Clerion shows which traffic source brings paying customers once your site sends one custom event with a value at the moment someone pays, for example `window.clerion.trackEvent("purchase", { value: 49, currency: "USD" })`. The Custom events page then has a card called Where paying customers came from, with visitors, payers, pay rate and revenue for every source, ChatGPT and the other assistants included. There is nothing to switch on in the dashboard.

[Revenue by source in Clerion: the cursor runs down the sources to chatgpt.com, the one with the highest pay rate, then down to why visitors left the checkout](/product/clips/customers.mp4 "clip")

## Before you start

The Clerion snippet must be on every page a buyer passes through, including the page where the payment is confirmed. If it is not installed yet, [set up Clerion](https://getclerion.com/docs/quickstart) first.

You need one event that fires when money actually changes hands: a purchase, a subscription started, an upgrade. If you already send that event without a value, add the value and the card fills in from then on.

## Send the payment event with a value

Fire the event on the confirmation page, or in the success callback of your checkout, and pass the amount:

```js
window.clerion.trackEvent("purchase", {
  value: 49,
  currency: "USD",
});
```

For a subscription, send the first payment:

```js
window.clerion.trackEvent("subscription_started", { value: 29, currency: "USD", plan: "growth" });
```

The amount can sit in `value`, `orderValue` or `revenue`, as a number or a numeric string such as `"49"`. A formatted string like `"$49.00"` is ignored. If one site takes more than one currency, the card shows the one seen most often, and amounts are summed as they arrive, without conversion.

On a confirmation page that is rendered after the payment, read the amount from the page and send it once:

```html
<!-- /thank-you, rendered by your server with the order in it -->
<script>
  window.addEventListener("load", () => {
    window.clerion?.trackEvent("purchase", { value: 49, currency: "USD", order: "A1042" });
  });
</script>
```

In a React or Next.js app, send it from the success state, once:

```tsx
useEffect(() => {
  if (order.status === "paid") window.clerion?.trackEvent("purchase", { value: order.total, currency: order.currency });
}, [order.status]);
```

If your checkout is hosted elsewhere, for example by a payment provider, send the event on the page the provider returns the buyer to. Include the amount yourself; Clerion does not read it from the provider.

You can also use the HTML attribute instead of JavaScript. The full reference for events is in [How to track custom events and conversions in Clerion](https://getclerion.com/docs/custom-events).

## Read the card

Open your site, go to Behavior, then Custom events, and scroll below All events. Where paying customers came from lists every source that sent visitors in the selected period:

| Column | What it means |
|---|---|
| Source | Where the visitor came from: an assistant such as chatgpt.com or perplexity.ai, a referring site, or Direct. |
| Visitors | People who arrived from that source in the period. On the cookie-free setup each visit counts on its own. |
| Paid | How many of them sent an event with a value above zero. |
| Pay rate | Paid as a share of Visitors. |
| Revenue | The sum of their payments, in the site's most common currency. |

The bar behind each source is its share of the period's revenue. The source at the top is the one that brought the most money, which is often not the one that brought the most visitors.

The same figures reach your briefing and Ask Clerion. A question such as "which channel brings paying customers?" is answered from them.

## How a payment is credited

Clerion credits each payment to a source in one of two ways, depending on whether it can recognise the visitor on a later visit.

| Your setup | Who a payment is credited to |
|---|---|
| Default, cookie-free (no consent banner) | The source of the visit in which the payment happened. Clerion keeps no identifier between visits, so a visitor who came from ChatGPT on Monday and paid after typing your address on Friday counts under Direct. |
| Consent banner on, and the visitor accepted | The source of that visitor's first visit in the selected period, across visits, for up to a year after they accepted. |

Assistants are recognised even when they hide the referrer, from links tagged with `utm_source`, `ref` or `source` naming the assistant. Other tagged links, such as a newsletter, are counted by their referrer here; their full breakdown is under Campaigns.

## Limits

| Limit | What it means for you |
|---|---|
| First touch inside the period | A customer whose first visit was before the selected range is credited to their first visit inside it. Widen the range to look further back. |
| Payments in the browser only | The payment has to be sent from a page with the snippet. Clerion does not connect to Stripe or another provider, so it shows what your events report, not MRR, churn or refunds. |
| A page view is needed | A payment from someone with no page view in the period has no source to credit, and is left out of the card. |
| Very busy sites | The card reads up to 150,000 events per site for the range. Above that it says so, and a shorter range can bring it back. |

## If the card says to pass a value

The card shows a hint instead of a table when no event in the period carried a value above zero. Check three things:

1. The event fires after the payment succeeds, not when the buy button is clicked.
2. The amount is a number or a plain numeric string, not `"$49.00"`.
3. The page that fires it has the snippet, and the event shows up in the All events table above.

## Questions

### Does this work without a cookie banner?

Yes. On the default cookie-free setup each payment is credited to the source of the visit it happened in. The consent banner only adds following a visitor across visits.

### Can I see ChatGPT revenue on its own?

Yes. chatgpt.com, perplexity.ai, claude.ai, gemini.google.com and the other assistants each have their own row, with their own pay rate and revenue.

### Why does Direct have so much revenue?

On the cookie-free setup, people who come back by typing your address or from a bookmark to pay count as Direct, because the visit that paid had no referrer. Turning on the consent banner credits accepted visitors to their first visit instead.

### Is this the same as the value in the All events table?

The total is the same money. All events sums it per event name; this card splits it by where the payers came from.

---

Source: https://getclerion.com/docs/revenue-by-source (Clerion docs, Tracking). The whole manual as one file: https://getclerion.com/docs/everything.md
