For enhanced security and performance, MapCosmos requires two separate Google Maps API keys: a  Public Key to display the map on your website and a Secret Key for backend services like geocoding.  This guide will walk you through creating and configuring both keys – the process should take around  7 minutes to set up.
Step 1: Set Up Your Google Cloud Project
First, you'll need a Google Cloud project with billing enabled and the necessary APIs activated.
- Go to the Google Cloud Console and log in.
- Select an existing project or create a New Project. Make sure Billing is enabled for the project.
- Navigate to APIs & Services > Library.
- Search for and enable the following three APIs:
- Maps JavaScript API
- Geocoding API
- Places API
âś… Tip: If you're targeting customers in specific regions (e.g., "store locator in New York" or "nearby stores in Toronto"), a properly configured map will improve local SEO and user experience.
Step 2: Create Your Public API Key (Client-Side)
This key is used on your public website to show the map and must be secured.
- Go to APIs & Services > Credentials and click Create Credentials > API Key.
- A new key will be generated. Copy it, then click the Edit API key option.
- Give the key a name, like "MapCosmos Public Key".
- Under Application restrictions, select Websites. Add your website's domain
(e.g. yourstore.com). - Click Create.
Step 3: Create Your Secret API Key (Server-Side)
This key is used by MapCosmos for geocoding and mapping, and must not be used on public websites:
- Go back to Credentials and click Create Credentials > API Key again.
- Give this key a name like "MapCosmos Server Key".
- Under Application restrictions, do not select 'Websites'. This key is not for public use.
- Recommended: Under API restrictions, select Restrict key and allow only the Geocoding API, MapsJavaScript API, and Places API.
- Click Create.
Step 4: Add Both Keys to MapCosmos
Finally, add the two keys to your MapCosmos settings.
- Log into your MapCosmos account and go to General Settings.
- In the Map Provider section, under Google Maps:
- Paste your Public Key into the Google Maps API Key (Public) field.
- Paste your Server Key into the Google Maps API Key (Secret) field.‍
- ‍Save changes.
âś… You're Done!
Your MapCosmos widgets are now securely powered by Google Maps. For support, feel free to contact us at contact@mapcosmos.com.
Why Google Maps + MapCosmos Store Locator Is Perfect for Geo-Targeting Customers
Integrating Google Maps with your store locator is ideal for businesses targeting users by location. Whether your audience searches for:
- “shoe stores near me”
- “electronics store in Chicago”
- “pet supplies in San Diego”
…a properly configured MapCosmos store locator ensures your locations show up clearly on the map with accurate data.
This setup enhances both:
- User experience (better navigation and accessibility)
- Local SEO rankings (appear in “near me” and geo-based search results)
Need Help Choosing Between Google Maps and Mapbox?
We’ve written a detailed comparison of Google Maps vs. Mapbox for store locators 🆚. In the guide, we cover:
- Pricing differences
- API features
- Speed and reliability
- Best use cases for each platform
If you're unsure which is right for your business, this guide will help you make an informed decision.
Ready to Boost Local Visibility with MapCosmos?
By integrating Google Maps with MapCosmos, you’ll deliver a seamless, geo-intelligent experience to your customers — helping them quickly find the closest store location, no matter where they are.
For further assistance or custom integrations, don’t hesitate to contact our support team.