Google Maps and Places API Key

Google Maps and Places API Key

A single Google API key controls two features:

  • The address map shown on the Addresses order page in the admin (Maps JavaScript API). Available in all recent AbanteCart versions.

  • Google Places address autocomplete in storefront address forms.

1. Create a Google Cloud project and API key

  1. Sign in to the Google Cloud Console.

  2. Create a new project or select an existing one.

  3. Open APIs & Services → Library and enable both APIs that the AbanteCart key needs:

    • Maps JavaScript API — used for the admin order-page map.

    • Places API — used for storefront address autocomplete.

  4. Open APIs & Services → Credentials, click Create credentials → API key, and copy the new key.

Detailed Google walkthroughs: Set up the Places API.

2. Restrict the key

The key is loaded on storefront pages and is therefore exposed in the user's browser. Restrict it before going live.

On the same Credentials page, open the key and set:

  • Application restrictions → Websites — add your storefront for example *.example.com. Add additional domains for multistore or staging environments.

  • API restrictions → Restrict key — limit the key to Maps JavaScript API and Places API.

Save the changes. Restrictions can take a few minutes to propagate.

3. Add the key in AbanteCart

  1. In the AbanteCart admin, go to System → Settings → General.

  2. Paste the key into the Google Maps and Places API Key field.

  3. To turn on storefront checkout autocomplete (requires AbanteCart 1.4.4 or later), set Address Autocomplete (Google Places) to Yes.

  4. Save the settings.

4. Verify

  • Admin map: open any order in the admin and confirm the shipping address renders on the embedded map.

  • Storefront autocomplete: on the default theme or Novator, start typing an address during checkout. Suggestions per selected country should appear after a few characters. If they don't, see Troubleshooting below.

Troubleshooting

Symptom

Likely cause and fix

Symptom

Likely cause and fix

"For development purposes only" watermark on the map

Billing is not enabled on the Google Cloud project. Enable a billing account in the Cloud Console.

InvalidKeyMapError in the browser console

Wrong or empty key in System → Settings → General → Google Maps and Places API Key. Re-copy the key from Google Cloud Console.

RefererNotAllowedMapError

The current domain is not listed under Application restrictions → Websites on the key. Add the storefront and admin URLs.

Autocomplete suggestions never appear

The Places API is not enabled on the key, or API restrictions exclude the Places API. Also confirm Address Autocomplete (Google Places) is set to Yes in AbanteCart General settings.

Autocomplete works in admin testing but not on the live theme

Confirm the storefront theme is the default theme or Novator on AbanteCart 1.4.4 or later. Custom themes need to include the address autocomplete script hook in their address templates.

Related

AbanteCart, all rights reserved. 2025 ©