Documentation Index
Fetch the complete documentation index at: https://docs.esperr.com/llms.txt
Use this file to discover all available pages before exploring further.
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
Domain-Only Referrer
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
- User clicks link on Site A
- Browser navigates to Site B
- Browser sends
Referer: https://siteA.com/page - 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:Advanced Patterns
Detect referrer spam:Common Referrer Patterns
Legitimate Sources
| Source Type | Referrer Pattern | What It Means |
|---|---|---|
| Search Engine | google.com/search | Organic search traffic |
| Social Media | facebook.com, twitter.com | Social sharing |
| mail.google.com | Email link clicks | |
| Internal | yourdomain.com | Navigation within site |
| Direct | (empty) | Typed URL or bookmark |
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
ModernReferrer-Policy settings affect what you see:
| Policy | What’s Sent | Use Case |
|---|---|---|
| no-referrer | Nothing | Maximum privacy |
| origin | Domain only | Balanced |
| strict-origin | Domain (HTTPS→HTTPS only) | Security-focused |
| same-origin | Full URL (same site only) | Internal only |
| unsafe-url | Everything | Full tracking |
Working with Marketing
UTM Parameter Tracking
Affiliate Link Validation
Common Issues and Solutions
Problem: Missing Referrers
Causes:- HTTPS to HTTP
- Privacy extensions
- Meta refresh redirects
- JavaScript navigation
Problem: Referrer Spoofing
Attack: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
- Allow empty referrers
- Consider mobile apps
- Account for privacy tools
- Test with real user scenarios
Advanced Patterns
Cross-Domain Security
Traffic Protection
Related Fields
- Request Path - Where user is going
- Client IP - Where request comes from
- Headers - Referrer is a header
- User Agent - Browser sending referrer