Secure Your Google Maps API Key

Google offers a robust and secure method for using your API key, making it easy to manage while ensuring it is only utilized on your designated websites. This approach enhances both security and ease of use, providing peace of mind as you integrate your API.

If you have already created the API key, follow the below steps to apply the restrictions for utilising it only on specified websites :

Step 1: Access API Credentials

  1. Open Google Cloud Console.

  2. Navigate to APIs & ServicesCredentials.

  3. Locate your API key and click on it to edit the restrictions.

Step 2: Set Application Restrictions

  1. In the Application restrictions section, select Websites.

  2. This limits the API key usage to specific domains only.

Step 3: Add Website Restrictions

In the Website restrictions field, enter your store domains without https://, as shown below.

Example entries:

Required domains for Shopify and the app:

circle-info

Important notes:

  • Replace example.com with your actual store domain.

  • If your store uses a www prefix (e.g., www.example.com) you do not need to add it separately. Using example.com is sufficient.

Step 4: Apply API Restrictions

  1. Scroll to the API restrictions section.

  2. Select the Restrict key.

  3. Choose the required API services from the list (based on your integration needs).

circle-info

Note: Following API services must be added.

Geolocation API Geocoding API Maps Javascript API Places API Places API (new)

Step 5: Save Your Changes

  1. Click Save at the bottom of the page.

  2. Your API key restrictions will now be applied and enforced.

Last updated