Google API Key for Importing Locations
Pro PlusEvents Manager I/ORequires an Events Manager Pro Plus license. Compare plans
Many sources describe a venue as one line of text, such as "Harbor Hall, Maple Bay". Events Manager I/O can send that text to Google and get back a full address with map coordinates, so the location it creates can appear on your maps and in location searches.
This is optional, and it is separate from the OAuth credentials used to connect Google accounts. It works with every import format, not only the Google ones, and you don't need the Google add-on for it.
Each location that is looked up costs up to two requests to Google (three for a Meetup import, which also asks for the timezone), every time the import is previewed or run. Google bills API use beyond its free allowance. To keep the count down, preview with a small Limit while you are testing, and leave Google API off for sources that already supply full addresses.
Create the key and add it to I/O
-
In the Google Cloud console, create an API key in the project you use for your site. The steps are the same as for a Google Maps key, described in Google Maps API key.
-
Enable these APIs for the project:
API Used for Places API Finding the venue from its text, then reading its details Geocoding API Turning coordinates into an address, and as a fallback when the Places quota is used up Time Zone API Working out the timezone of Meetup events from the venue's coordinates -
If you restrict the key, restrict it by IP address, using your web server's address. The requests come from your server, not from visitors' browsers, so a key restricted to website addresses (HTTP referrers) is refused. This is why the key you use for maps on your site usually can't be reused here.
-
In WordPress, go to Events I/O then Settings then General then General Options, paste the key into Google API Server Key, and click Save Changes.
The key is saved with the I/O settings and used for every import that has Google API turned on.
I/O 1.2.1 calls the original Places API web service (its Text Search and Place Details requests), not the newer product Google lists as "Places API (New)". Make sure the one you enable is the original. If Google doesn't offer it for your project, address lookups return nothing and the import falls back to splitting the text itself.
Turn it on for an import
The key does nothing until an import asks for it.
-
Open the import and click Show advanced location options.
-
Set Google API to one of:
Choice When to use it Do not use Google API. The source already has complete addresses, or you don't want lookups. Allow Google API to automatically guess the address. The source gives one line of text. Google searches for that text as written. Allow Google API to improve the address information. The source gives an address that is mostly right. I/O first splits it using your Location Format settings, then asks Google about the result. -
Save, and check the locations in the preview before importing.
Until a key has been saved, the Google API field is disabled and shows a note that a key is required. The link in that note opens the Events Manager settings page. The key field is under Events I/O then Settings.
iCal, CSV, Excel and Google Calendar imports start with Allow Google API to automatically guess the address. selected. Meetup and Facebook imports start with Do not use Google API., because those services send structured addresses.
What Google fills in
When Google finds a match, I/O takes from it:
- the map coordinates, always
- the venue's name, if the source gave none
- the street address, town, state, postcode and country, each only where the source left it empty
Details that came from the source are kept. If Google finds nothing, the location is created from the source's text alone, without coordinates.
A source that provides coordinates but no address is handled the other way around: the coordinates are sent to Google to find the street address.