How to obtain a Google Maps API key for the Announcements & Events PrestaShop module
How to obtain a Google Maps API key for the Announcements & Events PrestaShop module
The Announcements & Events module for PrestaShop enables you to offer geolocation-based searches thanks to Google Maps integration.
For this to work properly, you need to create a Google Maps API key.
Here's a step-by-step guide to generating your own API key and adding it to the module.
?
Steps to follow
- Log in to your Google account
Access Google Cloud Console and log in with your Gmail account.
- Create a Google Cloud project
Click on the project selection menu at the top, then on "New project".
- Give it a name (e.g. Classifieds Project) then click on Create.
- Activate the necessary APIs
Go to API & Services > Library, then search for and activate the following APIs:
-
- Maps JavaScript API (mandatory)
- Geocoding API (to translate addresses into GPS coordinates)
- Places API (optional for location suggestions)
- Create an API key
Go to API & Services > Identifiers, then click on Create identifiers > API key.
- A key is automatically generated.
- Restrict the use of your key (recommended)
Click on the pencil next to the API key to modify it, and apply:- Restriction by HTTP referrer: add for example
https://votresite.com/* - API restriction: select only the APIs activated above
- Restriction by HTTP referrer: add for example
- Add a billing method
Even if Google offers $200 of free credit per month, you'll need to register a credit card.
- Don't worry: this is sufficient for moderate use, such as on an e-commerce site.
- Paste the API key into the
module Once the API key has been generated:- Log in to your PrestaShop back-office
- Access the Announcements & Events module configuration
- Paste your API key into the field provided
- Save ?
?
Security tip
Never share your API key without restrictions.
Remember to always activate domain restrictions to prevent fraudulent use.
Linked products