Fix guides · UX & conversion
How to fix location and notification requests on page load
Pages that ask for a visitor's location, or permission to send notifications, the moment they open. Why it backfires and how to ask at the right time.
- Time to fix
- 15–30 minutes
- Skill needed
- Developer
- Who notices
- Every new visitor
Why it matters
A permission prompt that appears before visitors have done anything comes with no context. Most people dismiss or block it, and once blocked, you usually can't ask again.
Ask only when the visitor does something that needs it: tapping "Find a store near me" or "Notify me when it's back in stock".
“Users are mistrustful of or confused by pages that automatically request their location on page load.”
Before you start
- Your report shows which script made the request. It's usually a store locator, a push notification service, or a delivery-estimate widget.
- Move the request behind a button, and explain the benefit next to it before the browser prompt appears.
Fix it on your platform
Shopify
- Push notification and store locator apps are the usual cause. Check the app's settings for an option to ask on click instead of on load, or contact its developer.
WordPress
- Check push notification and store locator plugins for a setting that delays the prompt until the visitor clicks a button.
Webflow
- The request comes from a script in your custom code or an embed. Change it to run on a button click, or remove it.
Wix
- Check apps that use location or notifications, and your custom code. Remove or reconfigure the one that asks on page load.
Squarespace
- Check code injection, embeds and extensions for the script that asks, and change or remove it.
Next.js
- Call the permission APIs inside an event handler, never in a useEffect that runs on mount.
<button onClick={() => navigator.geolocation.getCurrentPosition(showNearestStore)}>
Find a store near me
</button>Any other site
- Move getCurrentPosition(), watchPosition() and Notification.requestPermission() calls into click handlers.
Check that it's fixed
- Open the page in a private window: no permission prompt should appear until you click something.
- Re-run your StudioLNC audit: the issue should be gone.
Find every issue like this on your site
Free audit of performance, accessibility, SEO and security, with fixes for your platform.