MetricRaven

Tracking

What is a referrer in web analytics?

Also called: HTTP Referer header

A referrer is the address of the page that linked a visitor to your site, sent by the browser in the HTTP Referer header and exposed to scripts as document.referrer. Analytics tools use it to tell which website, search engine or app sent each visit.

Updated

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:

ClickReferrer your site receives
From https://blog.example.org/post/42?ref=x to your HTTPS sitehttps://blog.example.org/ (origin only)
From a page on your own site to another of your pagesThe full URL, path and query string included
From an HTTPS page to an HTTP pageNothing
From a page with no-referrerNothing

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

  1. Read referrers by domain, then group them into channels: search engines, social networks, AI assistants and everything else.
  2. Exclude your own domains, or every click between your pages looks like a new source. Payment pages that send customers back also need excluding.
  3. Add UTM parameters to links you control. Tags survive where referrers don't, and they name the campaign.
  4. 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.co or l.facebook.com as 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.com and utm_source=instagram are all shown as Instagram.
  • For X, the full t.co link 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-Policy header 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-origin policy, which sends only the origin, such as https://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-referrer policy 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.
Full glossary

See which referrers send paying customers

MetricRaven groups every referrer into a channel and shows the revenue each one brought, credited to the visit where the customer first arrived.

14-day free trial, no card required.