Referer header and Referrer-Policy default
Tells the site which page the person came from, trimmed to the origin for cross-site links by default.
In one line
Can tell a site which page you came from, trimmed to the site name cross site
Tells the site which page the person came from, trimmed to the origin for cross-site links by default.
Reveals the previous site and, for same-origin or same-site hops, the full URL including query strings. Sites use it for attribution; it can leak search terms, IDs and private page paths when sites set weak policies.
What it can and can't do
What the user does: Nothing. It happens when you click a link or a page loads a resource
It can
- Tell a site which website you came from
- Send the full address for links within the same site
- Include the page that loaded an image or script
It cannot
- Send your full page address to other sites by default, only the site name
- Work if the site sets a stricter policy
- See your browsing history beyond the last page
- Send anything when you type an address or use a bookmark
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 56 | 2017-01-25 | None |
| Edge | Supported | 79 | 2020-01-15 | None |
| Firefox | Supported | 50 | 2016-11-15 | None |
| Safari | Supported | 11.1 | 2018-04-12 | Third-party referrers cut to origin by ITP |
| Safari on iPhone | Supported | 12 | 2018-09-17 | All iOS browsers use WebKit |
| Chrome on Android | Supported | 56 | 2017-02-01 | None |
| Samsung Internet | Supported | 7.2 | 2018-06-20 | None |
How a site asks for it
| API | HTTP Referer request header; Referrer-Policy header and <meta name=referrer>; rel=noreferrer |
| Browser compat keys | http.headers.Referrer-Policy |
| How access is granted | none |
| What the user sees | None |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | Per request, no storage |
| How to take it back | Clear site data, browser privacy settings |
| Inside an iframe | Not listed |
Typical flow
- Person clicks a link on another site
- Browser applies the sender's Referrer-Policy (default strict-origin-when-cross-origin)
- Destination server sees the Referer header
Data you get
What comes back: Origin or full URL of previous page
Shape: string
How often: per navigation or subresource request
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
Referer | string | URL | origin only to full URL | scheme://host[:port]/ for cross-origin |
Technical limits
- Cross-origin downgrade to origin only (strict-origin-when-cross-origin) unless the sending site sets a weaker policy
- Nothing is sent from HTTPS to HTTP by default
- Never sent when the previous page used no-referrer or rel=noreferrer
- Path and query of the previous page are hidden by default for cross-origin links
The story
What it is
A line the browser sends that tells a site which page you came from.
For you
You never see it. When you click a link, your browser tells the next site the page it came from. By default, for other sites, it shows only the site name, not the full address.
For makers
Sites use it to count where traffic comes from, and to block hotlinking. It can leak search words or private page paths on weak settings. Makers set a policy to say how much to share.
Where you see it
| Type | Example | Apps |
|---|---|---|
| analytics | A blog sees which sites send readers, such as Reddit or Hacker News. | Google Analytics, Plausible |
| security | A site blocks images that other sites load straight from it, by checking the referrer. | Cloudflare |
| games | A game portal sees which streamers or sites send players and pays a share. | itch.io, Kongregate |
| shopping | An affiliate store credits a sale to the blog that sent the shopper. | Amazon Associates |
| ads | An ad network uses the referrer to place an ad on the right topic page. | Google Ad Manager |
| media | A news paywall treats visitors from a social link differently from search visitors. | Wall Street Journal |
Risks
- Can leak private page addresses
- Weak policies share too much
What the platform says
- Mozilla: Referrer-Policy. Developer docs explain the header and the policy that controls how much of the previous address is shared.
Good uses and abuse
Legitimate uses
- Marketing attribution by source site
- Fraud and hotlink checks
- Analytics channel grouping
Known abuse
- Leaking private URLs or tokens in paths to third parties
- Reading search queries from older search engine referrers
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 3 of 5 | How revealing the data is |
| Utility | 5 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 1 | Rough identifying entropy, when known |
History
- 2019-03, Safari 12.1: ITP 2.0 downgraded all cross-site request referrers to the page origin
- 2020-08, Chrome 85: Default Referrer-Policy changed from no-referrer-when-downgrade to strict-origin-when-cross-origin
- 2021-03, Firefox 87: Same default adopted (trim cross-origin referrers to origin)
Related capabilities
Related
- document.referrer. Can tell which page you came from the moment the page loads
- Search engine referral data loss. Can't see the search words you used, only the search engine's name
- UTM campaign parameters. Can see which ad, email, or post sent you, from tags in the link
Sources
How well checked: Checked against real behavior.