IMPORTANT - Only Australian addresses can be looked up through Google Address Validation on the Commerce Vision platform.
Prerequisites
- Must be on version 4.40+
- A Google project with a billing account and the Places API enabled (see Set up in Cloud Console)
Overview
This guide shows how to create, restrict, and use your API Key for Google Maps Platform.
What is an API key?
An API key is a unique identifier that authenticates requests associated with your project for usage and billing purposes. You must have at least one API key associated with your project.
Step-by-step guides
Enabling the products in google cloud
- Go to: https://console.cloud.google.com/
- Head to Enable APIs & Services > Library > Search for "Places API" > Click into product > Enable
- Do the same again for "Place API (new)" & then again for "Maps Javascript API"
Creating API Keys
- Go to: https://console.cloud.google.com/
- On the Credentials page, click Create credentials > API key.
The API key created dialog displays your newly created API key.- Click Close.
The new API key is listed on the Credentials page under API keys.
(Remember to restrict the API key before using it in production.)
Once your API is created you will need to restrict the API to your website URL and any associated Stage sites so it cannot be used for unauthorized use. Restricting API Keys adds security to your application by ensuring only authorized requests are made with your API Key. We strongly recommend that you follow the instructions to set restrictions for your API Keys. For more information, see API Key best practices
Adding Keys to CMS
- Go to Settings → Feature Management → Delivery Address Lookup Provider Feature Settings → Google
- Ensure "Google Address Lookup Service Uri" is set to
`https://maps.googleapis.com/maps/api/js?key=`- Enter the Google API Key
If you're using a version before 4.40, then head to Setting → Settings → Google Merchant Settings to fill in the Google lookup details
What if it still doesn't work?
If the API is still not providing the right access – please add the Commerce Vision helpdesk gmail account and provide access so we can configure as required.
CV support gmail: commercevision.helpdesk2@gmail.com
How to add CV support: https://support.google.com/googleapi/answer/6158846?hl=en#zippy=%2Cadd-project-members
Restricting API keys
- Go to the APIs & Services > Credentials
- Select the API key that you want to set a restriction on. The API key property page appears.
- Under Key restrictions, set the following restrictions:
- Set "Application restriction" to "HTTP referrers"
- Click "Add an item"
- Set referrer to *.yoursite.com/*
- To finalise your changes, click Save
Additional Information
Minimum Version Requirements | **.**.** |
---|---|
Prerequisites | -- |
Self Configurable | Yes / No |
Business Function | |
BPD Only? | Yes / No |
B2B/B2C/Both | B2B / B2C / Both |
Third Party Costs | n/a or Fees apply |
Related help