Adding a Google Maps API Key

Because of recent changes made to the way Google Maps are served, installations of Events Manager activated in June 2016 or after need a Google Maps API key to be able to use Google Maps.

If you’re unable to load maps or are seeing Location Not Found errors when trying to use maps in Events Manager, check you’ve completed the steps below.

Step 1. Make sure you’re running version 5.6.4.1 or above of Events Manager.

Because API keys for Google Maps weren’t needed before the release of Events Manager 5.6.4.1, earlier versions of the plugin don’t include the option to add a Google Maps API key.

Step 2. Get your Google Maps API key

Google’s official instructions for creating API keys are here:
https://support.google.com/cloud/answer/6158862?hl=en&ref_topic=6262490

Setting up an API key can be confusing, especially if you’re not a web developer, so we’ve included a step-by-step guide below.

First go to the Google API Console here:
https://console.cloud.google.com/start

You’ll need to sign in with a Google account if you’re not already logged in.

Then click the Use Google APIs panel.

Selection_001

You’ll be prompted to choose a name for a new project and to accept the API agreement.

Selection_002

On the page that appears after the project has saved you will need to enable three Google Maps APIs. You may need to click the ‘more’ link a the bottom of the list to see them all. Click on Google Maps Javascript API, Google Places API Web Service and Google Maps Geocoding API.

maps-api-enable

Then click Enable on the following screen. Then click the back button right next to it, or alternatively click the Overview menu item. Make sure you enable the three APIs mentioned above.

Selection_004

After the all the APIs are activated, click Go to Credentials (alternatively you can click the Credentials menu item as in the image above).

Selection_005

Important: On the credentials screen, make sure that Google Maps Javascript API is selected under Which API are you using?

Now set the Where will you be calling the API from? dropdown to say Web browser (Javascript) and click What credentials do I need?

Selection_006

On the next screen enter a name for the API key.

You’ll also need to add the domain name of the site where you’re using Events Manager under Accept requests from these HTTP referrers (web sites). To make sure that map requests work from anywhere on your domain, we recommend adding more than one entry using the following patterns:

  • *.yoursite.com
  • yoursite.com

Note: To avoid problems with www and non-www versions of your domain, don’t include the www part of your website URL.

After clicking the Create API Key button, you’ll be shown your new API key.

Selection_008

Step 3. Add the API key to Events Manager

Go to Events > Settings > Formatting > Maps and paste your key into Google Maps API Browser Key.

Selection_009

Click Save Changes and create an event with a map to check that both admin and front-end functions are working correctly,

Troubleshooting

If you’re having problems getting Google Maps to work on your site, try testing with Accept requests from these HTTP referrers (web sites) left blank.

If maps are loading with that setting, it indicates there’s a problem with either the domain name or the pattern used with it.

If maps still don’t load, you may have a problem with the way Events Manager is configured.

Aside from testing, we recommend using a domain pattern in Accept requests from these HTTP referrers (web sites) to prevent unauthorized use of your API key.

Note: This credentials page in the Google API Console also shows the usage and quotas for your account, if you need to check this later.