Google requires you supply an API key to use its auto-complete feature. This is a long string of characters generated by Google so they recognise you when you (your website) make calls (looks up addresses) to the API. You will have to collect your API key from Google once generated, and add it to the ‘Google API Key‘ field in the Cab Grid Pro OPTIONS tab:
Follow these steps to get your Google API key:
Note 2: This process may vary depending on what you have set up already… For example, you may already have a ‘Project’ or an ‘API key’ generated…
- Visit https://console.developers.google.com/apis/
(You may need to log on to your Google account – assuming you have one – first. If not, you’ll have to sign up. We won’t cover that here.)
- If required, create a project (or select an existing one – see step 4)
Give the new project a name and click CREATE
- Enable the API
- Go to CREDENTIALS
- Click ‘Find out what credentials you need?’ and copy the contents of the ‘Here is your API key’ box.
Your API key should be a long string of characters (upper/lower case and numbers)
- Set restrictions (optional – recommended)
Your key may not function correctly if you do not fully specify the domain names used to access your site (e.g. yoursite.com & yoursite.net)
- Add the Google Places API Web Service to your project
Form your Google Developer Console Dashboard click ‘Enable API‘, then click ‘Google Places API Web Service‘
Click ‘ENABLE‘ to add to your project:
Now you have your API key on your computer’s clipboard, you can return to your WordPress admin and paste it into the ‘Google API key’ field under the OPTIONS tab on the Cab Grid Pro admin page.
Country Bias: The auto-complete field will attempt to find addresses based on the user’s location unless you set a country bias. It’s best to select the country where you primarily operate to insure accurate address lookups.
Be sure to click SAVE at the bottom.
Now the booking form will attempt to auto-complete addresses entered.
If you leave the Google API Key field blank, a regular text box will be used. Customers can still add any content (such as flight number or other details) in the ‘Pick Up’ and ‘Destination’ boxes with or without the API.
Tags: address, API, Booking Form, geolocate, geolocation, google, maps