# How to attribute revenue to traffic sources: first touch vs last touch

The CrispStats team · Published 2026-11-16 · Updated 2026-11-29

**TL;DR:** To attribute revenue to a traffic source you need two things: a rule for who gets the credit, and a way to join each payment to a visit. First touch credits the source that introduced the customer, last touch credits the source of the visit that ended in payment. The join is done by passing an anonymous visitor id into your checkout as metadata, so the payment webhook can carry it back to your analytics.

Traffic reports tell you where visitors come from. Payment reports tell you how much money arrived. Neither tells you which visitors paid, and that is the question you actually have when you decide where to spend next month's time or budget.

Revenue attribution closes that gap. It has a simple part (the bookkeeping rule) and a fiddly part (the plumbing). This guide covers both.

## What is revenue attribution?

It is the practice of assigning each payment to the traffic source, campaign or page that led to it. The output is a table where every source has not only visitors but revenue next to it, and from those two numbers a [revenue per visitor](/glossary/revenue-per-visitor).

The rule that decides who gets the credit is the [attribution model](/glossary/attribution-model). There are three families worth knowing.

## First touch, last touch and multi-touch: what is the difference?

### First touch

[First touch](/glossary/first-touch-attribution) gives all the credit to the source of the customer's first known visit. It answers "what introduces us to people who end up paying?" It favours discovery channels: search, social posts, a mention in an AI assistant, a podcast.

### Last touch

[Last touch](/glossary/last-touch-attribution) gives all the credit to the source of the visit in which the payment happened. It answers "what was the final push?" It favours closing channels: email, branded search, retargeting ads, and direct visits from people who typed your address.

### Multi-touch

[Multi-touch](/glossary/multi-touch-attribution) models split the credit across every known visit: evenly ([linear](/glossary/linear-attribution)), weighted toward the most recent ([time decay](/glossary/time-decay-attribution)), or weighted toward the first and last ([position based](/glossary/position-based-attribution)). They sound fairer. In practice they need a long, reliable history per person, and the weights are a choice, not a measurement.

| Model | Credit goes to | Good for | Blind spot |
| --- | --- | --- | --- |
| First touch | The first known source | Judging discovery channels | Ignores what closed the sale |
| Last touch | The source of the paying visit | Judging closing channels | Over-credits direct and email |
| Multi-touch | Every known visit, by a weight | Long sales cycles with logins | Needs identity across visits; weights are arbitrary |

## A worked example

Say one customer takes this path to a $49 purchase:

1. Monday: finds a blog post through Google and leaves.
2. Wednesday: clicks a link in your newsletter, reads the pricing page, leaves.
3. Friday: types your address, signs up and pays $49.

| Model | Organic search | Email | Direct |
| --- | --- | --- | --- |
| First touch | $49 | $0 | $0 |
| Last touch | $0 | $0 | $49 |
| Linear multi-touch | $16.33 | $16.33 | $16.33 |

Same customer, same money, three different stories. None is wrong. Last touch here says "direct" earned $49, which tells you nothing you can act on. First touch says the blog post did, which is at least a decision: write more of those. That is why many small teams start with first touch and look at last touch as a second opinion.

> **The honest limit.** Any model can only credit visits it can connect to the same person. If the Monday visit was on a phone and the Friday purchase on a laptop, most tools will see two strangers, and "first touch" becomes "first touch on the device that paid".

## How do you connect a payment to a visit?

This is the plumbing. Your analytics knows the visitor as an anonymous id. Your payment provider knows the customer as an email and a charge. Something has to carry the first id into the second system. The reliable way is checkout metadata.

1. **Read the visitor id in the browser** just before you start the checkout.
2. **Send it to your server** with the checkout request.
3. **Attach it to the checkout** as metadata or a client reference when you create the session with your payment provider.
4. **Let the webhook bring it back.** When the payment succeeds, the provider's webhook includes the metadata, and your analytics can file the payment under the right visit and source.

With CrispStats the first two steps look like this:

```js
// In the browser, when the visitor clicks "Buy"
const visitorId = await crispstats.id();

await fetch("/api/checkout", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ plan: "pro", visitorId }),
});
```

And on the server, using Stripe Checkout as the example:

```js
// On your server
const session = await stripe.checkout.sessions.create({
  mode: "subscription",
  line_items: [{ price: PRICE_ID, quantity: 1 }],
  client_reference_id: visitorId,
  metadata: { crispstats_visitor_id: visitorId },
  success_url: "https://example.com/welcome",
  cancel_url: "https://example.com/pricing",
});
```

Other providers have the same idea under different names: custom data, metadata, passthrough. Whichever you use, the pattern does not change. The id travels with the checkout and returns with the webhook, so no personal data has to be matched by hand.

## What goes wrong in practice?

