How to Embed a Google Map on Your Website

Add a working map to your contact page with Google's Embed option or the Maps Embed API. Compare the iframe with a static image, then check mobile, privacy and a fallback link.

The BuildVerse team8 min read

A laptop showing a contact page with a Google Maps pin embedded below the address, with a plain text link under the map.

For a small business contact page, open your location in Google Maps, choose Share, select Embed a map, and copy the HTML into your page. This copy-and-paste route does not require you to create an API key.

This guide is for a small business owner or website builder who wants the right pin, a map that fits a phone, and a useful page when the map fails. You will get a reusable HTML template, an optional API method, and checks for loading, accessibility and privacy.

BuildVerse has not tested these steps. The code is an example, and the placeholders are yours to fill in. Check the result on your own site before you publish.

Before you start

  • A desktop browser and the correct business name or full street address.
  • Access to a page editor that accepts iframe HTML, or access to your site’s HTML files. Check your builder’s embed support before starting.
  • For the API route only: a Google Cloud account and a project with billing enabled. Embed API requests are available at no charge, but Google’s setup procedure still requires billing.
  • Documentation checked: 5 December 2026. These examples use HTML and the Maps Embed API v1 URL; no JavaScript library installation is needed.

Which method should you pick

Pick the Embed option for a quick contact page. Google supplies the iframe for your chosen place. Keep its generated URL intact; you do not need to obtain a key or set up Cloud billing for this method.

Pick the Maps Embed API when you want to build the location URL yourself from an address or place ID. You create and restrict your own API key. Google lists Embed API usage at no charge, with no queries-per-second or queries-per-day limits.

Use either method below, then run the same checks. A plain address and link are also a useful choice if you do not want a third-party map loading on the page.

Method 1: Copy the Embed option from Google Maps

  1. On your computer, open Google Maps and search for your business or full address.
  2. Select the correct result and check its pin.
  3. Click Share in the place panel. Alternatively, open Menu at the top left and choose Share or embed map.
  4. Select Embed a map.
  5. Click Copy HTML.
  6. Paste the copied iframe into your page’s HTML or embed-code block.
  7. Add the address and fallback link using the template below, then save and preview the page.

For WordPress.com, add a Custom HTML block and paste the full code. In a builder field that asks only for a URL, use the value inside the iframe’s src quotation marks. The Send a link URL belongs in a clickable link, not the iframe source.

<div style="max-width:600px;margin:0 auto;">
  <p>YOUR_BUSINESS_NAME: YOUR_FULL_STREET_ADDRESS</p>
  <iframe
    src="YOUR_COPIED_EMBED_SRC"
    width="600"
    height="450"
    style="display:block;width:100%;height:450px;border:0;"
    loading="lazy"
    referrerpolicy="strict-origin-when-cross-origin"
    title="Map showing YOUR_BUSINESS_NAME"
    allowfullscreen>
  </iframe>
  <p><a href="YOUR_MAPS_SHARE_LINK">Open our location in Google Maps</a></p>
</div>
Method 1 template. Replace every uppercase placeholder before publishing.

Copy only the complete src value from Google’s iframe into YOUR_COPIED_EMBED_SRC. Get YOUR_MAPS_SHARE_LINK from Share, Send a link, Copy link. Replace the business name and street address too. Keep the title descriptive, and keep the address and link outside the iframe so they remain visible when it fails. The suggested 600-pixel maximum width and 450-pixel height are layout choices.

Method 2: Use the Maps Embed API with a key

  1. Select your billing-enabled project in the Google Cloud console.
  2. Open the Maps Embed API product page in the API Library and click Enable. If it says Manage, it is already enabled.
  3. Go to Google Maps Platform, Keys & Credentials, then Create credentials, API key.
  4. In Select API restrictions, keep only Maps Embed API selected and click Create.
  5. Open the key’s settings and select Websites as the application restriction.
  6. Add your website origins, such as https://YOUR_DOMAIN and https://www.YOUR_DOMAIN if both serve your site, and save. Replace YOUR_DOMAIN with your actual domain.
  7. Paste the API example below into your page and replace YOUR_API_KEY.
  8. Change the example location, visible address and link to your own business, then preview the page on an allowed website.

