← Back to guides

Google Maps API Key

Enable address autocomplete on your landing page forms.

Updated on May 31, 2026


With this feature, when a visitor starts typing their address in your landing page form, Google suggestions appear and they can pick the right one with a tap. Fewer typos, cleaner data, faster completion β†’ more valid leads.

πŸ’‘ Time required: ~10 minutes. A credit card is required to activate the Google account, but you almost certainly won't pay anything (see the "How much does it cost" section).

1

Open the Google Cloud Console

Open the Google Cloud Console and sign in with a Google account (a normal Gmail account is fine).

Open Google Cloud Console

πŸ’‘ Tip: use a dedicated business account, not your personal one, to keep things tidy.

Google Cloud Console screen
Google Cloud Console screen

2

Create a project

A "project" is the container that holds your key and settings.

  1. At the top, next to the "Google Cloud" logo, click the project dropdown.
  2. Click New project.
  3. Give it a recognizable name, e.g. RoyLead Maps, and click Create.
  4. Make sure the new project is selected at the top.

Creating a new project
Creating a new project

3

Enable billing

Google requires a linked card even to use the free tier. Without active billing you'll see an error or the "For development purposes only" watermark.

  1. In the left menu (☰), go to Billing.
  2. Click Link a billing account.
  3. Enter your details and a card, then confirm.

πŸ”’ Adding a card doesn't mean you'll be charged. Google only bills if you exceed the monthly free allowance, which is very unlikely for a landing page. Below, I'll show you how to set a budget alert.

4

Enable the required APIs

You need to turn on the Google services that address autocomplete uses.

  1. In the menu (☰), go to APIs & Services β†’ Library.
  2. Search and enable these three APIs one by one (open each and click Enable):
  • Maps JavaScript API
  • Places API
  • Places API (New)

ℹ️ Enabling an API costs nothing: you only pay based on actual usage. Enable all three to avoid "This API is not enabled" errors.

API Library with the three APIs to enable
API Library with the three APIs to enable

5

Create the API key

  1. In the menu (☰), go to APIs & Services β†’ Credentials.
  2. Click + Create credentials β†’ API key.
  3. Google generates the key: a long string like AIzaSyB3xK...d9F2qZ.
  4. Copy it (you'll paste it into RoyLead in Step 7). Don't close yet: let's restrict it first.

⚠️ Never share this key in public chats, screenshots or repositories. Even after restricting it, treat it like a password.

6

Restrict the key (important for security)

The key ends up in the landing page code, so it's visible to anyone viewing the source. To prevent someone from copying and using it at your expense, restrict it. Open the key from the Credentials page (pencil icon) and set two restrictions.

6a β€” HTTP referrers (which sites can use it)

  1. Under Application restrictions, select HTTP referrers (web sites).
  2. Add the URLs of the domain where you'll use the key (both lines):
https://yourdomain.com/*
https://*.yourdomain.com/*

Replace yourdomain.com with your domain. Multiple domains? Better to create a separate key per domain (in RoyLead the key is per-domain).

6b β€” API restrictions

  1. Under API restrictions, select Restrict key.
  2. Check only: Maps JavaScript API, Places API, Places API (New).
  3. Save.

⚠️ Restrictions can take up to 5 minutes to take effect. If you see an error right after, wait a few minutes and retry.

7

Paste the key into RoyLead

  1. Open the domain settings in RoyLead.
  2. Select the domain where you want autocomplete enabled.
  3. Paste the key into the Google Maps API Key field and save.

Go to Domains β†—

8

Verify it works

  1. Open a landing page published on that domain.
  2. In the form, start typing an address (e.g. "Roma St…").
  3. Google suggestions should appear: pick one and the field fills in. βœ…

If no suggestions appear, see the "Troubleshooting" section.

How much does it cost

Google offers a monthly free usage allowance for Maps/Places APIs. For typical landing page volumes you almost always stay free and pay €0. The card is just a guarantee and covers any overage.

To stay safe, set a budget alert:

  1. Menu (☰) β†’ Billing β†’ Budgets & alerts.
  2. Create budget, low threshold (e.g. €5), email alert.

πŸ’³ Places Autocomplete makes a request on every keystroke: 1 lead = a handful of requests, not just one. Even so, you'd need several thousand form fills per month to actually pay.

Troubleshooting

What you seeCauseFix
No suggestionsAPI not enabled or key not savedRe-check Step 4 and Step 7
RefererNotAllowedMapErrorDomain not in referrersStep 6a: add the domain URLs
ApiNotActivatedMapErrorAn API is missingStep 4: enable the three APIs
"For development purposes only" watermarkBilling not activeStep 3
This API key is not authorizedAPI restriction too tightStep 6b: check the three APIs
Worked, then stoppedYou just changed restrictionsWait ~5 minutes

πŸ’‘ For debugging: open the landing page, press F12 β†’ Console tab. Google Maps errors show up there with the exact name: look it up in the table above.

Best practices

  • πŸ”‘ One key per domain (in RoyLead the key is per-domain): if one leaks, you only block that one.
  • πŸ”’ Always restrict the key (Step 6): an unrestricted key is one someone will use at your expense.
  • 🚨 Keep the budget alert active.

Ready to put this into practice?

Create your RoyLead account and start in minutes.

Get started free β†—