# Revenue attribution

> How Revfaro links each payment to the visitor who paid and credits the marketing channel that brought them, and how payments without a visitor ID are matched.

**In short:** Your payment provider sends each payment to Revfaro by webhook (or your server sends it with the Payments API). Revfaro finds the visitor who paid, first from the visitor ID you pass to the checkout, then from the return page, an earlier payment, an identified email or checkout timing, and credits the payment to that visitor's last visit from a real source (last non-direct touch). Refunds are subtracted and renewals keep the original source.

## How does revenue attribution work?

### The script remembers the visitor

When someone visits your site, the script gives them a visitor ID (the `rf_vid` cookie) and records where every visit came from.

### Your checkout carries the visitor ID

When the visitor starts a checkout, the visitor ID travels with it: your server adds it to the checkout's metadata, or the script adds it to checkout links on your pages automatically. The guide for your provider shows exactly how.

### Your provider reports the payment

Stripe, Dodo Payments, Lemon Squeezy or Polar sends the payment by webhook. Your existing [Telegram bot server](https://revfaro.com/docs/telegram-payments/) can forward verified payment updates, and other providers can use the [Payments API](https://revfaro.com/docs/payments-api/). These server notifications work even when the buyer's browser blocked the script.

### Revfaro credits the source

The payment is linked to the visitor and credited to their last visit from a real source. It then appears in your dashboard as revenue for that channel, referrer, campaign, page and country.

Telegram attribution uses a trusted visitor/session pair supplied by your bot server, or an earlier payment by the same Telegram customer on this website. It does not guess from checkout timing or return-page links. Telegram Stars remain in XTR without fiat conversion; only payments matching the website's reporting currency count in totals.

## Connect your payment provider

Open **Website settings › Setup** and find **Connect payments**. Pick your provider; the card shows only its setup, with your website's webhook address ready to copy.

| Provider      | Guide                                         | Events to send                                                                                     |
| ------------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| Stripe        | [Connect Stripe](https://revfaro.com/docs/stripe/)               | `checkout.session.completed`, `invoice.paid`, `charge.refunded`                                    |
| Dodo Payments | [Connect Dodo Payments](https://revfaro.com/docs/dodo-payments/) | `payment.succeeded`, `refund.succeeded`                                                            |
| Lemon Squeezy | [Connect Lemon Squeezy](https://revfaro.com/docs/lemon-squeezy/) | `order_created`, `order_refunded`, `subscription_payment_success`, `subscription_payment_refunded` |
| Polar         | [Connect Polar](https://revfaro.com/docs/polar/)                 | `order.paid`, `order.refunded`                                                                     |
| Telegram      | [Connect Telegram](https://revfaro.com/docs/telegram-payments/)  | Forwarded `message.successful_payment` and `message.refunded_payment` updates                      |
| Anything else | [Payments API](https://revfaro.com/docs/payments-api/)           | Sent from your server                                                                              |

Revenue attribution is included in plans with the Revenue attribution feature; the Payments API also needs API access.

![The Connect payments card with a tab for each payment provider](https://revfaro.com/docs/img/payments-stripe.webp 'Website settings › Setup › Connect payments.')

## How are payments matched to visitors?

The surest link is the visitor and session IDs passed together with the checkout. Revfaro checks that the session belongs to that visitor on your website. When a payment arrives without one (a payment link opened on another device, metadata your code didn't set, or a buyer who blocked the script), Revfaro tries these, in order:

1. **The return page.** After paying, your provider sends the buyer back to your site with the payment's ID in the address: `?session_id=` from Stripe, `?payment_id=` from Dodo Payments, `?checkout_id=` from Polar and `?order_identifier=` from Lemon Squeezy. The visitor who lands there is the buyer. Set this up in step 3 of your provider's guide.
2. **An earlier payment by the same customer.** Renewals and repeat purchases are credited to the visitor of the first payment.
3. **An identified email.** A visitor you [identified](https://revfaro.com/docs/identify-users/) with the buyer's email address.
4. **Checkout timing.** As a last resort, if exactly one visitor clicked a checkout link of Dodo Payments, Stripe, Lemon Squeezy or Polar (or completed a goal with `checkout`, `buy` or `purchase` in its name) in the 3 hours before the payment, that visitor is the buyer. When several did, the one who came back to your site right after paying wins. Revfaro never guesses between several equally likely visitors.

The **Journey** tab shows how each payment was matched: nothing extra for a visitor ID, or "matched by return page", "earlier payment", "email" or "checkout click timing". Payments that couldn't be matched show **Not attributed**.

> **Match older payments again**
> When payments are waiting for a visitor, the **Journey** tab shows how many and a **Try matching again** button (owners, admins and website managers). It runs the matching again for up to 500 unmatched payments and explains, for each one, why it did or didn't match. Use it after you set up a return page or started identifying users.

## Which source gets the credit?

Revfaro uses **last non-direct touch**: the payment is credited to the buyer's most recent visit that came from a real source. A visit is direct when it has no referrer and no campaign tag, such as a typed address or a bookmark.

For example: someone clicks your tweet, reads your pricing page and leaves. Seventeen days later they type your address and buy. The payment is credited to **X**, because the tweet was their last real source. If all of a buyer's visits were direct, the payment is credited as **Direct**.

## Renewals, refunds and currencies

- **Renewals** of a subscription are credited to the visitor who first subscribed and shown as **Returning**. They add revenue to the original source but don't count as new customers.
- **Refunds** are recorded as negative amounts, including partial refunds, so revenue is always net. A refund delivered before its payment is kept and applied when the payment arrives. Repeated or out-of-order partial refunds cannot reduce the total refunded.
- **Currencies** are not converted with estimated exchange rates. Amounts in another currency are retained in payment history and excluded from site totals, with a dashboard notice. Revenue is shown in the [website's revenue currency](https://revfaro.com/docs/add-a-website/#revenue-currency), so charge in that currency where you can. When Dodo Payments reports a settlement amount in that currency, it is used; for a website in USD, Lemon Squeezy's USD amount is used for orders in other currencies.
- **Test payments**: Lemon Squeezy test-mode orders are acknowledged but never counted. For other providers, connect the webhook of your live account; test payments sent to the same webhook would count as real ones.

## Where revenue appears

- **Overview**: Revenue, Conversion rate (the share of visitors who became paying customers) and Revenue/visitor, with the revenue line on the chart.
- **Sources, pages, locations and devices**: every row shows revenue next to visitors; switch a card to sort by revenue.
- **Goals**: revenue from the visitors who completed each goal.
- **Journey**: every payment with the buyer, their source, the amount and how long it took them to buy. See [Journeys and visitor profiles](https://revfaro.com/docs/journeys/).
- **Live view**: payments and refunds as they happen.

## Frequently asked questions

### What does last non-direct touch mean?

A payment is credited to the most recent visit that came from a real source, such as a search, a post, an ad or a newsletter, and not to a later visit where the buyer typed your address or used a bookmark. If every visit was direct, the payment is credited as Direct.

### What happens if a buyer blocks the tracking script?

The payment is still recorded, because it arrives by webhook from your payment provider. It just may not be linked to a visitor or a source.

### Are subscription renewals counted as new customers?

No. Renewals are credited to the visitor who first subscribed and are marked as returning, so they add revenue to the original source without counting a new customer.

### Does Revfaro convert currencies?

No. Revenue is shown in the website's revenue currency without exchange-rate conversion. Dodo Payments settlement amounts and Lemon Squeezy USD amounts are used when they match the website's currency.

---

Source: https://revfaro.com/docs/revenue-attribution/ · Last updated 2026-10-29
