Why is document.referrer empty? Causes and fixes
By Devendra Variya, co-founder of Virling. Published 2026-11-24.
document.referrer is empty when the browser had no linking page to report, or was told not to report it. The usual reasons are a typed address or bookmark, a link opened from an app or mail client, a rel="noreferrer" link, a no-referrer policy on the linking page, a link from HTTPS to HTTP, or a redirect that sets a stricter policy. You cannot force another site to send a referrer. You can fix your own redirects and headers, and put UTM tags on every link you control.
The causes at a glance
| Cause | What reaches your page | Who can fix it |
|---|---|---|
| Typed address or bookmark | Nothing | Nobody, it is real Direct |
| Default browser policy | The domain of the other site, without the path | Nothing to fix, the source is there |
rel="noreferrer" on the link | Nothing | The site with the link |
Meta referrer or Referrer-Policy set to no-referrer or same-origin | Nothing on another site | The site with the link |
| Link from HTTPS to HTTP | Nothing | Whoever wrote the http:// link, then your server |
| App or desktop mail client | Often nothing | You, with tags on the link |
| Redirect with a strict policy | Nothing | Whoever runs the redirect, often you |
Each cause below links to its source. This post is about the referrer itself. For everything else that ends up in the same bucket, and how to read it, see why Direct is your biggest traffic source. For a referrer that is there but wrong, such as buyers coming back from paying, see checkout.stripe.com referral traffic.
The browser default sends only the domain
When nobody sets a policy, browsers follow strict-origin-when-cross-origin. A click within one site sends the full address. A click to another site sends only the origin, so a visitor from https://blog.example/best-tools?page=2 arrives with https://blog.example/. The Referrer Policy specification names it as the default, and Chrome announced the change starting in version 85. A missing path is therefore normal and no sign of a problem. An empty value needs one of the causes below.
A typed address or a bookmark has no linking page at all. MDN documents the value as an empty string in that case.
rel="noreferrer" on the link
A link with rel="noreferrer" sends no referrer, whatever the page policy is. The HTML standard says no referrer information is leaked when the link is followed, and that the keyword implies noopener. The reverse is not true: noopener alone keeps the referrer. It is easy to copy rel="noopener noreferrer" onto every external link, including links between two domains you own.
<!-- Sends no referrer --> <a href="https://shop.example.com" rel="noopener noreferrer">Shop</a> <!-- Keeps the referrer --> <a href="https://shop.example.com" rel="noopener">Shop</a>
Meta referrer and the Referrer-Policy header
The linking site can set a policy for a whole page, with a meta referrer tag or with the Referrer-Policy header. A referrerpolicy attribute on one link takes priority over both, in the order web.dev gives: element, page, browser default.
<meta name="referrer" content="no-referrer"> Referrer-Policy: no-referrer
Two values hide the source from every other site: no-referrer sends nothing anywhere, and same-origin sends the address only within the same origin. All the other values send at least the domain from one HTTPS site to another.
Read the direction carefully. The header on your site covers the requests your pages make. It does not change what other sites send to you.
HTTPS to HTTP
With the default policy, a click from an HTTPS page to an http:// address sends no referrer. The specification gives that exact case, and RFC 9110 forbids the header on an unsecured request from a secure page. By the Fetch standard, a referrer set to none is not worked out again later, so your redirect from http to https does not bring it back. Old links in directories and profiles that still say http:// are worth updating.
Apps and mail clients
A link in a phone app, a desktop mail client or a document is not on a web page. RFC 9110 says that when the source has no address of its own, the browser must leave the header out or send about:blank. Android lets an app name itself with an android-app: address, but its documentation says the value may be null.
Webmail runs in a browser and can still hide the source. Roundcube, an open-source webmail, adds noreferrer to the links in a message. Chats and private shares are a large topic of their own, covered in dark social traffic and what revenue it brings.
Redirects
An ordinary 301 or 302 keeps the referrer of the page the visitor clicked on. The redirect itself never becomes the referrer. Two things change that:
- A policy on the redirect response. The browser applies the
Referrer-Policyof the redirect to the next hop, as the specification describes.no-referrerremoves the source. So doessame-origin, because the page with the link is on another origin. - A page in between. A redirect made with JavaScript or a meta refresh is a page that loads and then navigates, so that page is the new source. It shows up as the referrer, or hides it if its own policy says so.
If the tags disappear as well as the referrer, the redirect is dropping the query string. That is a separate fault, covered in UTM parameters lost after redirect.
How to check your own site
- Put a plain link to your site on a page at another domain, over HTTPS. Click it. A pasted address always gives an empty value, so it proves nothing.
- On your page, run
document.referrerin the browser console. You should see the other domain. - In the Network panel of the browser tools, select the document request and look at the
Refererrequest header. The name is spelled with one r in HTTP. - List the policy on every hop of your own redirects, from each address people might link to:
curl -sIL http://example.com | grep -iE '^(HTTP|location|referrer-policy)' curl -sIL https://www.example.com | grep -iE '^(HTTP|location|referrer-policy)'
A referrer-policy: no-referrer or same-origin line next to a 301 or 302 means that redirect hides the source of visits that pass through it. Then search your templates for noreferrer and for name="referrer", and look for a security plugin or CDN setting that adds the header for you.
To see how a visit would be classified with and without a referrer, paste its landing address into the traffic source checker and leave the referrer blank.
What to set
Set strict-origin-when-cross-origin yourself, on pages and on redirects. It matches the default, it is the value web.dev suggests considering, and an explicit header does not depend on the browser.
# Nginx add_header Referrer-Policy "strict-origin-when-cross-origin" always; # Caddy header Referrer-Policy "strict-origin-when-cross-origin"
In Nginx, a block with its own add_header does not inherit the ones above it by default, as its documentation says, so check the redirect block too. A page with private data in its address can keep a stricter policy. Between your own domains, use rel="noopener" without noreferrer. Redirect http to https on the server, and link to the https:// address everywhere you can edit.
Why UTM tags still work
A referrer is something the browser chooses to send about the last page. A UTM tag is part of the address of your own page. No referrer policy touches it, so a tagged link in an app, an email or a noreferrer page still says where it was placed. Build the links with the UTM builder.
Virling decides the channel of a session from its first pageview, in a fixed order: a paid or email utm_medium, then the referrer host, then utm_source (or ref) when there is no referrer. Some made-up examples:
| Made-up landing | Referrer | Channel |
|---|---|---|
/pricing | None | Direct |
/pricing?utm_source=reddit | None | Communities |
/pricing?utm_source=spring&utm_medium=email | None | |
/pricing?utm_source=partner-site | None | Referral |
/pricing | https://news.ycombinator.com/ | Communities |
When there is no referrer and no source, Virling also reads the user agent, and credits the visit to the app if it names a known one such as Instagram or Slack. Any other utm_medium on its own is Referral. What is left is Direct. The full rules are in the channel docs. Virling joins each payment to the visit before it, so a tagged link shows its revenue even when the referrer was empty.
Frequently asked questions
Why is document.referrer empty?
Because the browser had no linking page to report, or was told not to report it. The common cases are a typed address or bookmark, a link opened from an app or mail client, a rel=noreferrer link, a no-referrer policy on the linking page, a link from an HTTPS page to an HTTP address, and a redirect that sets a stricter policy.
Why does document.referrer show only the domain?
Because the default browser policy, strict-origin-when-cross-origin, sends only the origin to another site. The path and query string of the linking page are removed. The domain is enough to name the site that sent the visit.
Can I make other sites send me a referrer?
No. The linking page, the link itself and the browser decide. Your own Referrer-Policy header covers the requests your pages make, and your own redirects. For links you place yourself, add UTM tags.
Does rel=noopener remove the referrer?
No. noopener only stops the new page from reaching the page that opened it. noreferrer removes the referrer, and it also behaves as noopener.
Do redirects remove the referrer?
An ordinary server redirect keeps the referrer of the page the visitor clicked on. It is lost when a redirect response sends Referrer-Policy: no-referrer or same-origin, or when the link goes from an HTTPS page to an HTTP address first.
Do UTM tags work when the referrer is empty?
Yes. UTM tags are part of your page address, so no referrer policy removes them. They are lost only if something rewrites the address before your analytics reads it.
See the source behind every payment
Virling is open source under AGPL. Self-host it free, or use the hosted version with a 14-day free trial. It connects to Stripe, Paddle, Shopify, WooCommerce, Polar, LemonSqueezy, Dodo, Creem and RevenueCat.