In this article · 8 sections
- Option 1: The simple embed (free)
- Option 2: Maps Platform APIs (usage-billed)
- Keeping costs under control
- Securing your API key
- Privacy considerations
- Alternatives
- Frequently Asked Questions
- Is embedding a Google Map on my contact page free?
- Why did I get a Google Cloud bill?
- Can I hide the API key completely?
- Does a map embed help local SEO?
- Need maps or a fare calculator?
Most business websites show a Google Map on the contact page. Taxi and delivery websites often go further: address autocomplete, route maps and automatic distance-based fare calculators. These features use different Google Maps products, with different costs and security needs. Getting this wrong can mean an unexpected bill — or a key that strangers use at your expense.
Option 1: The simple embed (free)
For showing your location, use Google Maps' Share → Embed a map option, which gives an <iframe> code. The Maps Embed API is free to use and doesn't require complex setup. Tips:
- Embed your actual Business Profile location so the map shows your name and reviews.
- Add
loading="lazy"to the iframe so it doesn't slow the page. - Also show the address as text and a "Get Directions" link.
This is all most service businesses need. See contact page design.
Option 2: Maps Platform APIs (usage-billed)
For interactive features, you need the Google Maps Platform, a Google Cloud project with billing enabled, and an API key. Common APIs:
| API | Typical use |
|---|---|
| Maps JavaScript API | Interactive maps with custom markers and routes |
| Places API (Autocomplete) | Suggesting addresses as users type pickup/drop locations |
| Routes / Distance Matrix | Calculating distance and travel time for fare estimates |
| Geocoding API | Converting addresses to coordinates |
These are billed per request beyond Google's free usage allowances. Google changed its pricing model in 2025, moving from a single monthly credit to free usage thresholds for each product. Check the current Maps Platform pricing page and set budgets before going live.
Keeping costs under control
- Only call APIs when needed — for example, calculate distance when the user clicks "Get fare", not on every keystroke.
- Use autocomplete sessions correctly so a series of suggestions is billed as one session.
- Cache results for repeated routes (e.g., Ludhiana → Delhi Airport) where Google's terms allow.
- Set budget alerts in Google Cloud Billing.
- Set daily quotas per API in the Google Cloud console so costs can't run away.
Securing your API key
Keys used in website JavaScript are visible to anyone who views your page source. That's normal for browser-side Maps keys — but they must be restricted, or anyone can copy and use them on their own sites.
- Application restriction: for browser keys, restrict to HTTP referrers — your domain only, e.g.
https://yourbusiness.com/*. - API restriction: allow only the APIs that key needs.
- Separate keys: one browser key (for maps and autocomplete) and one server key (for distance calculations from your PHP code), each restricted appropriately. Server keys should be restricted by your server's IP address where possible and kept out of public files.
- Rotate keys if one has been exposed without restrictions — create a new key, update the site, then delete the old one.
- Never commit keys to public code repositories.
Privacy considerations
If you collect customers' locations (for example "use my location" for pickup), ask permission, explain why, and mention it in your privacy policy. See DPDP checklist.
Alternatives
For some uses, alternatives such as OpenStreetMap-based maps can reduce cost. For taxi fare calculators, many operators combine a Google distance lookup with their own fixed fares for popular routes. See taxi website features.
Frequently Asked Questions
Is embedding a Google Map on my contact page free?
Yes, the standard embed is free.
Why did I get a Google Cloud bill?
API usage exceeded free allowances, possibly due to inefficient calls, bots, or an unrestricted key being used elsewhere. Check usage reports and restrict the key.
Can I hide the API key completely?
Browser-side map keys are always visible; restrictions are the protection. Server-side calls keep their key hidden.
Does a map embed help local SEO?
It helps visitors. Your Google Business Profile and consistent details matter far more for rankings.
Need maps or a fare calculator?
Joboo Web builds secure, cost-controlled maps and fare tools. See web development or contact us.