How to setup Google geocoding

Category:

User guides

Topic:

Geocoding

Maps Marker Pro has a built-in geocoding framework which allows you to choose which geocoding provider to use. If you want to use Google for geocoding, you have to generate a Google Maps API key for Places API and Geocoding API.

Step-by-step tutorial

This tutorial will show you how to enable Google Geocoding in Maps Marker Pro by generating a Google Maps API key for Places API and Geocoding API.

We recommend to create a unique key for Google Geocoding in Maps Marker Pro only – even if you already registered a key for Google basemaps (as other methods for securing your Google geocoding key e.g. against quota theft are needed, see “Optional steps (Recommended)” below for details!)

Prerequisite: you must have a Google account to generate a Google Maps API key for Places API and Geocoding API:

  1. Open the following link with your google account to activate the needed APIs for geocoding:
    https://console.developers.google.com/flows/enableapi?apiid=places_backend,geocoding_backend&keyType=CLIENT_SIDE&reusekey=true
  2. Complete your Google profile (needed for new Google accounts usually only)
  3. Confirm the usage of an existing project or create a new project:
  4. Click on “Enable” to enable “Place API” and “Geocoding API”:
  5. Copy your Maps API key to clipboard:
  6. Log in on your WordPress Admin and navigate to Settings > Geocoding > Google and  paste the server key you copied earlier into the “Google API server key” field:
  7. Navigate to Settings / Geocoding / Provider and select Google as geocoding provider:
  8. Click the “Save Changes” button at the end of the settings page.

That´s it. Afterwards you can start using Google geocoding when creating a new map or marker:


Optional steps (recommended)

Secure your API key to prevent quota theft for example.

Please be aware that if you enable those restrictions for your Google Geocoding, that API key cannot also be used for Google Maps Javascript API (which needs restrictions by “HTTP referrers” instead) – instead you need an additional key (see related Google Maps Javascript API tutorial).

Prerequisite: you need to know the server IP where Maps Marker Pro is installed (tutorial on how to find the IP address of your server):

  1. Open Google Cloud Plattform (Enabled APIs & Services / Credentials)
  2. Click on “Edit API key” next to your created Google Maps Javascript API Key:
  3. Select “IP addresses” and add the IP of your server to “Accep requests from these server IP addresses”:
  4. Finish by clicking the “Save Button”

Terms of services

“In June 2018 Google launched a new pricing plan. Google continues to offer a free tier — all developers will receive $200 of free monthly usage of our core products. In addition, this change will require you to enable billing and associate it with all of your Google Maps Platform projects. (full official announcement)” – for a summary on how this affects you as Maps Marker Pro user, please have a look at our FAQ at https://mapsmarker.com/google-maps-tos-changes

All Google´s related Terms of Services can be found at https://developers.google.com/maps/terms.

Usage limits

If you enable Google Geocoding, the following 2 Google APIs will be used:

  1. “Autocomplete per character” with a minimum price of USD 2.83 for 1000 calls for up to 70.000 chars per month (pricing details)
  2. “Places Details” – Basic with a minimum price of USD 17.00 for 1000 calls for up to 11,000 calls per month (pricing details)

As Google gives all developers $200 of free monthly usage, only loads which exceed this amount will be directly billed by Google.


Reference for all Google Geocoding settings

Location Biasing

You may bias results to a specified circle by passing a location and a radius parameter. This instructs the Place Autocomplete service to prefer showing results within that circle. Results outside of the defined area may still be displayed. You can use the components parameter to filter results to show only those places within a specified country. If you would prefer to have no location bias, set the location to 0,0 and radius to 20000000 (20 thousand kilometers), to encompass the entire world.

language

The language in which to return results. See the list of supported domain languages. If you set a specific language at Settings / Google / “Google language localization”, that language will also be used for Google Geocoder. If no language is set, the current WordPress locale will be used.

region

Optional region code, specified as a ccTLD (“top-level domain”) two-character value. This parameter will only influence, not fully restrict, results from the geocoder. For more information see Region Biasing.

components

Optional component filters, separated by a pipe (|). Each component filter consists of a component:value pair and will fully restrict the results from the geocoder. For more information see Component Filtering.


Updated on 29 May 2022