User Agent
A user agent is any software that acts on a user's behalf when communicating with a server — most commonly a web browser, but also apps, crawlers and bots. The term also refers to the user agent string: a piece of text the software sends with each request, identifying what it is, such as the browser name and version, the operating system and the rendering engine.
How the user agent is used
Servers read the user agent string to learn something about the client making the request. This lets them adapt responses — for example serving a layout suited to a mobile browser, or noting which browser is in use for compatibility. Search engine crawlers identify themselves through distinctive user agents, which is how a site can recognise indexing bots and how rules in robots.txt can target specific crawlers. Analytics tools also use the user agent to break down traffic by browser and device.
Limits and considerations
The user agent is a helpful signal but not a reliable one, because it is supplied by the client and can be modified or spoofed. A browser can be told to send a different string, and malicious bots often disguise themselves as ordinary browsers or even as legitimate crawlers. For that reason the user agent is fine for adapting content or gathering statistics, but it must never be used for security decisions, which require stronger verification. In an SEO context, understanding user agents helps ensure that search crawlers can access and render content the same way real users do, ideally over a secure HTTPS connection. Treated as a hint rather than a fact, the user agent is a useful part of how the web tailors experiences to the enormous variety of clients that connect to it.
Powiązane pojęcia
Najczęstsze pytania
Can the user agent string be trusted?
Not fully. It is sent by the client and can be changed or faked, so it is fine for adapting content but should never be relied on for security decisions or as proof of who is really connecting.
