Shahin

User Agent

Intermediate
Updated Jul 11, 2026 Shahin editorial 2 min read
PronunciationEN/ˈjuːzər ˈeɪdʒənt/

The User Agent is a string the browser sends with every request, declaring which browser, version, operating system and device type made the request.

The User Agent is the main source for technically segmenting the audience: from it you can split visits by browser, operating system, and mobile versus desktop, which is vital for performance analysis and bug fixing. But it has two weaknesses. First, the string is forgeable; any program can announce itself as anything, and most bots hide precisely by posing as a real browser — so the User Agent alone is not enough for bot detection. Second, the string itself is messy and full of historical legacy and must be parsed to mean anything; the quality of that parsing decides how correct the browser and device split is. There is a security point too: the User Agent must be read server-side from the request header, not from whatever value a client injects into a body.