- **The payment page becomes the source.** A customer leaves your site for a hosted checkout and returns to a thank-you page. If your tool treats that return as a new visit, the payment provider's domain shows up as a top "referrer" and steals the credit. Attribute to the visit that started the checkout, not the one that came back from it.
- **Cross-device and cross-day paths.** Someone who discovers you on a phone and buys on a laptop a week later looks like a direct visitor who paid at once. Identifying logged-in users with your own user id narrows this gap; nothing closes it fully.
- **Renewals.** A subscription's second invoice has no visit behind it. Decide once whether renewals inherit the source of the original purchase (useful for lifetime value by channel) or are reported separately (useful for judging this month's marketing). Keep new and renewal revenue as separate lines either way.
- **Refunds.** Record them as negative payments against the same source, on the date they happened. Deleting the original payment rewrites history and makes last month's report change under you.
- **Untagged campaigns.** A newsletter click with no UTM parameters often arrives with no referrer and is filed as [direct traffic](/glossary/direct-traffic). Tag your own links; the [UTM builder](/tools/utm-builder) takes a minute.
- **Counting your own tests.** Test purchases and staff visits inflate small numbers quickly. Exclude your own browser and use the provider's test mode.

## Which model should you use?

Pick the model that matches the decision. If you are choosing where to find new customers, use first touch. If you are tuning the final step (pricing page, email sequence, checkout), look at last touch. If the two disagree wildly for a channel, that is information: the channel either opens doors or closes sales, rarely both.

Whatever you choose, compare channels on revenue per visitor rather than total revenue. A source with 200 visitors and $600 in sales ($3.00 per visitor) deserves more attention than one with 5,000 visitors and $1,000 ($0.20 per visitor). The [revenue per visitor calculator](/tools/revenue-per-visitor-calculator) shows what a small lift is worth.

## Which rule CrispStats uses, and why

CrispStats uses first touch, and only first touch, because the decision most small teams bring to revenue data is the first one above: where to find the next customers. It does not show a last-touch view, so for tuning the final step you need another report. [Revenue attribution](/features/revenue-attribution) works through webhooks from Stripe, Lemon Squeezy, Polar, Paddle, Dodo, Creem, Razorpay and RevenueCat, or through a server-side payment API if you bill another way. You pass the visitor id into checkout metadata as shown above. When the payment arrives it is filed under the first touch known for that visitor: source, channel, campaign and landing page.

Because visitors are recognised by a hash that rotates daily, "first touch known" means the first visit that can be connected to the payer. A purchase made on the day of the first visit is credited to that visit's source. Refunds are listed as negative payments, and new and renewal revenue are reported as separate figures. The customer's email address is never stored. Setup steps for each provider are in the [revenue docs](https://docs.crispstats.com/revenue/overview).

## What is last non-direct touch on this $49 purchase?

Friday's visit is direct: the customer typed the address. Last non-direct touch skips that visit and gives the $49 to Wednesday's newsletter. The path is the same hypothetical purchase as the worked example.

One hypothetical $49 purchase. Only the rule changes.

| Model | Organic search | Email | Direct |
| --- | --- | --- | --- |
| First touch | $49 | $0 | $0 |
| Last touch | $0 | $0 | $49 |
| Last non-direct touch | $0 | $49 | $0 |

**The mistake that changes the number.** Reading the email row as last touch. The customer did not pay during the newsletter visit. Direct was skipped, so the newsletter inherited the close. The same kind of path, run through linear, [time decay](/glossary/time-decay-attribution), [position-based](/glossary/position-based-attribution) and [data-driven](/glossary/data-driven-attribution) models, is in [marketing attribution models explained](/blog/marketing-attribution-models-explained). Splitting the $49 across the three visits is the [multi-touch guide](/blog/multi-touch-attribution-guide).

## When does first touch credit a later visit?

First touch means the first visit the tool can tie to the payer, inside the [attribution window](/glossary/attribution-window). On this $49 purchase, two hypothetical gaps both move the credit from organic search to email.

Same customer and same $49. Only the visits that enter the model change.

| What the tool can see | First touch credits | Amount |
| --- | --- | --- |
| Monday's Google visit is tied to Friday's payment | Organic search | $49 |
| Monday was another device and is not tied to the payer | Email, the first visit that is tied | $49 |
| Monday was 40 days earlier and the window is 30 days | Email, the first visit inside the window | $49 |

**The mistake that changes the number.** Treating the report's first touch as the customer's first visit ever. It is the first connected visit inside the window. [Last-touch attribution](/glossary/last-touch-attribution) on Friday is still direct in all three rows.

## Frequently asked questions

### Is first touch or last touch attribution better?

Neither is better in general. First touch shows which sources introduce future customers, so it suits decisions about where to find new people. Last touch shows what was happening when they paid, so it suits decisions about the final steps. Many teams read both.

### Do I need cookies to attribute revenue?

No. The join between a visit and a payment is made by passing an anonymous visitor id into the checkout as metadata and reading it back from the payment webhook. That works without storing anything on the visitor's device, within the period the id stays valid.

### Why does so much revenue show up as direct?

Usually because the paying visit had no referrer: the customer typed the address, used a bookmark, clicked an untagged link in an email or app, or returned on a different day or device. Tagging your own links with UTM parameters and crediting the first known touch both reduce it.

### How should refunds be handled in attribution reports?

As negative payments on the date of the refund, credited to the same source as the original payment. That keeps past periods stable and lets net revenue by channel add up.

### What is last non-direct touch attribution?

It gives the whole payment to the last visit that had a known source, and skips direct visits such as a typed address or a bookmark. If the paying visit is direct, the previous campaign, email or referral gets the credit.

### Why would first touch credit a visit that was not the customer's first?

First touch is the first visit the tool can connect to the payer, inside its attribution window. A visit on another device, or a visit older than the window, is left out, and the next recorded visit takes the full credit.
