Registering a Google Maps API key

You can add a map section to your theme to show the location of your business. Many of the free themes from Shopify include a map section that you can add to your home page.

For the map to display, you will need to register a Google Maps API key and include it in the map section settings in the theme editor.

Register a Google Maps API key

  1. Visit the Google Maps Get API Key page and click the Get a key button. If you are not signed in to a Google account, then you will be directed to the Google Accounts Sign In page where you can sign in or create a new Google account.

  2. Click the Select or create project list and select + Create a new project.

  3. Enter a name for your new project and click Create and enable API.

  4. Copy your new Google Maps API key to your clipboard.

Add your Google Maps API key to your theme

  1. Find the theme you want to edit and click the Customize button for the theme.

  2. Click the Sections tab.

  3. Click Add section.

  4. Click Map > Add.

  5. Enter the information for your map. In the Google Maps API key field, paste your Google Maps API key.

  6. Click Save.

Google has a limit of 25,000 map views per day. When the limit is exceeded, the map will be replaced by the background image or color that you have specified in the theme editor. For more information about the map view limit, see the Google Maps Javascript API Documentation.

Restrict API access to only your store

Your API key is a unique identifier for your map section. You can prevent others from using your API key by restricting its access to only your domains.

To restrict your API key:

  1. Go to the Google API credentials page.

  2. Select your project from the menu.

  3. For the API key that you generated, click Edit.

  4. Click HTTP referrers (web sites) and enter any domain associated with your store, including your .myshopify.com domain. For example, if you have a custom domain, then enter both myCustomDomain.com/* and shop1.myshopify.com/*.

  5. Click Save.

Want to discuss this page?

Visit the Shopify Community

Ready to start selling online with Shopify?

Try it free