Vernon Web Design

Articles · Small business websites

How to add a Google Map to your small business website

Published · Updated

A customer who wants to visit your shop or office needs to know where it is. A map on your site answers that in one glance. It also saves them from copying your address into another app.

Google Maps gives out a free embed code. You paste it into a page, and a live map appears. This guide shows each step and the problems that come up after.

Where the map belongs

Put the map on your contact page. That is where a visitor looks for your address and hours. What to put on your small business contact page covers the rest of that page.

Skip the map if customers never visit you. A plumber who works at job sites does not need a map of an office. A list of the towns you serve is more useful for that business.

Get the embed code from Google Maps

Use a computer for this. The embed option does not show up in the phone app.

  1. Open Google Maps in your browser.
  2. Type your business name or street address in the search box. Pick your business from the results.
  3. Click Share.
  4. Click the Embed a map tab.
  5. Choose a size from the drop-down menu. Medium is fine, since you will change the width later.
  6. Click Copy HTML.

You now have a block of code that starts with <iframe. It holds the map, your pin, and a link back to Google Maps.

If your business has no pin in the search results, set up your listing first. How to set up a Google Business Profile for a Vernon business walks through it. A business that hides its street address in its profile may not get a pin at all. In that case, skip the map and write out the area you serve.

Paste the code into your site

Where you paste the code depends on how your site is built.

WordPress. Open the contact page in the editor. Add a Custom HTML block. Paste the code into it. Preview the page, then update it.

Website builders. Look for a block called Embed, Code, HTML, or Custom Code. Add it to the page, paste the code, and save. Some builders also have a built-in map block. That block usually asks for your address and does the same job. Use it if it is simpler.

A custom site. Paste the code into the HTML file for your contact page, at the spot where the map should appear. Save the file and upload it.

Publish the change if your builder holds edits as a draft.

Make the map fit on a phone

The code Google gives you has a fixed width in pixels. On a narrow phone screen, a fixed width can push the map past the edge of the page. The visitor then has to slide the page sideways.

Find this part of the code:

width="600" height="450"

Change it to this:

width="100%" height="400"

The map now fills the width of whatever space it sits in. A height of 400 pixels works on both phones and computers.

Two more small edits help. Add loading="lazy" inside the iframe tag. This tells the browser to load the map only when the visitor scrolls near it, so the top of the page loads faster. Add title="Map showing our location" as well. Screen readers read that title aloud, so a visitor who cannot see the map knows what the box is.

The finished code looks like this, with your own long address in the src part:

<iframe src="(your code from Google)" width="100%" height="400" style="border:0;" loading="lazy" title="Map showing our location"></iframe>

Leave the src value exactly as Google gave it. Change only the parts named above.

Add your address as text

A map is a picture of a place. Search engines and screen readers cannot read it the way they read words. Write your full street address as plain text above or below the map. Add your phone number and hours too.

Add a Get directions link as well. In Google Maps, search for your business, click Share, and choose Copy link. Make that link the address of a button or text link. On a phone, it opens the Maps app, which is how most people navigate once they are on the road.

Check the map after you publish

Open the live page, not the preview. Look for three things.

The pin should sit on your building. If it sits a block away, search for your address again in Google Maps and pick the exact result before you copy the code.

The map should fit inside the page on a phone. How to check if your website works on a phone shows how to test this.

The page should still load quickly. A single map adds little weight, but a page with several embeds can slow down. How to make your small business website load faster lists the larger causes.

Fix common problems

The map shows a gray box or an error. Some security plugins and builder settings block content from other sites. Check the settings of your plugin or builder for a rule about iframes or embeds. Allow Google Maps.

The map does not show in a pasted block. Some editors strip out code. Make sure you used an HTML or code block and not a plain text block.

The pin shows the wrong business. Another listing may share your address. Search with your business name and city, then pick the right result before you copy the code.

You moved. The embed code does not update by itself. Copy new code from Google Maps and replace the old block. Update the address text and directions link too.

If the map still will not appear, send the page address and a screenshot through the contact page. We can look at it.

Ready when you are

Book a coffee