Extensions

Search Extensions

Google Maps API Key Restrictions

You can use your own Google Maps API Key with The Events Calendar to get more out of your venues and maps.

A Google Maps API key, when used a lot and uncontrolled, can incur costs. In order to have some control over it, you can put some restrictions on the key. However, that doesn’t always play out well.

The Events Calendar requires three APIs to be enabled: the Maps JavaScript API, the Geocoding API, and the Maps Embed API.

(You can find detailed information about setting up your Google Maps API Key in this article.)

These APIs, however, cannot work with the same restrictions. The workaround is to use two separate Google Maps API Keys.

Setting up the keys

You will need to set up two API keys in your Google Cloud Platform Console.

Set up one Google Maps API Key for JavaScript map displays (Maps JavaScript API – The Events Calendar; Maps Embed API – Events Calendar Pro). For this key should select “Websites” restriction and add the domain name of your website as a value. Under API restrictions select the “Maps Embed API” and the “Maps JavaScript API”.

A screenshot of Google Maps API restriction settings

Setting up key restrictions for displaying maps

Set up a second API Key for venue geolocation lookups (Events Calendar Pro) with Geocoding API. This key should have “IP addresses” as a restriction. The value should be the IP address of your website.

Under the API restrictions select “Geocoding API”.

A screenshot of Google Maps API restriction settings

Setting up key restrictions for geocoding

Setting it up in your calendar

You will need to enter both API keys in your settings. By default, you only have one field for a Google Maps API key.

This extension will add an additional field below the existing one under Events → Settings → Integrations tab.

In the first “Google Maps API key” field enter the API key that you set up for JavaScript map displays.

In the second “Google Maps API key for Geocoding API restriction” field enter the API key that you set up for the Geocoding API.

Changelog

  • Version 1.0.1
    • June 24, 2023
    • Fix – Update to use the new Service_Provider contract in common.
  • Version 1.0.0
    • May 8, 2021
    • Initial release

Download Extension

đź‘‹ Heads up! We provide limited support for extensions, but you can still open a ticket over at our Help Desk to report any issues.
Install Instructions