Hostname dimension
The hostname dimension records the domain that served each page_view — example.com, staging.example.com, or a domain you do not own. It comes from the host portion of the page_location URL. It is one of the most useful data-quality filters: unexpected hostnames reveal staging traffic, mis-deployed tags, or hits faked by referrer/measurement spam against your property.
What this means
Hostname is the host portion of the URL that served a page_view: the domain or subdomain in page_location. On a single-domain site it is constant; across subdomains, regional domains, or cross-domain setups it varies and lets you split or unify properties.
Why it is a data-quality lever
Because the tag reports whatever hostname it ran under, the dimension exposes problems: staging.example.com traffic mixed into production, a measurement ID pasted onto the wrong site, or hits sent via the Measurement Protocol claiming a hostname you never deployed to. Filtering reports to known hostnames is a standard first line of defence against this noise.
- Host portion of page_location
- Reveals staging/dev and mis-deployed tags
- Foreign hostnames can signal measurement spam
How it appears in analytics and logs
A hostname value is the domain in the page_location. Hostnames you do not recognise usually mean staging/dev traffic, a tag deployed on the wrong site, or measurement-protocol spam.
Diagnostic use case
Use hostname to filter reporting to domains you own and to spot staging, mis-deployed tags, or spoofed hits arriving under a foreign hostname.
What WebmasterID can help detect
WebmasterID can scope analytics to the hostnames you own and flag foreign hostnames, helping separate real first-party traffic from staging and spoofed hits.
Common mistakes
- Not filtering staging hostnames out of production reports.
- Ignoring foreign hostnames that signal spam.
- Missing a measurement ID deployed on the wrong site.
Privacy and accuracy notes
Hostname is a domain, not a visitor. WebmasterID reads it first-party and uses it to keep data clean, with no personal data involved.
Related pages
- Page path dimension
The page path dimension is the path portion of a viewed URL — /blog/post — excluding the hostname and, by configuration, the query string. GA4 derives it from the page_location of each page_view. It is hit-scoped, so it counts every view of a page, and the most common pitfall is query strings (utm_*, session IDs) fragmenting one logical page into many distinct paths.
- Bot traffic in analytics: filtering it out
Bots — crawlers, scrapers, monitors, scanners — generate requests that, unfiltered, inflate pageviews and distort every metric. Client-side analytics often misses bots (many do not run JavaScript) or miscounts the ones that do. Server-side classification at ingest is the reliable way to keep bot traffic out of human reports.
- Referrer spam and ghost referrals
Referrer spam injects fake referrer domains to lure operators into visiting a promoted site, while ghost referrals never touch your server at all — they are fabricated hits sent straight into measurement endpoints. Both pollute source reports with traffic that is not real. Recognising the pattern and filtering it keeps your data trustworthy without ever visiting the spam domains.
- Website observability
Scope traffic to the hostnames you actually own.
Sources and verification notes
Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.