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

User Agent Spoofing: What It Is and How to Detect It

User agent spoofing is sending a User-Agent string that misstates the real client. Why the header is easy to fake, what it does to analytics, a worked check of 1,000 claimed Googlebot requests, and the detection layers that work.

Lin Zhou Reviewed by Emma Collins Also called UA spoofing Last updated Nov 29, 2026 Glossary

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

UseWhoIntentTypical string
Responsive testingDevelopers, QALegitimateDesktop browser posing as a phone
Compatibility workaroundsBrowsers, usersLegitimateBrowser posing as another to unlock a site that sniffs strings
PrivacyPrivacy toolsLegitimateA common, generic string so the browser blends in
Scraping past filtersScrapersUsually unwantedCurrent desktop Chrome
Fake search crawlerScrapers, spam botsMaliciousGooglebot or Bingbot
Ad and click fraudBot operatorsMaliciousRotating 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 resultRequestsShare
Reverse DNS to googlebot.com, forward lookup matches64064%
Reverse DNS to a cloud-hosting hostname24824.8%
No reverse DNS record11211.2%
Claimed Googlebot but failed verification36036%

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:

  1. Verify per IP, not per request, and cache the answer: 1,000 requests often come from a few dozen addresses.
  2. 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.
  3. 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:

LayerWhat it checksCatchesMisses
User-Agent stringKnown bot names, malformed stringsHonest bots, lazy scrapersAnyone who copies a real browser string
Reverse + forward DNSHostname belongs to the claimed operatorFake search crawlersBots that claim to be ordinary browsers
Published IP rangesIP is in the operator's listFake crawlers at high volumeOperators that publish no list
Header consistency and client hintsHeaders a real browser of that version always sends, Sec-CH-UA matching the stringScripts that only set User-AgentFull headless browsers
Network (ASN)Request comes from a data center rather than a consumer networkCloud-hosted botsBots on residential proxies
Behaviour and frequencyRequest rates, navigation patterns no person producesFast scrapersSlow, careful bots
TLS fingerprintingThe TLS handshake matches the claimed browserHTTP libraries posing as ChromeReal 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 spoofingBrowser fingerprinting
Who does itThe clientThe server or a script on the page
GoalHide or change what the client isRecognize a client from many attributes
Signals involvedOne headerDozens: screen, fonts, canvas, time zone, TLS, headers
RelationshipSpoofing one attribute often makes the fingerprint inconsistent, which is how it gets caughtFingerprinting 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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. Correct mistakes. If a real visitor was classified as a bot, Report false positive on the row sends it for review.

Sources

Was this explanation clear?

We use your answers to fix and expand this page.

Lin Zhou

Product Experience Specialist

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

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.

Is user agent spoofing illegal?

Changing your own browser's User-Agent is not illegal in itself and is common in testing and privacy tools. What can make it unlawful or a breach of terms is the purpose, such as committing ad fraud or evading access controls. This is general information, not legal advice.

How do I know if Googlebot is real?

Run a reverse DNS lookup on the requesting IP and check that the hostname ends in googlebot.com, google.com or googleusercontent.com, then run a forward lookup on that hostname and confirm it returns the same IP. Google also publishes its crawler IP ranges as JSON files you can match against.

Can analytics tools detect spoofed user agents?

Not from the string alone. Detection works when other signals contradict it: missing or inconsistent headers, data-center networks, request rates no person produces, or a TLS handshake that does not match the claimed browser. Tools that combine several layers catch most scripted bots.

Does spoofing the user agent make me anonymous?

No. The User-Agent is one of many attributes a site can read. Changing it alone often makes a browser more distinctive, because the other attributes no longer match the claimed browser.

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