What a referrer is
When someone clicks a link on page A that goes to page B, the browser usually tells page B where the click came from. The request carries a Referer header, and the page can read the same value in JavaScript as document.referrer. The header name is a misspelling of "referrer" that the web has kept ever since.
The referrer is the oldest way to tell where traffic comes from, and it needs no work from you. Its weakness is that the sending side decides how much to share, and often shares nothing.
How much the browser sends
The linking page's Referrer-Policy controls the referrer. Browsers default to strict-origin-when-cross-origin:
| Click | Referrer your site receives |
|---|---|
From https://blog.example.org/post/42?ref=x to your HTTPS site | https://blog.example.org/ (origin only) |
| From a page on your own site to another of your pages | The full URL, path and query string included |
| From an HTTPS page to an HTTP page | Nothing |
From a page with no-referrer | Nothing |
So for visits from other sites you normally learn the domain, not the exact page. Search engines, social networks and webmail set their own policies, and many apps open links without any referrer at all.
How to use referrer data
- Read referrers by domain, then group them into channels: search engines, social networks, AI assistants and everything else.
- Exclude your own domains, or every click between your pages looks like a new source. Payment pages that send customers back also need excluding.
- Add UTM parameters to links you control. Tags survive where referrers don't, and they name the campaign.
- Expect a share of visits with no referrer. They end up in direct traffic, and part of that is dark social.
Common mistakes
- Expecting the full URL. Cross-site referrers are usually the origin only.
- Counting self-referrals as a source, which hides the channel that actually brought the visitor.
- Reading
t.coorl.facebook.comas the source. These are link wrappers; group them with X and Facebook. - Assuming no referrer means someone typed your URL. Most of those visits came from apps, email or private chats.
How MetricRaven handles referrers
The MetricRaven script sends document.referrer with each pageview. The server keeps only the referrer's host, such as news.ycombinator.com, and drops it when the host is one of your own website's domains, so moving between your pages never creates a source.
- Referrers decide the channel when no tag does: an AI assistant host such as chatgpt.com or perplexity.ai is AI, a social network is Social, a search engine such as Google, Bing or DuckDuckGo is Organic Search, and any other site is Referral.
- One place has one name:
www.instagram.com,instagram.comandutm_source=instagramare all shown as Instagram. - For X, the full
t.colink is kept so MetricRaven can find the post that contained it (X link attribution). - Each referrer shows visitors and revenue, credited to the customer's first tracked visit.
See Campaign & referral links for the channel order.
Questions
- Why is the Referer header spelled wrong?
- It is a misspelling of "referrer" that stuck: renaming a header every browser and server already uses would break existing software. The newer
Referrer-Policyheader uses the correct spelling. - Why do I only see the domain, not the page that linked to me?
- Browsers default to the
strict-origin-when-cross-originpolicy, which sends only the origin, such ashttps://blog.example.org/, when the link goes to another site. - Why do many visits have no referrer?
- Email clients, chat apps, many mobile apps, bookmarks and pages with a
no-referrerpolicy send none. Those visits are counted as direct traffic unless the link carries UTM or ref tags. - What is a self-referral?
- A visit whose referrer is your own site, often after a redirect or a return from checkout. Analytics should ignore your own domains so these don't replace the visitor's real source.