Skip to Content
Platform.Ontology

Referer and Origin headers

Requests tell the destination site which page the visitor came from.

Gets silentlyNetwork and connectionHeadersWeb browsersWhen the page loads

In one line

Can tell which site you came from, usually just the site name, not the page

Requests tell the destination site which page the visitor came from.

The default policy strict-origin-when-cross-origin (Chrome 85, Firefox 87) sends only the origin cross-site. Safari has capped cross-site referrers to the origin since 12.1. Full URLs still go same-site.

What it can and can't do

What the user does: You click a link or load a page that pulls in another site's content

It can

  • See the site address you arrived from, such as example.com
  • See the full page address when you move around inside the same site
  • Count visits by traffic source for analytics

It cannot

  • See the full page address of another site you left, in Chrome, Firefox and Safari by default
  • See your browsing history beyond the one step before
  • Get a referrer if the previous page chose to send none

How it differs between platforms: Safari has limited cross site referrers to the site name for years. Chrome and Firefox did the same by default around 2020 and 2021.

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported562017-01-25None
EdgeSupported792020-01-15None
FirefoxSupported502016-11-15None
SafariSupported11.12018-04-12None
Safari on iPhoneSupported122018-09-17None
Chrome on AndroidSupported562017-02-01None
Samsung InternetSupported7.22018-06-20None

How a site asks for it

APIReferer and Origin request headers; Referrer-Policy; document.referrer
Browser compat keyshttp.headers.Referrer-Policy
How access is grantednone
What the user seesNot listed
Needs a secure context (HTTPS)No
Needs a user gestureNo
How long it lastsNot listed
How to take it backNot listed
Inside an iframeNot listed

Typical flow

  1. Navigate or fetch
  2. Browser applies policy
  3. Server reads header

Data you get

What comes back: URL or origin
Shape: string

FieldTypeUnitRangePrecision
RefererstringNoneURL or originpolicy dependent

Technical limits

  • Pages can loosen it with Referrer-Policy: unsafe-url
  • Never reveals the referring page across origins by default

The story

What it is

Each request tells the destination which page or site you came from.

For you

You never see it. When you click a link or a page loads an image, the other site learns where you were. Browsers now trim it to just the site name by default, so you share less than before.

For makers

Makers use it to see which sites and ads send visitors, to block other sites from copying their images, and to guard forms from forged requests. The origin header helps stop cross site attacks.

Where you see it

TypeExampleApps
analyticsA shop sees that many visitors arrive from a blog post. The referrer tells it which blog to thank and which affiliate to pay.Google Analytics
adsAn advertiser reads the referrer to check that clicks came from the sites it paid, and to spot fake sites.None named
mediaA photo site stops other sites from showing its pictures for free by checking the referrer on image requests.None named
securityA banking site checks the origin header on a transfer form. A request coming from another site is rejected as forged.None named
gamesA browser game portal sees which partner site a player came from, so it can credit the partner and show a matching start screen.Poki, CrazyGames
socialA social site shows a link preview but trims the referrer so private page addresses do not leak to the linked site.None named
newsA news site sees visitors from search, social and email, and uses it to pick which subscription offer to show.None named

Risks

  • Leaks page addresses
  • Reveals browsing path

What the platform says

  • W3C: Referrer Policy. The standard lets sites choose how much of the previous page address is shared when you click a link.

Good uses and abuse

Legitimate uses

  • Analytics and traffic attribution

Known abuse

  • Leaks of sensitive URLs, search terms

Scores

ScoreValueMeaning
Sensitivity2 of 5How revealing the data is
Utility5 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits2Rough identifying entropy, when known

History

  • 2020-08, Chrome 85: Default Referrer-Policy strict-origin-when-cross-origin
  • 2021-03, Firefox 87: Default Referrer-Policy strict-origin-when-cross-origin

Sources

How well checked: Based on official documentation.

On this page