TapCub is live — analytics, insights and live chat, free on one platform
Glossary

What is an HTTP header? Request headers analytics reads

An HTTP header is a name–value field that carries metadata with a request or response. An annotated request, request vs response headers, and the request headers that decide device, source, language and privacy fields in analytics.

Chen Yu Reviewed by Xu An Also called HTTP headers Last updated Nov 29, 2026 Glossary

Quick answer

An HTTP header is a case-insensitive name–value field sent with an HTTP request or response to carry metadata. Request headers such as User-Agent, Referer, Accept-Language and Sec-GPC tell the server about the client and decide what analytics records about a visit.

What is an HTTP header?

An HTTP header is a name–value pair sent at the start of an HTTP request or response that carries metadata about the message: who is asking, what formats they accept, where they came from, how the response may be cached. MDN puts it simply: headers let the client and the server pass additional information with a request or a response. The current HTTP standard, RFC 9110, calls them fields, and the ones in the header section of a message are header fields.

Each header is a case-insensitive name, a colon and a value, for example Accept-Language: en-US,en;q=0.9. Request headers travel from the browser (or any client) to the server; response headers travel back. This page focuses on request headers, because a handful of them decide what web analytics records about a visit: browser and device, traffic source, language, privacy preferences and whether the visitor is a bot.

Anatomy of a request: an annotated example

A browser following a link from a search result to a pricing page might send:

GET /pricing?plan=pro HTTP/1.1
Host: shop.example
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml
Accept-Language: en-US,en;q=0.9
Referer: https://www.search.example/
Sec-CH-UA: "Chromium";v="131", "Google Chrome";v="131"
Sec-CH-UA-Mobile: ?0
Sec-CH-UA-Platform: "macOS"
Sec-GPC: 1
Cookie: session=…

Read line by line:

  1. Request line: method GET, path /pricing?plan=pro, protocol version.
  2. Host: which site on the server is meant; required in HTTP/1.1. In HTTP/2 and HTTP/3 its role is taken by the :authority pseudo-header.
  3. User-Agent: the browser and platform, in a historically convoluted format. Chromium-based browsers now send a reduced string in which the minor version reads 0.0.0.
  4. Accept / Accept-Language: preferred content types and languages, with q weights from 0 to 1.
  5. Referer (spelled with one "r" since the original specification): the page that linked here. It shows only the origin, not the path, because the default referrer policy trims it for cross-site requests.
  6. Sec-CH-UA headers: User-Agent Client Hints, structured browser data that replaces parsing the User-Agent string.
  7. Sec-GPC: 1: the Global Privacy Control signal, the user's request not to have their data sold or shared.
  8. Cookie: values the site stored earlier, often including identifiers.

Request headers vs response headers

Request headersResponse headers
DirectionClient → serverServer → client
DescribeThe client and its preferencesThe response and how to handle it
ExamplesUser-Agent, Referer, Accept-Language, Cookie, Authorization, Sec-GPCContent-Type, Cache-Control, Set-Cookie, Location, Referrer-Policy, X-Robots-Tag
Who controls themBrowser (many cannot be set by page scripts)Your server or CDN
Analytics relevanceFeed device, source, language, consent and bot fieldsShape what future requests send (Referrer-Policy, Set-Cookie) and how crawlers index (X-Robots-Tag)

The two interact. A Referrer-Policy response header on your page decides how much of that page's URL the browser will put in the Referer request header of the next click. A Set-Cookie response header decides what the Cookie request header carries next time. Names prefixed with X- were the old convention for custom headers; RFC 6648 deprecated that convention in 2012, though many X- headers remain in use.

Which request headers analytics reads

Request headerAnalytics field it feedsWhat changes it
User-AgentBrowser, OS, device type; bot detectionReduced strings in Chromium; spoofing by bots; see User-Agent
Sec-CH-UA, Sec-CH-UA-Mobile, Sec-CH-UA-PlatformBrowser brand, mobile flag, platformDetailed hints only after the server asks with Accept-CH
RefererTraffic source and channelReferrer-Policy, HTTPS → HTTP downgrades, in-app browsers; see referrer
Accept-LanguageVisitor languageBrowser and OS settings
Sec-GPC (and the older DNT)Opt-out of sale or sharing; tool-specific collection limitsUser or browser privacy settings
X-Forwarded-For / ForwardedClient IP behind a proxy or CDN, used for geographyEach proxy appends; the client can forge the first value
CookieReturning-visitor and session identifiersConsent, browser cookie limits, user deletion

Two of these are often misunderstood. The client IP address is not a header at all; the server sees it on the connection, and a proxy passes the original address on in X-Forwarded-For or the standard Forwarded header (RFC 7239). Only the entries added by proxies you control can be trusted. And the source of a visit is usually read by the analytics script from document.referrer rather than from the header, but the browser applies the same referrer policy to both.

Worked example: what Referer is sent under each policy

