How to generate and use the Google Maps API key

In order to take full advantage of all the options and features Google Maps offer within a theme, you should input the Google Maps API key. Google has many different API types available, and each of these offers a different service (e.g. Geolacation, Geocoding…).

To generate a Google API key you should first login to your Google account (gmail). After this, you should visit the Google Cloud Platform.

api-key.png

After you’ve accepted the terms of use, you’ll get access to your dashboard:

api-key-1.png

Now that you have the access to the dashboard, you should create a new project using the option located in the top menu:

Screenshot_13.png

You can find more info on this here.

After you add the project, you should select the said project in order to see all the available options in your dashboard:

Screenshot_14.png

Now you should scroll down to the Google Maps option and select Overview:

Screenshot_15.png

This will present you with a page which lists all the APIs and the services available:

api-key-6.png

You should select and create an API which fits your needs the best. For the purposes of this guide, we’ll choose the Maps JavaScript API. After you click on an API you should Enable it:

Screenshot_16.png

The next step requires setting up your credentials:

Screenshot_17.png
Screenshot_18.png
Screenshot_19.png

Now that your API key has been generated, pick the Restrict Key option:

Screenshot_20.png

After doing so, you should click the Save button.

At this stage you are required to name the API. It doesn’t make any difference which name you decide to use.

Optionally, you can introduce additional restrictions for domains and limit the use of this API key to some of them. This is something you should consider doing, as someone might take your API and reuse it.

If you decide to use this restriction option, you’ll want to open your site like this:

https://yoursite.com/*

This will add a list containing all the website page from your web location. You should not input subdomains or www.

api-key-13.png

Keep in mind that the Google maps services are being used in commercial purposes for a while now, and all the traffic requires paying. You can learn more about this here.

In case you need to activate the Google Geocoding service, you can find more about them by following this link.

If you are using a listing theme it’s of crucial importance to activate the Places API:

Screenshot_21.png

Last updated

Was this helpful?