Google Maps API keys

How to setup Google Maps API keys for your account

For any map geolocation, Enhanced Google Maps are needed (example: our Store Locator). These require an API key, and have a variable cost based on traffic to the page. Here is Google's pricing for Enhanced Google Maps.

The cost through Google Maps is variable, and will increase or decrease as traffic increases or decreases every month. To offset this, Google Maps provides a $200 credit per month to your account. Due to this credit, most customers have no or little cost from Enhanced Maps usage. If expected traffic can be provided to us, we can provide an estimate of the monthly Enhanced Maps cost.

Creating your Google API keys

Using Enhanced Google Maps requires an API key. Here are instructions for setting this up:

  • You can walk through the process to setup a Google Maps key here: https://cloud.google.com/maps-platform/?apis=maps

  • You will need a existing google account/sign in

  • You will click "Get started"

  • You will create a project, setup a billing account, and then it should generate an API key for you (it will look something like AIzaSyAa_ydj8A4mxymMDXXXXXXX)

  • You then send that Key over to us

Enabling the Maps APIs

Under the access for your API key, you will want to make sure that the following APIs are enabled in the Google API console.

  • Geocoding API

  • Maps Javascript API

  • Maps Static API

  • Places API

Enabling billing

For the keys to work, you will need to enable or connect a billing profile to the project under the Google API console.

Restricted access (optional)

We recommend that the API key not have any restrictions if it will be used on a number of different domains. However, if restrictions are desired for the key, you can follow these additional steps to accommodate.

  1. In addition to your domains that you want to restrict the key to, *.cloudbackend.net and localhost:8001 should be added to the allowable list

  2. A second key should be setup that is unrestricted, and only has the Geocoding API enabled. It is necessary for this key with the Geocoding API to be unrestricted for the geolocation to function properly. This key will only be used on the backend and not publicly accessible.

Debugging map errors

If there is problems with the display of Google Maps, you will see errors related to this on the maps themselves as well as in the browser console. You can use these console errors as a hint of what is wrong on how to resolve it.

List of common errors:

Error

Reason

BillingNotEnabledMapError

This happens when billing (and adding a valid payment source) has not been completed on the Google API account.

RefererNotAllowedMapError

Commonly happens on preview URLs. This means the API key was restricted and the current domain is not on the authorized list.

ApiNotActivatedMapError

This happens if not all the required APIs were enabled for the API key

A full list of Google Maps API errors can be found here:

Last updated