Generating Google Maps API Key
In this step-by-step guide, we will show you how to create Google Maps API key. This key is necessary for the proper operation of the Chauffeur Taxi Booking System, and generating it will take you about 5-10 minutes.
Getting a key itself is free and using it is free of charge up to the monthly limit, which is currently $200. You won’t be charged until your usage exceeds $200 per month (and if you go over your limit, you’ll only be charged for the amount above your limit). In addition, you can set alerts that will notify you when you are approaching your monthly limit. More information about pricing plans can be found here (see Dynamic Maps / Maps JavaScript API).
Important!
Never reveal your Google Maps API key and limit its use to the domain to avoid additional operational costs. More on domain restriction later in this guide.
Create Google Maps API Key
Log in to your Google account. Open the Google Cloud page at https://console.cloud.google.com (if you are not logged in, Google will prompt you to log in). Click on the navigation menu icon (in the upper left corner of the page), find ‘Google Maps Platform’.
After clicking, you will be taken to the Google Maps Platform page. Click on the ‘APIs & Services’ menu item.
If you don’t already have an account on the Google Maps platform, Google will ask you to create one. Select ‘Terms of Service’ checkbox and click ‘Continue’.
Set your account information and add a payment method. Don’t worry, Google will only use the added payment card to verify your account. It will be charged $0.00 for verification purposes. Make sure the entered details are correct and click the ‘Start My Free Trial’ button.
An attempt will be made to charge the card with $0.00 and after successful verification, you will be taken to a new page where you will be greeted by a survey. Fill it out as you wish and click ‘Submit’.
Google will generate a key for you, you will see a window as in the screenshot below. Uncheck the ‘Enable all Google Maps APIs for this project’ checkbox. This is important. We will choose specific APIs later. You can leave the second checkbox selected. Google will notify you by email when you are close to exceeding your monthly usage credit. Click ‘Go To Google Maps Platform’ button.
You will see another modal window, this time it will concern key security. We recommend creating domain protection. In the ‘Select restriction type’ field, select ‘HTTP referrers (web sites)’ from the list. In the ‘Referrer’ field, indicate the domain on which the generated key is to operate (e.g. the domain where you installed the Chauffeur Taxi Booking System plugin). Enter your domain name in the format ‘*.domainname.com’ and click ‘Restrict Key’.
Include Necessary APIs
You now see the main page of the Google Maps Platform. Select ‘APIs & Services’ from the left menu.
You will be taken to a page listing all available APIs.
For your plugin to work properly, you only need to select the following APIs:
- Places API
- Maps JavaScript API
- Roads API
- Geocoding API
- Directions API
For each of them, click ‘Enable’. Then scroll up the page and select ‘Enabled’ from the ‘Filter’ menu. You will only see enabled API keys. The list should look like the screenshot below and contain only five APIs:
Now select ‘Keys & Credentials’ from the left menu, on the new page you will see your ‘Maps API Key’, click on it.
A summary page will open with all information about the generated key. Please review your ‘Application Restriction’ settings again, make sure they apply to ‘Websites’ and check that the domain is correct. In the ‘API Key’ field you will find the key. Copy it. Keep this page open for now.
Paste the Key Into the Plugin Settings
Go to your WordPress admin, navigate to the ‘Settings’ -> ‘Chauffeur Booking System’ menu. Go to ‘General’ -> ‘Google Maps’ tab. Paste the previously copied key into the ‘Google Maps API Key’ field and save the changes by clicking ‘Save changes’ button.
Create Google Billing Account
Return to the open Google Cloud website and go to the menu item called ‘Billing’.
If You Don’t Have a Billing Account Yet
Google will ask you to create one (if not, simply click the ‘Create Account’ button). Provide an account name and select the country on the basis of which the settlement currency will be assigned. The next step will be to verify your credit card. Correct verification will complete the billing account creation stage.
If You Already Have a Billing Account
You’ll be taken to a page with a summary of your account information. Here you have access to reports related to the costs you incur for using Google Maps API. By selecting ‘Budgets & alerts’ from the menu you can set alerts that will notify you when you are approaching your monthly limit.
Congratulations, you have just connected your booking system with Google maps!
Summary
Document version: 1.0
Last updated: October 11, 2023
Plugin version: 6.8+