Add Google Maps API to Store Locator

Modified on Wed, 28 Oct at 8:39 AM

Store Locator uses Google Maps for your customer-facing maps. To achieve that, you need to obtain a Maps API key from Google. This key renders maps, geocodes addresses, and powers search features.


Google Maps Platform pricing and free-usage thresholds vary by API and change periodically. See Google's pricing overview for current details.


Step 1: Create a Google account

  1. If you don't already have one, go to Create a Google Account and follow Google's sign-up steps.
  2. If you already use Gmail or another Google product, you already have a Google account and can skip this step.


Step 2: Create a new project

  1. Go to the Google Cloud console and sign in.
  2. Click the menu button and select IAM & Admin > Create a Project.
  3. Enter a project name and click Create. (Or select an existing project if you already have one.)


Step 3: Create a billing account

Google Maps APIs require billing to be enabled. New Google Cloud customers get an introductory free-trial credit — see Google's free trial details for current terms and eligibility. See Google's pricing overview for current free-usage thresholds and costs.


  1. Click the menu button and select Billing.
  2. Choose Add billing account if this is your first one, or Manage billing accounts if you already have one.


Step 4: Verify the billing account

  1. Click the menu button and select Billing.
  2. In the left-hand menu, select Payment method.
  3. Confirm your card or other payment method is valid.
  4. Check that your account status shows Active.


Step 5: Select your APIs

  1. Click the menu button and go to APIs & Services > Library.
  2. Search for each API below, click it, then click Enable. 
API
What it doesRequired?
Maps JavaScript API
Shows the interactive map on your storefront
Yes
Geocoding API
Turns addresses into coordinates so locations appear in the right place
Yes
Routes API
Finds the best route from a customer to one of your locations (newer)
Yes - enable this or Directions API
Directions APIProvides directions from a customer to one of your locations (older)
Alternative to Routes API
Places API (New)
Helps customers search for places and look up location details (newer)
Yes - enable this or Places API
Places APISame job as Places API (New) (older)
Alternative to Places API (New)


For directions and places, enable the newer API when you can. Store Locator still works with the older ones if your store already uses them.


INFO

After you save your key in Step 6, API checks appears under the key field on Apps > Store Locator > Settings > Map provider (with Google Maps selected). The heading is API checks, with the line Status of the Google Maps APIs required for your store locator. Refresh on the right runs the checks again.


Each row is one API your store requires. The name in the row is the API to enable in Google Cloud. The icon on the left is the status:


  • Green check (Operational) — that API is enabled and your key can use it.
  • Caution icon (Needs attention) — the check failed. Uncollapse the row to see the Error returned by Google, then click Open in Google Cloud Console. That option opens the Google Cloud page for the API that needs attention.
  • Info icon (Cannot check due to referer restrictions) — the key has website restrictions, so this check cannot run from Store Locator's servers. Open the row for the steps: website restrictions are recommended for your storefront. To run the checks, temporarily remove the referrer restrictions, finish setup, then restrict the key again.


If your store is still on an older implementation, using the Directions API or Places API there will be a link to upgrade to the new implementations.


Upgrading is optional. After you upgrade, enable the newer API in the Library, then click Refresh. Once that row shows a green check, you can disable the older API.


Step 6: Add Google Maps API key to Store Locator

  1. Click the menu button and go to APIs & Services > Credentials.
  2. Click Create Credentials > API key.
  3. Copy the generated API key.
  4. Optionally click Restrict key to add HTTP referrer restrictions (recommended). See Adjusting Google API key restrictions.
  5. From your Shopify admin, go to Apps > Store Locator > Settings > Google Maps API key.
  6. Add the key and save changes.


Deleting or replacing the API key

If a key is already saved, a Delete button appears next to the field on the Settings > Google Maps API key page.


  1. Click Delete and confirm.
  2. Enter your new key.
  3. Save changes.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article