Skip to main content
Google Maps API Key
Speak DevTeam avatar
Written by Speak DevTeam
Updated over 10 months ago

Google Maps API Key

The Google Maps API allows your SiteWrench site to embed Google Maps into pages or retrieve data from Google Maps. The customization for these maps varies based on the tools used and data supplied by Google.

Any SiteWrench site that uses the Locator or the Store Directory page parts, must have a Google Maps API Key to function.

What do I need to do?

Short answer: If you already have an API Key, go get it and add it to your site's settings.

YourSiteURL.com/admin/settings/general.aspx (replace “YourSiteURL.com” with your organization’s domain.)

do_i_have_an_api_key.png

The longer answer...

There may be a cost from Google associated with using a Google Maps API Key. Google explains billing for the API key https://developers.google.com/maps/billing/gmp-billing

You'll need:

This article covers setting up a payment method and subscribing to the API services.

Create A Payment Method

1. Go to https://cloud.google.com/ and sign in with your Google Account and choose Get started for free.

mceclip0.png

2. Once signed in, choose Payments & subscriptions, then follow the instructions to add a new payment method, then choose Start my free trial.

mceclip1.png

The first part's complete!

Subscribe to Google Maps API Services

Expose the left menu and choose APIs & Services

mceclip2.png

Select Enable APIs and Services

mceclip3.png

From the API Library, search Maps

mceclip4.png

You'll need to subscribe to 2 services

JavaScript API

mceclip5.png

Geocoding API

mceclip6.png

Choose one of the services and then Enable it. Follow the same procedure for BOTH services.

mceclip7.png

Now that you have enabled the services for your account, the next step is to create your key. From the Google Cloud Platform dashboard, choose Credentials from the left menu and then select Credentials in APIs & Services.

mceclip8.png

(At this point if you already have an API key, it will be visible.)

From the Credentials dashboard, choose +Create Credentials and then select API Key

mceclip9.png

If you see a message like the one below, CONGRATS you're now the owner of a new Google API Key.

mceclip10.png

Copy that key, head back over to your website Settings > General
(yoursite.com /admin/settings/general.aspx)

Paste the key in the field and save.

DO NOT close the Google Console or dismiss that modal because we'll want to add some security to your API key.

mceclip11.png

That's it! You're done with the SiteWrench part of things.

Restrict Your Key

Go back to that window and modal that you didn't close. Choose Restrict Key

mceclip12.png

At the top of this screen, you really should name your API Key so you know what it’s used for. Your website URL is a good name choice.

Three steps to restricting your API key

mceclip13.png

1. Application Restrictions - set which websites can use your API key.

Choose HTTP, then Add an item. You will need to do this twice to add 2 URLs

  • First, add your domain exactly like this (but use your website address instead of madebyspeak.com):
    *.madebyspeak.com/*

  • Next, repeat the process and add your alternate URL (the one used before your website launched) exactly like this
    *.yoursite.sitewrench.com/*

2. Restrict the services this key is allowed to access to the Javascript API and Geolocation API. This is optional, but can't hurt. The only reason you would not want to do this is if you have plans to use the same key for a different Google API service.

  • Choose the Restrict key option

  • Select Javascript API and Geolocation API from the list

3. Save your work and now you're truly done. Nice job!

Did this answer your question?