Skip to main content

What is a Referrer?

The referrer (yes, it’s misspelled in the HTTP spec!) tells you which webpage or source sent the user to your current page. It’s like a trail of breadcrumbs showing where traffic comes from.
MDN Web DocsRead more on Referer.

Understanding Referrer Values

Full URL Referrer

Shows complete source URL including path and parameters.

Domain-Only Referrer

Shows just the source domain (privacy-focused).

Empty Referrer

Common sources of empty referrers:
  • Direct navigation (typed URL)
  • Bookmarks
  • HTTPS→HTTP (blocked by browsers)
  • Privacy settings/extensions
  • Some mobile apps

How Referrers Work

  1. User clicks link on Site A
  2. Browser navigates to Site B
  3. Browser sends Referer: https://siteA.com/page
  4. Site B knows traffic came from Site A
Privacy NoteModern browsers increasingly limit referrer information for privacy. The Referrer-Policy header controls how much information is shared.

Using Referrer in Policies

Basic Examples

Block hotlinking:
Track marketing campaigns:

Advanced Patterns

Detect referrer spam:
CSRF Protection:

Common Referrer Patterns

Legitimate Sources

Suspicious Patterns

  • Spam sites: Random domains with keywords
  • Spoofed referrers: Impossible sources
  • Referrer injection: XSS attempts in referrer
  • Bot traffic: Consistent fake referrers

Security Considerations

Open Redirect Prevention

Clickjacking Detection

Best Practices

DO:

  • Allow empty referrers - Many legitimate reasons
  • Check referrer for state-changing operations - CSRF protection
  • Monitor referrer patterns - Understand traffic sources
  • Validate for sensitive actions - Extra security layer
  • Consider referrer policies - Balance security and privacy

DON’T:

  • Require referrer always - Will block legitimate users
  • Trust referrer completely - Easily spoofed
  • Store sensitive data in referrer URLs
  • Block all external referrers - Breaks incoming links
  • Ignore privacy trends - Referrers becoming less reliable

Referrer Policy Impact

Modern Referrer-Policy settings affect what you see:

Working with Marketing

UTM Parameter Tracking

Common Issues and Solutions

Problem: Missing Referrers

Causes:
  • HTTPS to HTTP
  • Privacy extensions
  • Meta refresh redirects
  • JavaScript navigation
Solution:

Problem: Referrer Spoofing

Attack:
Defense:

Analytics and Business Intelligence

Traffic Source Analysis

Conversion Tracking

Troubleshooting

“Referrer policy blocking data”
  • Check site’s Referrer-Policy header
  • Test with different browsers
  • Verify HTTPS configuration
  • Review privacy settings
“False positives on referrer checks”
  • Allow empty referrers
  • Consider mobile apps
  • Account for privacy tools
  • Test with real user scenarios

Advanced Patterns

Cross-Domain Security

Traffic Protection