BF50 Black Friday · 50% off all plans
from $5/mo · Auto-applied ---:--:-- Claim 50% off →
Skip to content

Search Seonio

Type a keyword, domain, or paste a URL

Start free with $1 to see full results. Powered by Seonio
Web Development

HTTP referer: What it sends and what it hides

The Referer header tells a site which page sent a visitor or loaded a file. What browsers send by default, how to change it, and its effect on analytics.

Monthly searches · http referer
2.9k
Keyword research data
http referer
HTTP referer: What it sends and what it hides
Click the image to view it full size

The Referer header is a line the browser adds to a request to say which page it came from. When someone clicks a link from a blog post to your site, the browser's request for your page can carry:

Referer: https://blog.example.com/

The browser sends it for files too. When your page loads an image from another site, that site sees your page's address in the image request.

Yes, it's spelled with one "r" in the middle. The misspelling got into the original HTTP standard and stayed. The header that controls it, Referrer-Policy, is spelled correctly, which trips people up in code.

What browsers send by default

Unless a site says otherwise, a browser applies the standard's default policy, strict-origin-when-cross-origin. It became the default in the November 2020 revision of the standard, and it sends less than people often expect:

The visitor goes from To The Referer sent
A page on your site Another page on your site The full URL, including path and query string
Your HTTPS page Another HTTPS site Only your origin, such as https://www.example.com/
Your HTTPS page An HTTP site Nothing

The Referer never includes the part after # or any username and password in the URL. MDN

So when another site links to you, you usually learn which site sent the visitor, not which page. That's why referral reports often show only domains.

How to change what your site sends

You can set a different policy in four ways:

  • A response header for the whole site: Referrer-Policy: no-referrer
  • A tag in the page's head: <meta name="referrer" content="no-referrer">
  • An attribute on one link or image: referrerpolicy="no-referrer"
  • A link relation: rel="noreferrer", which also stops the new page from controlling the page it was opened from

The main policy values:

  • no-referrer: send nothing.
  • origin: send only your origin, everywhere.
  • same-origin: full URL within your site, nothing to other sites.
  • strict-origin: only your origin, and nothing from HTTPS to HTTP.
  • unsafe-url: always the full URL. Avoid it: it leaks paths and query strings, even to unencrypted sites.

For most sites the default is the right choice. Tighten it on pages whose URLs hold private data. MDN's example is a password-reset page with a social media link in its footer: following that link could hand the reset URL to the other site.

Don't confuse noreferrer with nofollow. nofollow tells search engines how to treat a link. noreferrer hides where the visitor came from, and leaves search engines' treatment unchanged.

The Referer in your analytics

Analytics tools read the referrer to decide where a visit came from. In Google Analytics 4, a referrer from a known search engine counts as Organic Search, one from GA4's list of AI assistants counts as AI Assistant, one from a social network counts as Organic Social, and one from most other sites counts as Referral. Google Analytics Help A visit with no referrer and no campaign tags usually lands in Direct.

That's why some real referrals show up as Direct. The link may have rel="noreferrer", the visitor may have come from an HTTPS page to an HTTP one, or they may have tapped the link in an app or email that sends no referrer.

For links you control, such as newsletters, ads and social posts, add UTM parameters. They travel in the URL itself, so the visit is labeled correctly whether a referrer arrives or not. See referral website for working with the sites that send you visitors.

What the Referer can't tell you

It can't tell you what someone searched for. Under the default policy, a click from a search engine sends only the search engine's domain, not the results page with the query in it. For search queries, use Google Search Console.

It's also not proof of anything. Browsers don't let page scripts change it, but any other HTTP client can send whatever Referer it likes. Never use it alone to decide who may access something.

Your server logs record the Referer of every request, including image and file requests that analytics tags never see. See log file analysis.

Seonio

Put it to work on your own site

Keyword research, traffic, backlinks and clustering in one place. Start with a free $1 to test, no card required.