Documentation

How to Create Google Maps API Keys for Ninja Forms Geolocation

Last modified: July 7, 2026

Follow the steps below to create both the Browser and Server API keys required for your Google Maps integration. These API keys allow the plugin to load maps, geocode addresses, provide address autocomplete, calculate routes, validate addresses, and use other Google Maps Platform services.


Step-by-Step Guide to Google Maps API Keys

1. Go to the Google Cloud Console

2. Create a New Project or Select an Existing One

  • In the top navigation bar, click the Project Selector.
  • Select an existing project or click New Project to create a new one.
  • Give your project a name and click Create.

3. Enable Billing for the Project

Google Maps Platform requires billing to be enabled on the Google Cloud project that owns your API keys. Billing must be enabled even if your usage stays within Google's free monthly usage thresholds.

  • Make sure the correct project is selected in the Google Cloud Console.
  • Open Billing from the left menu.
  • If the project is not linked to a billing account, click Link a billing account or Enable billing.
  • Choose an existing billing account or create a new one.
  • Add or confirm a valid payment method.

If billing is not enabled, Google Maps may show errors such as:

  • Google Maps JavaScript API error: BillingNotEnabledMapError
  • Geocoding Service: You must enable Billing on the Google Cloud Project

Note: Google Maps Platform now provides free monthly usage thresholds for many API services instead of the previous universal monthly credit.

4. Enable Google Maps API Services

  • From the Dashboard, click APIs & Services > Library.
  • Search for and enable the APIs required by the features you plan to use. Most installations will require at least the following services:
    • Maps JavaScript API
    • Geocoding API
    • Address Validation API (only if using Address Validation)
    • Places API (New)
    • Routes API
    • Maps Static API
    • Geolocation API
  • Click each API and then click Enable.

Current Stable Release: The current stable version of Ninja Geolocation still relies on Google's legacy Places API and Directions API for some features.

Enable all of the APIs listed above. If you are using the current stable release, also enable the following legacy APIs:

5. Create a Browser API Key

  • Go to APIs & Services > Credentials.
  • Click + Create Credentials > API Key.
  • An API key will be generated. Copy this key for later use.
  • Click Restrict Key:
    • Application restrictions: Select HTTP referrers (websites).
    • Add your website domain, for example: https://example.com/*.
    • If needed, also add your non-www/www version and staging domain. Local development domains can also be added.
  • Under API restrictions, restrict the key to browser APIs such as Maps JavaScript API and Places API (New) or Places API (Legacy), depending on the plugin features you use.
  • Save your changes.

6. Create a Server API Key

  • While still on the Credentials page, click + Create Credentials > API Key.
  • Another API key will be generated. Copy this key as well.
  • Click Restrict Key:
    • Application restrictions: Select IP addresses.
    • Add your server's public IP address(es).
  • Under API restrictions, restrict the key to server-side APIs such as Geocoding API, Routes API, or Directions API (Legacy), depending on the plugin features you use.
  • Save your changes.

Important: Never use an IP-restricted Server API Key in browser-loaded maps. Browser keys should use HTTP referrer restrictions, while Server API Keys should always use IP address restrictions.

Summary

  • Browser API Key: Use HTTP referrer restrictions.
  • Server API Key: Use IP address restrictions.
  • Never expose the Server API Key in front-end JavaScript.

Final Note

Properly configured Google Maps API keys are required for Ninja Geolocation to function correctly. Make sure billing is enabled, the required APIs are active, and each API key is restricted for its intended purpose.

If you recently enabled billing or activated a new API, wait a few minutes, clear any caches, and reload your website before testing.

If you experience issues, first verify that billing is enabled, the required APIs are active, and your API key restrictions are configured correctly. If problems persist, refer to Google's documentation or contact support.

Helpful Links

menu-circle