Google Maps Error: Oops! Something went wrong
When you first add our HTML embed code to your website, you may see an error message in the locator where the map would usually be saying 'Oops! Something went wrong'. Occasionally this message can be shown some time after your locator was set up and was working fine.
There are a number of possible reasons for this error which we'll go through in order from most likely to least likely.
We recommend using Google Chrome to identify the specific error message - open Chrome and then open Chrome Developer Tools by clicking on the View menu and selecting Developer -> Developer tools. Then click on the Console tab in the box that appears at the bottom of the page and refresh the page where your store locator is installed. If you see one of the error messages below, here's what you'll need to do.
You must enable Billing on the Google Cloud Project
This error means that you need to Enable Billing for your Google account using the following link: https://console.cloud.google.com/project/_/billing/enable. Choose the project which holds your store locator API key and follow the prompts to add a credit card to your account.
Enabling Billing allows you to access the free Google Maps API quota each month.
Google have been very slowly rolling out this requirement over the last 2 years; you still get the same $200 worth of free usage quota each month, they just require you to Enable Billing to qualify for it. This affects customers who may have been using Google Maps without issue for many years previously. Contact us if you have any concerns about being charged for the use of the Google Maps API.
ApiNotActivatedMapError - This API project is not authorized to use this API. Please ensure this API is activated in the Google Developers Console
This error means that one or more of the required Google Maps APIs have not been enabled in your Google console. Usually this isn't needed as they are enabled when you create an API key but sometimes they have to be enabled manually. To enable them, please visit each link below, choose your project and click on the ENABLE button at the top if it is not already enabled:
- Maps API - so the map can be displayed: https://console.developers.google.com/apis/library/maps-backend.googleapis.com
- The Places API - this is for the address autocompletion in the search bar - to enable this, visit https://console.developers.google.com/apis/library/places-backend.googleapis.com
- Directions API - to allow directions to work: https://console.developers.google.com/apis/library/directions-backend.googleapis.com/
- Geocoding API - so that when you click on the 'My Location' button it shows the address that was found: https://console.developers.google.com/apis/library/geocoding-backend.googleapis.com
This error happens because you've set the allowed referrers (URLs) that are used by your Google Maps API key so that only certain websites can use the API key and this website is not allowed to use it.
To fix this:
- Go to https://console.developers.google.com/apis/credentials
- Click on the API key that you are using (YOUR_KEY_NAME_HERE)
- Under 'Accept requests from these HTTP referrers (web sites)' add the URL to *.domainname.com/*
This means the API has not been restricted from being used by your API key. Please check the API restrictions settings of your API key in the Google Cloud Platform Console. It's possible that you added API restrictions to the key itself (we already checked the global API setttings and they are fine).
Please go to https://console.developers.google.com/apis/credentials and click on your key name. At the bottom the API Key restrictions should be like this:
You have exceeded your request quota for this API
This means that you have set a quota on the usage of your Google Maps API key (or one was set automatically for you). Check the quota setting for your Google Maps API key by clicking the follow link:
Under 'Map loads per day' - check it is set to 'Unlimited' not 1 as shown below:
If you see a message like the following one then follow the additional steps below:
This means you have to Enable Billing for your Google account using the following link: https://console.cloud.google.com/project/_/billing/enable. Choose the project which holds your store locator API key and follow the prompts to add a credit card to your account. Enabling Billing allows you to access the free Google Maps API quota each month.
This error means the Google Maps API project associated with your API key has been deleted from the Google API Console. Check your Google API console to see if any projects still exist? If not, you will need to follow these steps:
- Create a new project in the Google API console.
- Follow our guide to create a new API key
- Add the new API key to the top of this page in our admin console and update the HTML embed code on your website with the updated version directly below it on the same page.
Once the above steps have been followed, your locator should start working fully. If not, repeat the steps above to see if there are any other outstanding error messages or contact us for help.