Use a separate key for this embed. API restrictions and enabling an API are different settings; you need both. Keep referrerpolicy="strict-origin-when-cross-origin" so the request sends your site’s origin for website restrictions. Avoid restrictions to a specific page path because the browser sends only the origin to Google.

<div style="max-width:600px;margin:0 auto;">
  <p>Example location: India Gate, New Delhi, India</p>
  <iframe
    src="https://www.google.com/maps/embed/v1/place?key=YOUR_API_KEY&amp;q=India+Gate%2C+New+Delhi%2C+India"
    width="600"
    height="450"
    style="display:block;width:100%;height:450px;border:0;"
    loading="lazy"
    referrerpolicy="strict-origin-when-cross-origin"
    title="Map showing India Gate, New Delhi"
    allowfullscreen>
  </iframe>
  <p><a href="https://www.google.com/maps/search/?api=1&amp;query=India+Gate%2C+New+Delhi%2C+India">Open this location in Google Maps</a></p>
</div>
Method 2 example: replace YOUR_API_KEY with your restricted key. India Gate is an illustrative location; replace it throughout before using this for your business.

For your own location, URL-encode the address in q and in the fallback link’s query parameter. Spaces can use + or %20; encode a literal plus as %2B and an ampersand as %26. Keep &amp; between parameters in HTML attributes. The fallback Maps URL needs api=1 and does not need an API key. Google’s generated share link is another option.

Iframe or static image?

A static image from the Maps Static API gives you one fixed view without interactive pan or zoom. It uses a separate pay-as-you-go service with billing and authentication requirements. Check the linked Static API billing page and its Global or India pricing list for your account before choosing it; Embed API’s no-charge pricing does not apply to Static Maps.

An iframe is interactive. With loading="lazy", the browser can delay fetching an off-screen iframe until it approaches the viewport. The distance is browser-controlled. This can reduce initial page work when your map sits lower down, but it does not guarantee a particular speed improvement. A map near the top may load immediately.

Use a static image when you need a fixed preview; give it alternative text and a location link. Use an iframe when readers need to explore. Neither a Google-hosted image nor lazy loading prevents requests to Google. If you need to wait for consent, leave the third-party resource unloaded until your consent mechanism permits it, or provide only an address and link.

Check that it worked

  • Open the saved page on its real website address, including while signed out of the site editor. Check the pin and fallback link both lead to the intended place.
  • Check on a phone and at a narrow preview width such as 375 pixels. Confirm there is no sideways page scrolling and the surrounding address stays readable.
  • Keep the map at least 200 pixels wide and high, Google’s supported minimum. Move it out of a narrow sidebar if necessary.
  • Use the keyboard to reach the map and fallback link, then move beyond them. Confirm the iframe has a descriptive title and the street address is available as normal text.
  • In Chrome DevTools, use the Network panel to find the map document request. Right-click it and choose Block request, then reload while DevTools stays open. Check that the address and link remain visible; unblock the request afterward.
  • Check initial loading and scrolling with the Network panel open. A nearby lazy iframe may load before it enters the screen. If you gate Maps behind consent, verify there is no map request before consent and that it loads afterward.

