Google Maps requires a special Google Maps API key. Without this key, you cannot display Google Maps nor Google Map Charts on your website and on your WordPress plugins. In this tutorial, we’ll guide you through the process of creating a Google Cloud Console project and obtaining a Google Maps API key.
Step 1: Sign in to Google Cloud Console
- Go to Google Cloud Console.
- Sign in with your Google account or create a new one.
Step 2: Create a New Project
- Once signed in, click on the Select a project dropdown at the top of the page.
- Select New Project to create a new API project
- Give your project a suggestive name (e.g. Maps API key for Analytics Insights) and click on Create
Step 3: Enable the Maps JavaScript API
- From the Google Cloud menu, navigate to APIs & Services
- From the APIs and services left menu select Enable APIs and services.
- From the top-screen select + ENABLE APIS AND SERVICES and enable the Maps JavaScript API, using Search for APIs and services:
- Click the “Enable” button.
Step 4: Create API Credentials
- From Google Cloud left menu, select APIs & Services and click on Credentials
- Click on + CREATE CREDENTIALS and choose API Key
- Copy the generated Maps API key
Step 5: Use the API Key
To use the Maps API key in your Analytics Insights plugin, go to your WordPress admin screen. Select Analytics Insights under the left menu and click on Backend Settings. Enter your newly generated Maps API Key under Location Settings. Click Save Changes. That’s all!
PS: You can use the same Maps API Key to show a Google Map on your site and you can as well use it in other WordPress Plugins if needed.