Google Maps API Key (article)

Susana Moleón Moya
Susana Moleón Moya
  • Updated
Google have recently changed their terms of service & are now charging for all Mapping services whereas previously this was free.
 
Information on Google Maps pricing: https://cloud.google.com/maps-platform/pricing/
1.png
At the time of writing, you should be credited $200 per month for mapping services, any usage above this is chargeable.
 
As such we need to use a Google Maps API key under a paid for Google Account for all websites that use this service. 
 
To generate your own API key follow these steps:
 
1) Create a Google Cloud billing account (if you don’t already have one), and add your company credit card details to this: https://cloud.google.com/billing/docs/how-to/manage-billing-account
 
2) Generate a Google Maps Javascript API Key. Follow this article: https://developers.google.com/maps/documentation/embed/get-api-key
 
3) Restrict your API key to your own domain. You should put your domain name, followed by an asterisk to limit the API key to your website only. You must whitelist both the www version and the non-www version of your domain E.g. https://graylinespain.com/* https://www.graylinespain.com/*

https://yourdomainname.com/* 
https://www.yourdomainname.com/* 
 
4) Provide us with your API key, e.g. AIzaSyC49grgePHoKKXy5Dzj21ir9STIme_wpyg
 
2.png
3.png

Example output on tour page

4.png

Troubleshooting

If your maps are not loading, it may be because you have not added enough credit to your account / have not enabled billing / do not have a high enough quota limit.

https://developers.google.com/maps/documentation/javascript/usage-and-billing

https://console.cloud.google.com/project/_/billing/enable?redirect=https://developers.google.com/maps/documentation/javascript/usage-and-billing?dialogOnLoad%3Dbilling-enabled&_ga=2.35730336.1813630108.1565709527-1098806206.1565709527

5.png

6.png

7.png

8.png

Go to the Maps JavaScript API Quotas page in the Google Cloud Platform Console. From the projects list, select a project. In the Requests section, on the Requests per day line, click the edit icon, then enter the preferred total billable daily quota, up to the limit (if any) specified by Google.Jun 20, 2019