Quick answer
User agent spoofing is sending a User-Agent header that does not match the software making the request, such as a scraper claiming to be Chrome or Googlebot. The header is self-declared, so verification needs DNS, IP ranges, headers and behaviour, not the string.
What is user agent spoofing?
User agent spoofing is sending a User-Agent string that does not describe the software actually making the request. A scraper running on a cloud server announces itself as Chrome on Windows, or as Googlebot; a developer's browser pretends to be an iPhone to test a mobile layout.
The User-Agent is a request header the client writes about itself. Nothing in HTTP proves it is true, so any rule that trusts the string alone, such as "skip analytics for Googlebot" or "only count Chrome visitors", can be bypassed by changing one line of a script. That is the whole problem: identification by self-declaration.
Why the User-Agent header is so easy to fake
HTTP defines the User-Agent header as information about the user agent originating the request, which servers use for things like scoping interoperability problems (RFC 9110, §10.1.5). The same section asks implementations not to borrow other products' tokens to declare compatibility, yet browsers have done exactly that for decades, which is why almost every browser string starts with Mozilla/5.0.
Three properties make spoofing trivial:
- The client writes it. Every HTTP library lets you set any header. In a headless browser it is a single launch option.
- There is no signature. Unlike a TLS certificate, the string carries no proof of who sent it.
- Servers rarely check it against anything else. Many filters stop at "does the string contain
bot?"
Legitimate and malicious uses
| Use | Who | Intent | Typical string |
|---|---|---|---|
| Responsive testing | Developers, QA | Legitimate | Desktop browser posing as a phone |
| Compatibility workarounds | Browsers, users | Legitimate | Browser posing as another to unlock a site that sniffs strings |
| Privacy | Privacy tools | Legitimate | A common, generic string so the browser blends in |
| Scraping past filters | Scrapers | Usually unwanted | Current desktop Chrome |
| Fake search crawler | Scrapers, spam bots | Malicious | Googlebot or Bingbot |
| Ad and click fraud | Bot operators | Malicious | Rotating real browser strings |
The last three are the ones that distort analytics and security decisions.
What spoofed traffic does to analytics
A bot that runs JavaScript and claims to be Chrome can be counted as a visitor. Sample data: a site has 10,000 real sessions and 200 conversions in a month, a 2.00% conversion rate. If 360 bot sessions with a spoofed Chrome string get counted as people, the rate becomes 200 ÷ 10,360 = 1.93%. The site did not get worse at converting; its denominator got polluted.
The opposite happens with fake crawlers. A scraper that claims to be Googlebot is often excluded from analytics by name, so it never shows up in visitor numbers, but it still consumes bandwidth, gets served pages your rules meant only for search engines, and may be allowed past rate limits written for real crawlers.
Worked example: verifying 1,000 "Googlebot" requests
Sample data: a day of server logs contains 1,000 requests whose User-Agent says Googlebot. Google documents how to check such claims: run a reverse DNS lookup on the IP, confirm the hostname ends in googlebot.com, google.com or googleusercontent.com, then run a forward lookup on that hostname and confirm it returns the original IP. Google also publishes its crawler IP ranges as JSON files, starting with common-crawlers.json (Google Search Central).
| Check result | Requests | Share |
|---|---|---|
Reverse DNS to googlebot.com, forward lookup matches | 640 | 64% |
| Reverse DNS to a cloud-hosting hostname | 248 | 24.8% |
| No reverse DNS record | 112 | 11.2% |
| Claimed Googlebot but failed verification | 360 | 36% |
More than a third of the "Googlebot" traffic in this sample is something else. If a robots rule, a firewall exception or an analytics filter trusted the string, all 360 would have been treated as Google.
Practical notes for the check:
- Verify per IP, not per request, and cache the answer: 1,000 requests often come from a few dozen addresses.
- Reverse DNS alone is not enough, because the owner of an IP block controls its PTR records. The forward lookup is what makes the check hold.
- For high request volumes, match IPs against the published ranges instead of doing DNS lookups on every hit.
Detection layers
No single signal is reliable. Detection works by stacking layers and treating agreement between them as evidence:
| Layer | What it checks | Catches | Misses |
|---|---|---|---|
| User-Agent string | Known bot names, malformed strings | Honest bots, lazy scrapers | Anyone who copies a real browser string |
| Reverse + forward DNS | Hostname belongs to the claimed operator | Fake search crawlers | Bots that claim to be ordinary browsers |
| Published IP ranges | IP is in the operator's list | Fake crawlers at high volume | Operators that publish no list |
| Header consistency and client hints | Headers a real browser of that version always sends, Sec-CH-UA matching the string | Scripts that only set User-Agent | Full headless browsers |
| Network (ASN) | Request comes from a data center rather than a consumer network | Cloud-hosted bots | Bots on residential proxies |
| Behaviour and frequency | Request rates, navigation patterns no person produces | Fast scrapers | Slow, careful bots |
| TLS fingerprinting | The TLS handshake matches the claimed browser | HTTP libraries posing as Chrome | Real browser engines driven by automation |
The decision rule: if the string and any lower layer disagree, trust the lower layer. A request that says Chrome, sends no Accept-Language, comes from a cloud ASN and fetches 300 pages a minute is not Chrome.
User agent spoofing vs browser fingerprinting
| User agent spoofing | Browser fingerprinting | |
|---|---|---|
| Who does it | The client | The server or a script on the page |
| Goal | Hide or change what the client is | Recognize a client from many attributes |
| Signals involved | One header | Dozens: screen, fonts, canvas, time zone, TLS, headers |
| Relationship | Spoofing one attribute often makes the fingerprint inconsistent, which is how it gets caught | Fingerprinting is one way to detect spoofing |
Bot filtering in analytics uses both ideas: it reads the string, then checks whether everything else about the request agrees with it.
How TapCub handles spoofed user agents
TapCub's bot detection does not rely on the string alone. For the conversion-rate example above, this is what happens and where to look:
- Recognized bots stay out of human numbers. New projects default to recognizing bots and counting them separately: a hit identified as a bot goes only to Web analytics › Bots and is left out of visitors, sessions and pageviews, so it does not dilute conversion rates.
- Detection uses five layers. Every hit is checked before storage against user agent, request headers, client signals, network (ASN) and frequency, with a centrally maintained rule set; a hit is marked as a bot when enough layers agree. See how bot detection works.
- Read the trust level. In All bots, each row shows which detection layers matched and a trust level (verified, suspected or unknown). Only Applebot is verified by reverse DNS; other operators are not DNS-verified, and "unknown" means the operator could not be confirmed, not that the traffic is fake. To verify a claimed Googlebot, run the DNS check above on your server logs.
- Know what the page script cannot see. With the page script alone, only bots that execute JavaScript appear. Crawlers that fetch raw HTML need server-side collection through the server API.
- Correct mistakes. If a real visitor was classified as a bot, Report false positive on the row sends it for review.
Sources
- IETF, RFC 9110: HTTP Semantics, §10.1.5 User-Agent, June 2022.
- Google Search Central, Verifying Googlebot and other Google crawlers, checked 2026-11-29.
Was this explanation clear?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Product Experience Specialist
Writes about product experience, practical workflows, and growth, turning complex processes into clear steps for everyday decisions.