yunzen
yunzen

Reputation: 33439

Is it possible to detect, if a site is tested with Google PageSpeed Insights?

Is there any possibility to cheat the Google PageSpeed Insights measurement?

I'm especially concerned by increased Cumulative Layout Shift (CLS) from Cookie Consent Banners. If I'd be able to detect that my page's speed is measured, I could deactivate the cookie consent banner for that purpose.

Second question is more of a legal point of view. If it would be possible to achieve the aforementioned, would Google impose a punishment on me, if they would detect my little cheat?

Upvotes: 1

Views: 3514

Answers (1)

janh
janh

Reputation: 2972

Yes, but...

You can detect Lighthouse by looking at the User-Agent, it will contain Chrome-Lighthouse, e.g. it might be Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4420.0 Safari/537.36 Chrome-Lighthouse.

Here is the but: it's not a good idea. You can trick the lab test by not using some features on your site when a test is being run, but Google isn't using the lab test for performance judgements- They are using the Chrome User Experience Report (CrUX), where they collect anonymous real world data from real people using Chrome.

If you were to disable your consent banner during tests, you'd hide the problem from yourself, but it would still affect your visitors, and its effect would be counted in Google's statistics. All you'd do is create a situation where you don't understand why Google judges your site differently in field data vs lab data.

Upvotes: 4

Related Questions