Geolocation Permission Request During The On Page Load

If you use the Google Lighthouse system, you can easily detect geolocation permission requests that appear during page loading. The system notices this and presents it as a warning and flags it. Here is an example:

Geolocation Permission Request

To do this, Google examines all Javascript libraries used during Lighthouse page loading and looks for geolocation.getCurrentPosition() or geolocation.watchPosition() snippets. If the permission is not granted yet, the audit process will fail.

If permission is given before performing the audit, Lighthouse may not work properly. For this reason, before starting the audit, you should definitely do a reset to cancel the previously given permissions.

How to ask users’ locations as UX compatible?

Make sure 100 percent that there are no codes geolocation.getCurrentPosition() and geolocation.watchPosition() in Page load. Later,

  1. Issue geolocation permission after user action is completed.
  2. Note also that users may not want to give you this information.
  3. If you can’t get geolocation permission, use a fallback.
  4. If a transaction requires geolocation, make sure to specify this in advance.

Test Your Website Issues

You can quickly analyze your site