Generate And Setup Google Maps API Keys

* Note, this tutorial in some steps refers to the GEO my WP plugin. However, the steps to create the API keys are the same for other geolocation plugins as well. Make sure to enter the Google API keys that you create in the settings page of your plugin.

Follow the steps below to create both server and browser ( client-side ) Google Maps API keys for GEO my WP plugin ( or for your other projects ), and to enable the required API services. 

  1. Navigate to the Google Maps Platform and Click 'Get Started'.
  2. Check the 'Maps', 'Routes' and 'Places' checkboxes and click Continue.
  3. Either select an existing project or create a new project. If you are creating a new project, you will need to enter a name for it, for example, "GEO my WP Maps API Keys". Click 'Next' when you are done.
  4. At this point, if you don't already have a billing account, you will need to create one. If you do need an account, click 'Set Account' and follow all the steps to create the billing account ( those steps are not mentioned in the tutorial ).
  5. Click Next to create your first API key.
  6. Your first API key is now ready. Copy the newly generated API key ( you'll need this to enter in the settings page of your plugin later ) and click the API Console link to set it up. We will set up this key as a browser ( client-side ) key.
  7.  Enter a name for this API key in the 'Name' input box. Since this will be your browser's key, you can name it something like "GEO my WP Browser key. 
  8. Scroll down that same page. In Application Restriction select 'HTTP Referrers' and enter your website's domain in the input box. For example, mysite.com/*. When you are done, click 'Save'. You will then be redirected to the Credentials page where you will see your new API key. 
  9. Now we need to create a server API key. In the Credentials page click 'Create credentials' then click 'API Key' from the list.
  10. You have now created a new API key. Click "Restrict Key" to set it up as a server key.
  11. Enter a name for this API key in the 'Name' input box. Since this will be your server key, you can name it something like "GEO my WP Server key. 
  12. Scroll down that same page. In Application Restriction select 'IP addresses (web servers,  cron  jobs, etc.)' then enter your server's IP address in the input box. When you are done, click 'Save'.
  13. Now we need to enable the required API services. Click 'Dashboard' on the menu to the left.
  14.  Scroll down to check if all the required API services enabled. By default, all the Map API services should be enabled. The required API services you need to look for listed below: 
    • Maps JavaScript API
    • Directions API
    • Distance Matrix API
    • Geocoding API
    • Geolocation API
    • Places API
    • Roads API
    • Street View API

  15. If any of the API services are missing or disabled, you'll need to enable them. To do so, click the 'Enable APIs and services' button.
  16. Now you can either type and search for specific API/service, or click 'view all' in the 'Maps' category to view all the map services.
  17. Find the specific API that you would like to enable and click on its box.
  18. Click 'Enable' to enable the API service.
  19. Repeat steps 11 to 14 to enable all the required API services that were mentioned in step 10.

That's it, y ou are done. Your API keys should now be ready to use. You can now enter your API keys in GEO my WP settings page ( or in the settings page of your other plugins ).