How to Fix Google Maps API Error: RefererNotAllowedMapError


Google Maps api error: referernotallowedmaperror

Fix Windows errors with Fortect:
Fortect can repair common computer errors by scanning your entire system for damaged or missing OS files and replacing them with the original, working versions. Optimize your PC in 3 simple steps:

  1. Download and Install Fortect on your PC
  2. Use the PC Scan feature to look up any Windows issues (including drivers)
  3. Right-click on Repair, and fix it within a few minutes.

Besides that, it helps you clean up junk files, fix stability problems, and get rid of annoying programs and malware traces.

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.

  1. Access Google Cloud Console and log in to your account.
Google Cloud Console
  1. Tap the Hamburger menu, click APIs and services then select credentials.
APIs and services
  1. Identify the Google Maps API key you want to modify and tap on the three dots. Click edit API Key.
Edit API key
  1. Select websites under set an application restriction. 
Application instructions
  1. 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.
Add a website

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.

Readers help support MSpoweruser. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help MSPoweruser sustain the editorial team Read more

User forum

0 messages