10 min read Store Locator

Store Locator HTML Code: Embed and Setup Guide

See what store locator HTML code contains, how the generated embed works, where to paste it, and what to test before launch.

Store locator HTML code is usually an embed snippet, not a complete map written from scratch. In the implementation checked for this guide, the snippet creates a full-width container, loads the locator in an iframe, allows geolocation, and adjusts the frame height when the widget reports a new height.

You normally copy the generated snippet from a locator dashboard and paste it into your site's HTML or embed element. Shopify, WordPress, and Wix can use platform-specific installation methods instead.

What the Snippet Actually Contains

A hosted embed needs three visible pieces: a container in the page, an iframe that loads the locator, and a small script that connects the two. The checked implementation also adds responsive width rules and a message listener for height changes.

The map and location data run inside the hosted widget. The embed URL identifies the account and can carry optional filters for tags, cities, groups, visible categories, and tag controls.

What the Generated Embed Does

The current generated snippet has five jobs. These are implementation facts from the application code, not a generic promise about every locator.

Copy the generated version from the dashboard because it includes the correct account identifier and selected filters. A hand-written placeholder will not know which location set to load.

Geolocation Needs a Fallback, Not Just a Prompt

Browser geolocation requires shopper permission. The checked embed grants the iframe permission to request geolocation, but your launch test must also cover a denied request and manual address search.

Do not assume a near-me button is enough. Test the locator on a real phone with location permission allowed and denied, then confirm that address search still gives the shopper a usable route.

Where You Actually Paste the Code, by Platform

On Shopify, merchants rarely paste HTML. Theme architecture renders third-party content through app blocks, which let an app add content to a theme without editing theme code, so a locator installs as a block instead of a copied snippet.

WordPress works through its Block Editor instead: a shortcode dropped into any block renders the locator on that page, no HTML required. Our WordPress guide walks through one plugin's full setup.

Squarespace's Code Block is the documented place for custom HTML, though JavaScript and iframes inside it need the Core plan or higher. Wix instead offers an Embed HTML element for pasting a snippet, or a locator app from its App Market; our Wix guide covers that flow.

Webflow, BigCommerce, Magento, Framer, Ecwid, Elementor, and Hostinger can use the SaaS embed route when the site provides an HTML or embed element. Check the platform's own current instructions before publishing the snippet.

A Pre-Build Checklist, Hand-Coded or Widget

Deciding between a custom build and a ready widget comes down to four checks:

  1. Confirm where your platform lets you add custom code: a block, an element, or an app install.
  2. Check the map provider's key needs separately; Google Maps and Mapbox both require a merchant-held credential, and Google Maps also requires a billing account.
  3. Decide how location data stays current: manual edits, a synced spreadsheet, or a live feed from your commerce platform.
  4. Test geolocation on a real phone with permission denied, not just allowed, since that is where near-me search usually fails.

What Product-Level Search Actually Requires

A store locator finds a place. A product locator answers a narrower question, which of your locations currently has a specific item, and that needs inventory data tied to each location, not just a map.

RequirementWhat it doesShopify source
Location recordsStore or pickup pointLocation object
Inventory per locationStock per productinventoryLevels
Product filterShow item in stockstoreAvailability

The location and inventory rows come from Shopify's own Location API, and exist regardless of which app you install. Per-location availability for a variant is also exposed natively through the Storefront API's storeAvailability field, built for in-store pickup, though turning it into a map filter is still the app's job.

Ask a vendor two questions before committing:

  1. Does product availability update automatically from inventory, or does someone maintain it by hand?
  2. What does the page show when every nearby location is out of stock?

Final Thoughts

A store locator is ready when the embed loads at full width, the frame does not leave a large blank area, address search works, and a denied geolocation request does not trap the shopper.

For a hosted widget, location freshness and filter behavior matter more than rewriting the embed. Use the generated snippet, keep one source of truth for locations, and repeat the mobile test after changing page layout or filters.

FAQ

Does store locator HTML code need a Google Maps API key?

Only if you pick Google Maps, which needs the merchant's own API key and a billing account. Mapbox needs its own access token instead, while maps built on OpenStreetMap-style data skip a key entirely.

What is the difference between a store locator and a product locator?

A store locator shows where your locations are. A product locator shows which of those locations has a specific item in stock right now, which needs inventory data behind the map.

Can I add a store locator without writing any code?

Yes: apps, plugins, and SaaS widgets generate the embed for you. Progus Store Locator is one option: a theme block on Shopify, a shortcode on WordPress, an App Market install on Wix, managed from the Shopify app or the web dashboard; anywhere else it's a single embed snippet.

Does geolocation always ask the shopper for permission?

No. An IP-based estimate can place a shopper at the city level without any prompt. That makes it a reasonable fallback for shoppers who decline the browser prompt.

Add a store locator to your website. About Store Locator ›