An empty referrer URL is not necessarily an issue. Several reasons may cause the referrer URL to be blank. This article will discuss the various scenarios that can lead to an empty referrer URL and provide a solution to include referrer information in certain situations.
Reasons for an empty referrer URL
The referrer URL may be empty when the end user:
- Enters the site URL directly in the browser address bar.
- Visits the site using a browser-maintained bookmark.
- Visits the site as the first page in a window or tab.
- Switches from an HTTPS URL to an HTTP URL.
- Switches from an HTTPS URL to a different HTTPS URL (if blocked by the referrer meta tag on the website).
- Has security software installed (such as antivirus/firewall) that strips the referrer from all requests.
- Is behind a proxy that strips the referrer from all requests.
- Visits the site programmatically (e.g., using curl) without setting the referrer header (search bots).
Browser differences in referrer handling
Browsers like Firefox and Chrome use the referrer directive "strict-origin-when-cross-origin" by default. This means that the full referrer is sent only to URLs with the same domain. For cross-origin requests, the origin is sent when the protocol security level remains the same (HTTPS → HTTPS), but the referrer header is not sent to less secure destinations (HTTPS → HTTP).
Suggesting a solution for referrer URLs
To include referrer information in certain situations, you can suggest that customers add the `referrerpolicy="unsafe-url"` attribute to the click URL `<a>` tag. For example:
<a href="http://destination.com/?a_aid=testaff&a_bid=11110001" referrerpolicy="unsafe-url">click here</a>
Empty referrer URLs are common and can result from various scenarios, such as direct navigation or security software interference. While browsers handle referrer information differently, including the `referrerpolicy="unsafe-url"` attribute in the click URL `<a>` tag can help ensure referrer information is included in certain cases. By understanding the reasons behind empty referrer URLs, you can better manage your online tracking and analytics.