What is the name of the Google PageSpeed User Agent?
Solution 1
The information in other answers is outdated: currently, Google PageSpeed does not pass the «Google Page Speed Insights» string in its User-Agent
HTTP header, it passes the «Chrome-Lighthouse» string instead.
An example:
Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/MRA58N) AppleWebKit/537.36(KHTML, like Gecko) Chrome/69.0.3464.0 Mobile Safari/537.36 Chrome-Lighthouse
Please note that the string is exactly «Chrome-Lighthouse» even if you run Google PageSpeed in other browsers (e.g. Firefox).
Solution 2
I created a script, it returns two USER AGENT one for desktop and other for mobile, these are
for MOBILE:
Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko; Google Page Speed Insights) Chrome/27.0.1453 Mobile Safari/537.36
FOR DESKTOP
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko; Google Page Speed Insights) Chrome/27.0.1453 Safari/537.36
Solution 3
In 2020 :
- Chrome-Lighthouse : for mobile
- Google Page Speed Insights : for desktop
Solution 4
May 2020, there you go:
Mobile:
Mozilla/5.0 (Linux; Android 7.0; Mo to G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4143.7 Mobile Safari/537.36 Chrome-Lighthouse
Desktop:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4143.7 Safari/537.36 Chrome-Lighthouse
Solution 5
I have just made a test, requested my site and checkout logs in real time.
User-Agent logs
Web Client test: @ https://developers.google.com/speed/pagespeed
date : "21/Feb/21"
user-agent-mobile : "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.175 Mobile Safari/537.36 Chrome-Lighthouse",
user-agent-desktop : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.175"
node-cli lighthouse --version
@ 7.1.0:
command : `lighthouse example.com --view`
date : "21/Feb/21"
user-agent-mobile : "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4143.7 Mobile Safari/537.36 Chrome-Lighthouse",
user-agent-desktop : "Mozilla/5.0 ($ENV_OS) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/$ENV_CHROME Safari/537.36"
Note that for the user-agent-desktop
in the node-cli
for test, there are two variables $ENV_OS
and $ENV_CHROME
which will vary according to the running envirmoent.
Related videos on Youtube
![Matty B](https://i.stack.imgur.com/iYoxe.png?s=256&g=1)
Matty B
Updated on July 21, 2021Comments
-
Matty B almost 3 years
This page indicates that it uses a custom user agent but it does not mention the name. I would like to be able to run some logic if the user agent is from PageSpeed. What is the name of the Google PageSpeed user agent?
-
kilinkis over 5 yearsProbably outdated now too, just tried it and neither "Google Page Speed Insights" or "Chrome-Lighthouse" work.
-
PapaSoft about 4 yearsThis does not work anymore. Page Speed Insights powered by Lighthouse uses a default userAgent, that cannot be detected anymore :(
-
Jake 1986 over 3 yearsI just checked my access logs after running the API in both desktop and mobile and can confirm this is correct.
-
Jake 1986 over 3 years@PapaSoft that may have been true in June '20 but either way the API sends a 'Chrome-Lighthouse' user agent now (March '21)
-
Stefan Teunissen over 2 years@Jake1986 Right now PageSpeed says it sends a user-agent with "Chrome-Lighthouse", but in reality it doesn't do this at all. I echoed the user-agent and it was a completely different one. It didn't include anything like "lighthouse" or "pagespeed".
-
ViliusL over 2 yearsIt is valid on 2022, except it is not "Mo to", but "Moto.