Introduction
Google has announced that they have changed their policy in regards to accessing and using their Maps API without an access key. Starting June 22, 2016, all new domains using the Maps API must register an account with Google and register their site for access to use the Maps API. So if you are receiving this error message instead of a map, you must create an account with Google and set up access keys for your site. Google does provide documentation on how to get a key but they are pretty sparse, lacking on detail. This FAQ will provide a more detailed step by step instructions.
Step 1 – Create Your Account
You must have a Google account or Gmail account. If you do not have one, you can create a Google account without a Gmail account here.
If you have a Gmail account, then you already have a Google account. To login to the Google API Console you will use your Gmail login email and password.
Login to the Google API Console.
Step 2 – Create Your Project
Navigate to the Google Maps Platform.
Get Started
Click the “Get Started” button.
Enable the Google Maps Platform
Enable the “Maps”, “Routes” and “Places” options and click the “Continue” button.
Create or Select an Existing Project
Enter project name in the box and then click the “Next” button.
Step 3 – Create Billing Account
Fill in your contact and payment information and click the “Next” button.
Step 4 – Get the API Key
In the next window titled “Enable Google Maps Platform”, click the “Next” button. You will be presented with your API key. Click the “Copy” icon and then click the “Done” link.
Step 5 – Add the API Key to the Setting
Navigate to the Connections : Settings admin page, click the Advanced tab and scroll down to the Google Maps Geocoding API section. Paste the key you copied in the Browser API Key field and save.
Step 6 – Secure the API Key
It is highly recommended to add a HTTP Referrer restriction to prevent unauthorized usage of your API key. To do this follow these steps:
- Navigate to Google Cloud Platform Console and click on your key.
- Select “HTTP referrers (websites)” and enter your site domain name in the field.
- Click the “Save” button.
I recommend using http://domain-name.com/*
as the referrer; change domain-name.com
to your website address. The preceding http://
and trailing /*
are important and should not be left off otherwise your Browser Key may not work because it will not be able to validate the referrer. You can now click the “Create” button.
Tip
Tip
Step 7 – Create a Server API Key
Create a second API key in the same project, but this time do not add a restriction to it. After you are finished creating the key. Add it as the Server API Key on the Connections Settings admin page.
Google APIs
Both API keys need to have at least the following Google APIs enabled:
- Google Maps JavaScript API
- Google Maps Geocoding API
- Google Places API
- Google Maps Directions API
Troubleshooting
- Making quick successive changes in the API Console. Changes take time to propagate Google’s network. After making a single change, wait 5–10 mins to verify the change.
- For the referrer restrictions for the Browser API key, try
*yourdomain.com/*
as the HTTP referrer. Changingyourdomain.com
for your site domina name. - The API Console needs valid billing information setup.