Sample case: a visitor on https://shop.example/pricing?plan=pro clicks a link.

Destinationstrict-origin-when-cross-origin (default)no-referrerunsafe-url
https://shop.example/signup (same origin)https://shop.example/pricing?plan=prononefull URL
https://partner.example/ (other HTTPS site)https://shop.example/nonefull URL
http://old.example/ (HTTPS → HTTP)nonenonefull URL

So under the default policy, a site you link to learns only your origin, never the page or query string. MDN documents strict-origin-when-cross-origin as the default when no policy is set. In HTTP Archive's 2024 Web Almanac crawl, a Referrer-Policy was deployed on about 34% of desktop pages and 32% of mobile pages, and strict-origin-when-cross-origin was the most common explicit value, on 8% of pages. For analytics, the consequence is that referral reports show domains, not the exact referring article, unless the linking site chose a looser policy.

Client hints are adopted far more slowly: the same Almanac found Accept-CH on 15.8% of the top 1,000 mobile sites but only about 0.5% of all mobile sites, so most servers still see only the low-entropy hints sent by default.

HTTP headers vs URL parameters vs script data

Data sourceExampleSet byVisible in server logs
Request headerReferer, User-AgentBrowserYes, if the log format includes it
URL parameterutm_source=newsletterWhoever wrote the linkYes, in the request path
Script datadocument.referrer, navigator.language, screen sizePage script reading browser APIsNo, only in the analytics hit

A source can be decided by any of the three. UTM parameters in the URL override the referrer in most tools because the link author stated the source explicitly; the referrer header is the fallback when no parameters exist.

How to inspect HTTP headers

  1. Browser DevTools: open the Network tab, reload, select the document request and read Request Headers and Response Headers. Under HTTP/2 names appear in lowercase.
  2. curl for response headers: curl -I https://shop.example/ prints only the response headers; curl -v prints both directions.
  3. Send a custom request header: curl -H "Sec-GPC: 1" https://shop.example/ tests how your server reacts to a privacy signal.
  4. Check the referrer policy of a page in the response headers or in a <meta name="referrer"> tag before blaming analytics for missing referrers.

Common mistakes: trusting the first X-Forwarded-For value from the open internet; parsing exact browser versions from a reduced User-Agent; logging Cookie or Authorization headers in plain text; and treating header names as case-sensitive.

How TapCub uses request data

Here is what happens to the example request's headers when the page runs the TapCub script:

  1. Visitor recognition from address and User-Agent. The collector computes the visitor ID as an HMAC of the address and the user agent on the server; the script writes no cookie. Version numbers are dropped from the user agent and IPv6 uses only the first 64 bits, so a browser update or a rotating IPv6 address does not create a new visitor.
  2. The address is not stored. It is used for geography and the visitor hash, then discarded; by default two bytes are truncated before the city lookup. Settings are in Configuration › Privacy center.
  3. Source from the referrer. On the first load the script uses document.referrer, so your Referrer-Policy and the linking site's policy apply exactly as in the table above; UTM parameters are checked before the referrer in Web analytics › Sources.
  4. Privacy signals. Global Privacy Control (Sec-GPC: 1) and Do Not Track are honored by default: the website script does not run when the browser reports either signal, and a hit that arrives with one is stored at tier 1, anonymous aggregate counting.
  5. Bots counted separately. Brand and model come from the user agent; browsers with automation signals such as navigator.webdriver or a headless user agent are classified as bots and shown on Web analytics › Bots, not in human reports. Exclusion rules can also match by user agent. Server-side events can pass ip and user_agent in their context.

Sources

Was this explanation clear?

We use your answers to fix and expand this page.

Chen Yu

Technical Engineer

Focuses on tracking code, SDKs, and API integrations, with practical guidance on implementation checks and troubleshooting.

FAQ

Questions people ask

Short answers to the follow-up questions that come up most.

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

What are HTTP headers used for?

They carry metadata that the body cannot: which site is requested, what formats and languages the client accepts, where the visitor came from, cookies, authentication, caching rules and security policies. Servers use request headers to choose a response, and browsers use response headers to decide how to handle it.

What is the difference between request and response headers?

Request headers go from the client to the server and describe the client and its preferences, for example User-Agent and Referer. Response headers go back and describe the response, for example Content-Type, Cache-Control and Set-Cookie.

Why does the Referer header only show the domain?

Because browsers default to the strict-origin-when-cross-origin referrer policy, which sends only the origin on cross-site requests and nothing when going from HTTPS to HTTP. The full URL is sent only within the same site or if the linking page chose a looser policy.

Are HTTP header names case-sensitive?

No. Header names are case-insensitive, so Content-Type and content-type are the same field. HTTP/2 and HTTP/3 transmit names in lowercase, which is why developer tools show them that way. Header values may be case-sensitive depending on the header.

See this number on your own site

Add one script tag for web and apps, and the first reports fill in within minutes.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics