What is a headless browser?
A headless browser is a real web browser that runs without a visible window and is controlled by code, usually through tools like Puppeteer, Playwright or Selenium. It loads pages, runs JavaScript and keeps cookies like a normal browser. Developers use it for testing and rendering. Scrapers and other bots use it to look like real visitors.
At a glance
- Type
- Browser mode or build with no visible UI
- Examples
- Chrome with the --headless flag, chrome-headless-shell
- Controlled by
- Automation tools such as Puppeteer, Playwright and Selenium
- Runs JavaScript
- Yes, so it can trigger client-side analytics tags
- How it identifies itself
- Often as normal Chrome. Any user agent can be set in code
- Good or bad
- Neither by itself. Testing tools and scrapers both use it
How to spot it
- In your logs: some default setups include
HeadlessChromein the user agent, but it is one line of code to change, so its absence proves nothing. - By network: many requests from cloud-hosting IPs with a desktop Chrome user agent is a common pattern for automated browsing.
- By behavior: steady request rates, no pauses between pages and the same paths in the same order point to automation, whatever the user agent says.
# Run Chrome with no visible window (Linux)
google-chrome --headless Related terms
Quick answers
Can Google Analytics see headless browser traffic?
Often yes, and that is the problem. A headless browser runs your tag like any visitor, so bot sessions can be counted as people.
Is all headless traffic malicious?
No. Uptime checks, test suites, link previews and rendering services use headless browsers too. Judge by identity and behavior, not by the browser mode.
What is chrome-headless-shell?
Chrome's old headless mode. Since Chrome 132 it is only available as a separate binary named chrome-headless-shell.