# Traffic source classifier

Updated 2026-11-23

Paste a referrer or a tagged link and see the channel and source a visit is filed under, with the rule that decided it. Runs in your browser.

The interactive tool runs in the browser at /tools/traffic-source-classifier.

## What does the classifier do?

It takes what a visit arrives with (the [referrer](/glossary/referrer), the landing URL and any [UTM parameters](/glossary/utm-parameters)) and runs the same classification code CrispStats runs on every new visit. The result is a [traffic channel](/glossary/traffic-channel), a source name and the rule that decided it. It runs in your browser; nothing you paste is sent anywhere.

## In what order are the rules checked?

The first rule that matches wins. Campaign tags you set on purpose come before what the referrer says.

| Order | Rule | Channel |
| --- | --- | --- |
| 1 | `utm_medium` is cpc, ppc, paid, paid_social, cpm, cpv, cpa, retargeting or ads, or the URL has an ad click id such as `gclid`, `msclkid` or `fbclid` | Paid |
| 2 | `utm_medium` is email, e-mail, newsletter or mail | Email |
| 3 | `utm_medium` is affiliate, affiliates, partner or referral-program | Affiliate |
| 4 | `utm_medium` is display, banner or interstitial | Display |
| 5 | The referrer, or `utm_source`, is a known AI assistant (ChatGPT, Perplexity, Claude, Gemini, Copilot and others) | AI assistants |
| 6 | The referrer is a known search engine, or `utm_source` names one and `utm_medium` is organic | Organic search |
| 7 | The referrer or `utm_source` is a known social network (Facebook, FB and fb.com are one), or `utm_medium` is social | Social |
| 8 | The referrer or `utm_source` is a known video site, or `utm_medium` is video | Video |
| 9 | Any other referrer, or a `utm_source` with no medium that names a channel | Referral |
| 10 | No referrer and no campaign tags, or a referrer from your own site | Direct |

## Why does a Google visit sometimes count as paid?

Because rule 1 comes before rule 6. A click on a Google ad arrives with google.com as its referrer, just like an organic result, but its landing URL carries a `gclid`. The click id is the stronger signal, so the visit is paid.

## How is the source name chosen?

1. If the referrer is on one of the known lists, the source is its name: chatgpt.com becomes ChatGPT, news.ycombinator.com becomes Hacker News.
2. Otherwise a `utm_source` that names a known network is filed under that network's one name: Facebook, FB, fb.com and facebook.com are all Facebook. Any other value is lowercased, so Newsletter and newsletter share a row.
3. Otherwise it is the referrer's hostname without `www.`, or Direct when there is none.

## Why is so much traffic direct?

Many apps send no referrer: email clients, chat apps, PDFs and some AI assistant apps. Those visits look the same as someone typing your address. [Direct traffic](/glossary/direct-traffic) is shrunk by tagging the links you control with the [UTM builder](/tools/utm-builder). Our guide to [tracking visitors from AI assistants](/blog/track-ai-traffic-chatgpt-perplexity) covers the AI case in detail.

## Frequently asked questions

### Is this the exact logic CrispStats uses?

Yes. The tool imports the same classification function the CrispStats collector uses, so what you see here is what the dashboard will show.

### Does a UTM tag override the referrer?

A medium that names a channel does: paid, email, affiliate and display win over any referrer. A utm_source that names a known social network, video site or AI assistant also sets the channel when no stronger medium is set, and the spelling is folded into one source. A search-engine source counts as organic search only when the medium is organic, or when the referrer is the search engine itself.

### How are AI crawlers counted?

They are not part of this classification. Crawlers do not run JavaScript, so they never send a pageview. AI crawler hits are reported separately from server logs or middleware, by matching the User-Agent.

### Why does a visit from my own site show as direct?

A referrer from your own hostname means the visitor moved between your pages, not that someone sent them. Counting it as a referral would credit your own site for its own traffic.
