← Back to all articles

Growth Ops

How to track revenue attribution in web analytics

Revenue attribution is connecting a completed payment back to the marketing channel, campaign, or session that originally brought that customer. This guide explains how it works, why most tools cannot do it, and how to set it up in minutes.

What is revenue attribution?

Revenue attribution is connecting a completed payment back to the marketing channel, campaign, or session that originally brought that customer. It answers a single high-value question: which of your channels actually produces money, not just clicks.

Without it you have two disconnected stories. One says you got 4,000 visitors from search, social, and a newsletter. The other says you earned $1,200 this week. Revenue attribution stitches them together so you can see that the newsletter drove $700 of that and search drove almost nothing, which tells you exactly where to spend your next hour.

Why can most analytics tools not do it?

Most analytics tools cannot do revenue attribution because traffic tools and payment tools live on opposite sides of a wall. Neither one has both halves of the answer.

  • Traffic tools do not see payments. Plausible, Fathom, Umami, and most pageview analytics know where a visitor came from but have no idea who paid or how much.
  • Payment tools do not see traffic source. Stripe, Dodo, Lemon Squeezy, and Razorpay know exactly who paid and how much, but they do not record that the buyer first arrived from a specific X post or UTM campaign.
  • Generic tools need heavy setup. GA4 can in theory connect the two, but it takes purchase events, value parameters, and reconciliation work that most solo founders never finish.

The fix is to give both sides a shared key so the payment and the visitor session can be matched. That is what makes attribution possible.

How does revenue attribution actually work?

Revenue attribution works in two stages: first match the payment to a visitor session, then classify how that session originally landed. AnalyzeUser does both automatically once a payment provider is connected.

Stage 1: match the payment to a session

  1. The preferred method is a visitor id stamped into the checkout metadata at payment time. This is deterministic: the same id is on the payment and on the visitor's tracked events, so the match is exact.
  2. The fallback is email. If no visitor id is present, the tool tries to match the buyer's email to a tracked session. This is less reliable, since a normal pageview rarely carries the buyer email, so email-only matches often land as Unknown.

Stage 2: classify how the session first landed

  • Read the first event of that visitor's session and determine the source.
  • UTM tags beat referrer, because paid and social in-app browsers often arrive with an empty referrer.
  • The session is sorted into one channel: Direct, Search, AI, Social, Email, Paid, or Referral.
  • Self-referrals are excluded, so your own domain never gets credited as a traffic source.

The result: each payment carries a clean source label, and the dashboard groups your revenue by channel. Payments that cannot be matched are honestly labeled Unknown rather than guessed.

How do you set up revenue attribution with AnalyzeUser?

You set up revenue attribution with AnalyzeUser in three steps: connect your payment provider, pass the visitor id at checkout, and read revenue-by-source in the dashboard and daily email.

  1. Connect your payment provider. In the Integrations tab, connect Stripe, Dodo Payments, Lemon Squeezy, or Razorpay with a read-only key. AnalyzeUser only reads payment data; it never moves money.
  2. Pass the visitor id at checkout. Read the id with window.analyzeUser.getVisitorId() and put it into your checkout metadata. For example: metadata: { au_visitor_id: window.analyzeUser.getVisitorId() }. This is the key that makes the match deterministic.
  3. Read revenue-by-source. Your MRR, subscribers, and payments appear beside your traffic, broken down by the channel that drove each sale, both in the dashboard and in your plain-English daily email.

If a payment lands before the buyer's tracked events arrive, AnalyzeUser retries attribution on later syncs, so the webhook timing race does not leave revenue stuck as Unknown.

What are the common revenue attribution mistakes?

The most common attribution mistakes all come from broken or missing links between the payment and the session. Avoiding them is most of the battle.

  • Not passing a visitor id at checkout. Without it you fall back to email matching, which usually produces Unknown.
  • Crediting self-referrals. Internal navigation can look like a referral from your own domain if it is not excluded.
  • Trusting referrer over UTM. Paid and social in-app browsers strip the referrer, so UTM tags should win when both are present.
  • Guessing instead of labeling Unknown. A fabricated source is worse than an honest Unknown, because it sends you spending in the wrong direction.
  • Ignoring the timing race. Webhooks fire instantly, but batched events arrive seconds later, so attribution should retry rather than give up on the first attempt.

Try AnalyzeUser free for 14 days

No credit card. No setup fee. Paste one snippet and get your first morning briefing tomorrow. See your revenue alongside your traffic in the same dashboard.

Frequently asked questions

What is revenue attribution in analytics?

Revenue attribution in analytics is connecting a completed payment back to the marketing channel, campaign, or session that originally brought that customer. Instead of only seeing that money came in, you see that a $49 subscription came from a Google search, an X post, or a specific UTM campaign. It turns raw traffic data into a clear answer about which channels actually produce revenue.

Why does my revenue show as Unknown source?

Revenue shows as Unknown when the analytics tool cannot match a payment to a tracked visitor session. This usually happens because no shared key (like a visitor id) was passed into the checkout, the buyer's events had not arrived yet when the payment fired, or the original landing session aged out of the data window. AnalyzeUser reduces Unknowns by stamping its visitor id into checkout metadata and retrying attribution on later syncs to catch the timing race.

Can Google Analytics track revenue attribution?

Google Analytics can track revenue attribution, but it is complex to set up correctly. You need to configure purchase events, pass transaction and value data, often wire up server-side or enhanced ecommerce tracking, and reconcile it against your payment processor. For a solo founder it is a lot of plumbing. A tool that connects directly to Stripe or Lemon Squeezy with a read-only key gives the same answer with far less configuration.

How do I attribute Stripe revenue to a marketing channel?

To attribute Stripe revenue to a marketing channel, connect Stripe to your analytics with a read-only key and pass a visitor id into the Stripe checkout metadata at the moment of payment. The analytics tool then matches that id to the visitor's first session and reads how they originally landed (UTM, referrer, or channel). In AnalyzeUser you connect Stripe in the Integrations tab and pass window.analyzeUser.getVisitorId() into checkout, and revenue-by-source appears in the dashboard and daily email.

What is first-touch vs last-touch attribution?

First-touch attribution credits the channel that first brought a visitor to your site, while last-touch credits the channel of the session in which they converted. First-touch answers what creates awareness; last-touch answers what closes. AnalyzeUser uses session first-touch attribution for revenue, crediting how the buyer's session originally landed, with UTM tags taking priority over referrer and self-referrals excluded.

See what worked, what broke, and what made you money.

Privacy-friendly analytics that emails you the answers every morning, in plain English. No cookies, set up in minutes.

Start free
14 days freeNo credit cardOne-line install

Keep reading

Comparisons11 Best Google Analytics Alternatives in 2026 (Free & Paid)12 min readPrivacyWhat Is Cookieless Analytics? A Plain-English Guide for 20268 min readComparisonsPlausible Alternative: AnalyzeUser vs Plausible (2026)9 min read