Everything you need to know about API keys in Google Maps for your project
Google Maps requires the usage of an API key in order to work properly, as stated by the company’s new regulations in June 2016. They are a requirement for displaying the application on your website, and if you have a business or are planning to set up one, this is something you should pay attention to. To Create a Location in Google Maps Plugin you need to create a Google Maps API key first, which you can easily do after reading this tutorial.
Step 1: Create New Project
To begin creating your API key for Google Maps, go to the Google Developers Console and choose between creating a new project or using an existing one. After your selection, click Continue.
- Google Maps Directions API
- Google Maps Distance Matrix API
- Google Maps Elevation API
- Google Maps Geocoding API
- Google Maps Places API Web Service
Step 2: Project Name & HTTP Referrer
The next step to create a Google Maps API key is to enter your project name and HTTP referrer on the page displayed. Leaving this field empty can cause other users to use your key in other domains, so you’ll need to restrict your API key by doing the following:
- Click the API key you want to restrict and open the property page. Here, place yourself on the Key restrictions and apply these reductions:
- For restrictions within Google Maps. To allow requests from websites you supplied, you’ll need to select HTTP referrers (web sites) in the Application restrictions list. One of the more referred websites can be selected if you need to.
- API key specific restrictions. To restrict an API key for Google Maps, select Restrict key and then click Maps Embed API, which can be found in the Select APIs list. Save your preferences and you’re done.
Step 3: Copy Your API Key
After creating your Google Maps API key, copy the generated key to use it on your application.
You can also manage your enabled keys on your Dashboard menu. To enable or disable an API key, here’s what to do:
- Go to the Google Maps Platform and access the Maps API Library page.
- Select the API you want to enable and take a look at what the screen is displaying:
- Enable. If the screen shows an “Enable” sign, click it to authorize your Google Maps API key.
- Manage. In case it says “Manage”, you’ve already enabled the API key and don’t have to do anything else.
If you want to disable an API key in Google Maps simply click the “Disable” button.
Step 4: Paste Your API Key
The last step is to go to the Settings page on the WP Google Maps application and paste your API key, then click Save.
The next thing to do is attach a billing account to the project and the following paragraph can help you with that.
Google Maps Billing Account Attachment Method
You can use the Google Cloud Platform Console to manage your Google Cloud Platform billing account in which from the console, you can update account settings such as payment methods, fundamental for using the application on your website.
Some Google APIs charge for usage after crossing the limit, and you need to enable billing before you can start using these APIs. If you enable billing for a project, then every billable API in that project is billed, based on the project’s usage.
Note: Google Maps API provides you 200$ credits every month free of cost. If you are using more than 200$ per month then you have to pay as per the use.
Step 1: Attach Billing To New/Existing Project
Log into your account and select the project you want to attach the billing account to.
Then, open the console displayed to the left and select Billing.
You can Try Google Cloud Platform for a free trial to accept the terms of services too. Simply fill in the information of your business, including account type, tax information, address, contact details, and monthly automatic payments (including your payment method).
Step 2: Set Up New Billing Account
Select the New Billing Account button by opening the billing account list. To do this, click the name of your existing billing account near the top of the page, and then select Manage billing account.
Step 3: Billing Information
After the previous step, enter the name of the billing account and enter your billing information. The option you see will depend on your billing address.
Then, click Submit and Enable billing to finish setting up your location on Google Maps.