Verifying your Google Maps API Key
Stockist supports using Google Maps as the map provider for your store locator. When you select Google Maps as your map provider, we'll use a key you provide from Google to power the map and parts of the search.
- Maps JavaScript API: Used to display the map imagery
- Geocoding API: Used to help match searches to specific places
- Places API: Used to show address suggestions when searching
In the Google Maps dashboard, you'll need to ensure that all three of these services are "enabled". The steps on this page will check that your key is set up correctly.
Possible errors caused by an incorrect Google Maps key
If your Google Maps key is missing one of these services, you may notice an error on your store locator. If the Maps JavaScript API is missing, you'll see a grey box showing Oops! Something went wrong:
If the Places API is missing, you might see a popup near the search bar like the following:
Fixing the problem
There are three separate things to check to ensure your key is set up correctly:
1) Ensure the three Google Maps services are enabled
Follow these steps to ensure the necessary services are enabled for your key:
- Open the Google Maps Platform > APIs & Services page on the Google dashboard. If needed, sign into the Google account you used to create your key.
Ensure that the correct project is selected at the top of the page:
The project name shown should match the project that you created when initially setting up your Google Maps key.
Find Maps JavaScript API in the list. If there's a button labeled Enable, click it to turn on the service:
If the button says Disable, the service is already enabled, and you can move to the next step.
Find Geocoding API in the list. If there's a button labeled Enable, click it to turn on the service:
If the button says Disable, the service is already enabled, and you can move to the next step.
Find Places API in the list. If there's a button labeled Enable, click it to turn on the service:
If the button says Disable, the service is already enabled.
Once you've enabled all three APIs, your project should be set up to work correctly with Stockist.
If you still encounter an issue, follow the steps in the next section.
2) Ensure your key is from the project where the services were enabled
3) Checking for key restrictions
If the steps above didn’t resolve the issue, another possibility is that your key has been restricted to only work with certain services. There are two levels of permission in your Google project:
- Your project must have the 3 necessary APIs enabled (covered in the section above)
- Your API key must have access to the 3 necessary APIs (covered in this section). One project can have multiple API keys (although you only need one), and each key can be restricted to only work with a certain set of APIs.
- Open the Credentials page of the Google dashboard.
Find your API key in the list and click on the name:
Check for any restrictions under API Restrictions. You want to ensure that either Don't restrict key is selected or, if Restrict key is selected, ensure that all 3 services (Maps Javascript API, Geocoding API, Places API) are included in the permitted APIs:
Need help?
If the steps above didn't solve your issue, we're here to help! Just click Contact Us at the top of this page, or send us a message on the Contact page of your Stockist dashboard.