---
title: "How to see which traffic sources make money"
description: "Connect your payments to your analytics so every channel, referrer, campaign and page shows the revenue it brought, not just visits. Free with DataPocket."
url: "https://datapocket.vo1d.studio/guides/revenue-by-traffic-source"
lang: "en"
updated: "2026-11-23"
---

# How to see which traffic sources make money

Connect your payment provider to your analytics so each sale is matched to its visitor. The sale is then credited to the channel, campaign and landing page of that visitor's first visit, and every traffic report can be sorted by revenue. DataPocket does this for free with Stripe, Shopify, WooCommerce or any provider through its Payment API.

What this guide answers:

- Why aren't visits enough?
- How do you set it up?
- Which visit gets the credit for a sale?
- What about payments sent from your backend?

## Why aren't visits enough?

A source that sends a thousand visitors and no buyers is worth less than one that sends fifty visitors and five sales. Visit counts hide that. Revenue per channel and revenue per visitor show it straight away, so you know where the next hour of marketing should go.

Many analytics tools stop at visits or put revenue behind a higher plan. See how DataPocket compares with [Google Analytics 4](https://datapocket.vo1d.studio/compare/google-analytics), [Plausible](https://datapocket.vo1d.studio/compare/plausible) and [DataFast](https://datapocket.vo1d.studio/compare/datafast) on revenue by channel. Paying per pageview today? [Fathom starts at $15 a month](https://datapocket.vo1d.studio/compare/fathom) and [Simple Analytics at $20](https://datapocket.vo1d.studio/compare/simple-analytics) for 100k pageviews, before any revenue report.

> **Already paying for analytics?** Each comparison puts the vendor's published prices and limits next to DataPocket's, and says when the other tool is the better pick. [See every comparison](https://datapocket.vo1d.studio/compare)

## How do you set it up?

1. Add the tracking script to your site: one script tag, under 5 KB gzipped, loaded with `defer`. Pick your platform in the [install guides](https://datapocket.vo1d.studio/docs).
2. Connect your payments in Settings → Revenue: Stripe, Shopify or WooCommerce, or send payments from your backend with the Payment API.
3. Open any breakdown (channels, referrers, pages, campaigns, countries) and sort it by revenue.

## Which visit gets the credit for a sale?

DataPocket credits each sale to the buyer's first visit: the channel, source, campaign and landing page that first brought them. That's the question most small teams want answered (what finds us customers?), and it stays stable when a buyer returns later by typing your address.

![Diagram of first-visit attribution: a buyer arrives from a newsletter on /pricing, returns as Direct, then pays, and the sale is credited to the newsletter](https://datapocket.vo1d.studio/guides/revenue-by-traffic-source/first-visit-revenue-attribution-flow.svg)

Customer journeys show the whole path for each buyer: every visit, how long it took and what they spent.

## What about payments sent from your backend?

Read the `dp_vid` cookie when the buyer checks out and send it with the payment:

```bash
curl -X POST https://datapocket.vo1d.studio/api/v1/payments \
  -H "Authorization: Bearer dpk_…" \
  -H "Content-Type: application/json" \
  -d '{"amount": 29.99, "currency": "USD", "transaction_id": "order_123", "visitor_id": "<dp_vid cookie>"}'
```

Requests are idempotent on `transaction_id`, and other currencies are converted automatically.

## Questions

### Do I need to change my checkout?

Not with Stripe Checkout or Payment Links: add `?session_id={CHECKOUT_SESSION_ID}` to the success URL and connect a restricted key. Shopify and WooCommerce don't need checkout changes either. Other providers need one API call per payment.

### Are refunds subtracted?

Yes. Stripe, Shopify and WooCommerce refunds sync automatically and refunded payments don't count as revenue.

### What about subscription renewals?

Stripe renewals inherit the visitor of the customer's first payment, so recurring revenue stays on the channel that found the customer. You can choose whether renewals count in the totals.

## Related

- [Track Stripe revenue by traffic source](https://datapocket.vo1d.studio/guides/stripe-revenue-attribution)
- [How to see traffic from ChatGPT, Perplexity and other AI assistants](https://datapocket.vo1d.studio/guides/chatgpt-traffic)
- [DataPocket vs Google Analytics 4](https://datapocket.vo1d.studio/compare/google-analytics)
- [All guides](https://datapocket.vo1d.studio/guides)
