Referrer Host
asset.js reads document.referrer, extracts only the hostname, and sends that as the source field in the beacon. The full referrer URL — path, query string, and fragment — is never recorded.
What the host-only approach records
If a visitor arrives from https://news.ycombinator.com/item?id=12345, the beacon records news.ycombinator.com. The story ID is discarded. If they arrive from https://www.google.com/search?q=stateless+analytics, the beacon records google.com. The search term is discarded. If they arrive from https://twitter.com/someuser/status/12345, the beacon records twitter.com. The username and post ID are discarded.
The hostname is the right granularity for answering the question "where is my traffic coming from?" You learn that a meaningful share came from news.ycombinator.com without learning what thread they came from or what the thread said.
Why the path and query are dropped
Referrer URLs often carry information about what the visitor was doing on the source site: the specific article they were reading, the search term they typed, a tracking parameter embedded by the source, or in some cases a user identifier in the URL. Dropping the path and query means the source data answers where traffic came from without revealing what visitors were doing there.
A search referrer like https://www.google.com/search?q=first+name+last+name+email would expose a personally identifiable search query if the full URL were recorded. Recording only google.com avoids that.
Direct visits
When document.referrer is empty, the source is recorded as a direct marker. This covers several situations: the visitor typed the URL or used a bookmark, the source page had a meta referrer tag set to no-referrer, the link used rel="noreferrer", or the visit was HTTPS-to-HTTP (where browsers omit the Referer header by policy).
Email links are a common source of direct traffic in this sense. Many email clients do not send a Referer header. A link in a newsletter, in a personal email, or in an email notification will typically appear as direct in the Sources column, not as the email service's domain.
Same-site navigation
When a visitor follows a link from one page of your site to another, the browser sets document.referrer to the page they came from — your own domain. The beacon records your own hostname as the source for that page load. In the Sources section of the board, your own domain appearing as a source represents internal navigation: pages that were reached by clicking a link on another page of your site rather than arriving from an external source.
If you see your own domain as a significant source in the board, it reflects the volume of visitors who navigated internally rather than landing on that page directly from outside. That is useful information about which pages are reached primarily through internal links versus directly from search or referrals.
Troubleshooting
If a significant share of your traffic shows as direct and you believe it should be attributed to a specific external source, the referrer may be stripped before the visitor arrives. Redirectors, link shorteners, and some social platforms strip or modify the Referer header. The source site may also have set a Referrer-Policy header that restricts what is shared on outbound navigation. In those cases, the visit genuinely arrives with no referrer for the script to read.
If your own domain appears as an unexpectedly large source in the board, check whether any external tools — ad platforms, email services, or analytics redirects — route clicks through a page on your own domain before sending the visitor to the destination. If visitors pass through a redirect page on your domain, the Referer for the final destination will be your own domain.