Common mistakes and fixes

  • The code appears as text, or disappears after saving. Use your builder’s supported HTML/embed block. On WordPress.com, use Custom HTML. If your editor rejects iframes, use its supported map integration or keep a plain location link.
  • The map source is a short share URL. Copy HTML again and use its iframe src value. Keep the short share URL for the fallback link.
  • The API map reports an error or looks darkened. Read the error and browser console. Check the real key replaced YOUR_API_KEY, the API is enabled in that key’s project, and billing is active. Newly enabled APIs can take a few minutes to become usable.
  • The key works on one domain but fails on another. Allow the actual website origin, including www or your preview hostname if needed. Keep the referrerpolicy attribute. Preview over HTTP or HTTPS; local file previews may omit the referrer.
  • The console reports a Content Security Policy violation. Ask whoever manages the policy to allow the iframe source in frame-src. For these examples the source is https://www.google.com. Merge it into the existing policy; preserve the other restrictions.
  • The wrong place appears. Use a full address or a place ID instead of an ambiguous business name, then check the pin again.
  • The map is cut off or overflows. Keep its CSS width at 100% within a bounded container. If inline styles are blocked by your site, put the same sizing rules in an allowed stylesheet.
  • You tried to share saved locations or distance measurements. Google Maps’ normal sharing flow excludes those views. For a custom collection of places, consider a public Google My Maps map.

Limits

  • The place-mode example marks one location. Other Embed API modes include directions, search, view and streetview, so embeds are not universally limited to one place. For a curated branch map, consider public Google My Maps; for programmatic control, consider the Maps JavaScript API.
  • Google’s Privacy Policy explicitly covers embedded Google Maps and describes collecting information including IP addresses when its services contact its servers. Review your privacy notice and applicable consent requirements. Lazy loading controls timing, not consent.
  • The address and fallback link keep the page useful when the iframe fails, but opening Google Maps still requires connectivity. Do not rely on the map as the only way visitors can find your address.
Is the Google Maps Embed API free?

Google currently lists Embed API usage at no charge with no queries-per-second or queries-per-day limits. Its setup still requires a billing-enabled project and an API key. Static Maps and the Maps JavaScript API are separate services.

Do I need an API key to embed a Google Map?

You do not need to create a key for the iframe copied from Google Maps’ Embed a map tab. You do need your own key for the Maps Embed API v1 URL shown in Method 2.

Does lazy loading make a map faster?

It can reduce initial loading work for off-screen maps. It does not make the map itself faster, and the browser may fetch it before you scroll to it.

Which map mode should I use for a business location?

Use place mode for one business or address. Its required q parameter identifies the location; use a place ID if the name is ambiguous.

Does a map embed send visitor data to Google?

Loading an embedded map contacts Google. Google’s Privacy Policy covers embedded Maps and describes data collection including IP addresses. If your setup requires consent first, block loading until consent; loading="lazy" is not a consent mechanism.

  1. Google Maps Help: Share, send, or print directions (checked 5 Dec 2026)
  2. WordPress.com: Embed from Google Maps (checked 5 Dec 2026)
  3. Juniper Education: Get a Google map embed link (checked 5 Dec 2026)
  4. Google: Maps Embed API overview (checked 5 Dec 2026)
  5. Google: Embed a map (checked 5 Dec 2026)
  6. Google: Set up the Maps Embed API (checked 5 Dec 2026)
  7. Google: Maps Embed API usage and billing (checked 5 Dec 2026)
  8. Google: Maps Platform security guidance (checked 5 Dec 2026)
  9. Google: Maps URLs (checked 5 Dec 2026)
  10. Google: Maps Static API overview (checked 5 Dec 2026)
  11. Google: Maps Static API usage and billing (checked 5 Dec 2026)
  12. Google: Maps Embed API error messages (checked 5 Dec 2026)
  13. Google: Privacy Policy (checked 5 Dec 2026)
  14. Google My Maps Help: Share, download, or print your map (checked 5 Dec 2026)
  15. Google: Add a map with the Maps JavaScript API (checked 5 Dec 2026)
  16. MDN: iframe element (checked 5 Dec 2026)
  17. MDN: CSS width (checked 5 Dec 2026)
  18. MDN: CSS max-width (checked 5 Dec 2026)
  19. MDN: CSP frame-src (checked 5 Dec 2026)
  20. Chrome DevTools: Request conditions (checked 5 Dec 2026)

All guides