How to Fix Google Maps API Error: RefererNotAllowedMapError
2 min. read
Updated on
Read our disclosure page to find out how can you help MSPoweruser sustain the editorial team Read more
A common stumbling block I’ve encountered as a web developer is the Google Maps API error: RefererNotAllowedMapError.
Getting it is always frustrating, so I dug deep for a solution. Here’s a step-by-step guide on how to fix it:
How to Fix the Google Maps API Error: RefererNotAllowedMapError
Fixing this error involves verifying and updating your settings in the Google Cloud Console to ensure your website is authorized to use the Google Maps API key.
- Access Google Cloud Console and log in to your account.
- Tap the Hamburger menu, click APIs and services then select credentials.
- Identify the Google Maps API key you want to modify and tap on the three dots. Click edit API Key.
- Select websites under set an application restriction.
- Add the list of sites that are allowed to use the API key in the Add Website field and tap Done. Also, ensure the web address you add matches your website’s address. You can also add another domain name.
After updating your settings, save the changes and wait a few minutes for them to take effect. Then, test to see if the error has been resolved.
What is The Google API Error: RefererNotAllowedMapError?
It’s a Google Maps API error that occurs when the HTTP referrer (the webpage that requested the API) is not authorized to use the Google Maps API key.
This security measure ensures that only approved domains can make requests with your API key, protecting you from unauthorized use and potential cost implications.
What Causes The RefererNotAllowedMapError?
Here are some of the reasons this error occurs:
- Incorrect referrer setup: The most common cause is missing setup of the referrer in the Google Cloud Platform where your API key is managed. If the referrer doesn’t match the authorized domains, the API request is blocked.
- New or changed domains: If you’ve recently moved your website to a new domain or changed its structure, you might not have updated these changes in your Google Cloud Platform settings.
- Typos or incorrect protocols: Simple typos in the domain name or incorrect use of protocols (HTTP vs. HTTPS) can also lead to this error.
The RefererNotAllowedMapError Google Maps API error often happens when there’s a mismatch in website settings. To fix it, update your API key settings in the Google Cloud Console. This ensures your site keeps using Google Maps smoothly.
User forum
0 messages