{"id":165,"date":"2025-12-15T11:10:54","date_gmt":"2025-12-15T08:10:54","guid":{"rendered":"https:\/\/mapsfun.com\/?p=165"},"modified":"2025-12-15T11:10:55","modified_gmt":"2025-12-15T08:10:55","slug":"how-to-embed-google-maps-in-squarespace","status":"publish","type":"post","link":"https:\/\/mapsfun.com\/?p=165","title":{"rendered":"How to Embed Google Maps in Squarespace"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">How to Embed a Custom Google Map in Your Squarespace Website<\/h2>\n\n\n\n<p>Want to showcase your business locations, event venues, or service areas with a custom Google Map on your Squarespace site? While Squarespace has a built-in map block, it&#8217;s limited to a single location and basic styling. Creating a true multi-location, custom Google Map requires a technical workaround. This guide will walk you through the manual process.<\/p>\n\n\n\n<p><strong>This method offers full customization but requires a Google Cloud account, API key management, and editing your site&#8217;s code injection settings. It&#8217;s a developer-friendly approach.<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>Method 1: The Manual Google Maps API &amp; Code Injection Method<\/strong><\/p>\n\n\n\n<p>This approach gives you complete design control but involves several technical steps.<\/p>\n\n\n\n<p class=\"has-text-align-center\">Step 1: Set Up Your Google Maps API Key<\/p>\n\n\n\n<p>This is the most critical prerequisite<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>1.&nbsp; Go to the Google Cloud Console:<\/strong> Navigate to <a href=\"https:\/\/console.cloud.google.com\/](https:\/\/console.cloud.google.com\/\">https:\/\/console.cloud.google.com\/<\/a>.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"534\" src=\"https:\/\/mapsfun.com\/wp-content\/uploads\/2025\/12\/image-28-1024x534.png\" alt=\"\" class=\"wp-image-166\" style=\"width:715px;height:auto\" srcset=\"https:\/\/mapsfun.com\/wp-content\/uploads\/2025\/12\/image-28-1024x534.png 1024w, https:\/\/mapsfun.com\/wp-content\/uploads\/2025\/12\/image-28-300x157.png 300w, https:\/\/mapsfun.com\/wp-content\/uploads\/2025\/12\/image-28-768x401.png 768w, https:\/\/mapsfun.com\/wp-content\/uploads\/2025\/12\/image-28-1536x802.png 1536w, https:\/\/mapsfun.com\/wp-content\/uploads\/2025\/12\/image-28.png 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>2.&nbsp; Create a Project: <\/strong>Click the project dropdown and create a new project (e.g., &#8220;<strong>My Squarespace Map<\/strong>&#8220;).<\/li>\n\n\n\n<li><strong>3.&nbsp; Enable Billing:<\/strong> You must enable billing. Google provides a $200 monthly credit, which typically covers all usage for a standard website map.<\/li>\n\n\n\n<li><strong>4.&nbsp; Enable the Required APIs:<\/strong> Go to &#8220;APIs &amp; Services&#8221; &gt; &#8220;Library&#8221;. Search for and enable these two:\n<ul class=\"wp-block-list\">\n<li>&nbsp;&nbsp;&nbsp;&nbsp;Maps JavaScript API (renders the map)<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;Geocoding API (converts addresses to coordinates)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>5.&nbsp; Create and Restrict Your API Key:<\/strong> Go to &#8220;APIs &amp; Services&#8221; &gt; &#8220;Credentials&#8221;. Click &#8220;Create Credentials&#8221; &gt; &#8220;API Key&#8221;. <strong>Crucially, restrict this key<\/strong> to the &#8220;Maps JavaScript API&#8221; and add your Squarespace domain under &#8220;HTTP referrers&#8221; (e.g., `<strong>https:\/\/your-site.squarespace.com<\/strong>`, `<strong>https:\/\/www.yourdomain.com<\/strong>`).<\/li>\n<\/ul>\n\n\n\n<p><strong>&nbsp;Enabling the Maps JavaScript API is a mandatory first step.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"499\" height=\"268\" src=\"https:\/\/mapsfun.com\/wp-content\/uploads\/2025\/12\/image-29.png\" alt=\"\" class=\"wp-image-167\" style=\"width:482px;height:auto\" srcset=\"https:\/\/mapsfun.com\/wp-content\/uploads\/2025\/12\/image-29.png 499w, https:\/\/mapsfun.com\/wp-content\/uploads\/2025\/12\/image-29-300x161.png 300w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">Step 2: Add a Map Container to Your Squarespace Page<\/p>\n\n\n\n<p>You&#8217;ll need a simple element on your page to hold the map.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>1.&nbsp; In the Squarespace editor, go to the page where you want the map.<\/li>\n\n\n\n<li>2.&nbsp; Click <strong>Add Block<\/strong> and search for <strong>&#8220;Code&#8221;<\/strong>.<\/li>\n\n\n\n<li>3.&nbsp; Drag the &#8220;Code&#8221; block onto your page.<\/li>\n\n\n\n<li>4.&nbsp; In the code block, paste the following HTML to create the map container:<\/li>\n<\/ul>\n\n\n\n<p><strong>html<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"hljs-comment\">&lt;!-- Custom Google Map Container --&gt;<\/span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"custom-map-container\"<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h3<\/span>&gt;<\/span>Visit Our Locations<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h3<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"squarespace-custom-map\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"has-text-align-center\">Step 3: Inject the JavaScript and CSS via Site Header<\/p>\n\n\n\n<p>This is where you bring the map to life using Squarespace&#8217;s Code Injection feature.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>1.&nbsp; From your Squarespace Home Menu, go to <strong>Settings &gt; Developer Tools &gt; Code Injection<\/strong>.<\/li>\n\n\n\n<li>2.&nbsp; In the <strong>Header<\/strong> field, paste the following code. R<strong>eplace `YOUR_API_KEY` with your restricted API key from Step 1.<\/strong><\/li>\n<\/ul>\n\n\n\n<p><strong>html<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">style<\/span>&gt;<\/span><span class=\"css\">\n    <span class=\"hljs-comment\">\/* CSS for the map container *\/<\/span>\n    <span class=\"hljs-selector-id\">#squarespace-custom-map<\/span> {\n        <span class=\"hljs-attribute\">height<\/span>: <span class=\"hljs-number\">500px<\/span>;\n        <span class=\"hljs-attribute\">width<\/span>: <span class=\"hljs-number\">100%<\/span>;\n        <span class=\"hljs-attribute\">border-radius<\/span>: <span class=\"hljs-number\">8px<\/span>;\n        <span class=\"hljs-attribute\">margin<\/span>: <span class=\"hljs-number\">20px<\/span> <span class=\"hljs-number\">0<\/span>;\n        <span class=\"hljs-attribute\">border<\/span>: <span class=\"hljs-number\">1px<\/span> solid <span class=\"hljs-number\">#e5e5e5<\/span>;\n    }\n<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">style<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script<\/span>&gt;<\/span><span class=\"javascript\">\n<span class=\"hljs-comment\">\/\/ Wait for the page to load<\/span>\n<span class=\"hljs-built_in\">window<\/span>.addEventListener(<span class=\"hljs-string\">'DOMContentLoaded'<\/span>, (event) =&gt; {\n    <span class=\"hljs-comment\">\/\/ Only run if our map container exists on the page<\/span>\n    <span class=\"hljs-keyword\">if<\/span> (<span class=\"hljs-built_in\">document<\/span>.getElementById(<span class=\"hljs-string\">'squarespace-custom-map'<\/span>)) {\n        <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">initMap<\/span>(<span class=\"hljs-params\"><\/span>) <\/span>{\n            <span class=\"hljs-comment\">\/\/ Define your locations: &#91;Title, Lat, Lng, Description]<\/span>\n            <span class=\"hljs-keyword\">const<\/span> locations = &#91;\n                &#91;<span class=\"hljs-string\">'Main Office'<\/span>, <span class=\"hljs-number\">40.7128<\/span>, <span class=\"hljs-number\">-74.0060<\/span>, <span class=\"hljs-string\">'Our flagship location in downtown NYC'<\/span>],\n                &#91;<span class=\"hljs-string\">'Support Center'<\/span>, <span class=\"hljs-number\">40.7074<\/span>, <span class=\"hljs-number\">-74.0113<\/span>, <span class=\"hljs-string\">'Customer service and returns'<\/span>],\n                &#91;<span class=\"hljs-string\">'Warehouse'<\/span>, <span class=\"hljs-number\">40.7211<\/span>, <span class=\"hljs-number\">-74.0005<\/span>, <span class=\"hljs-string\">'Distribution and logistics hub'<\/span>]\n            ];\n\n            <span class=\"hljs-comment\">\/\/ Create the map<\/span>\n            <span class=\"hljs-keyword\">const<\/span> map = <span class=\"hljs-keyword\">new<\/span> google.maps.Map(<span class=\"hljs-built_in\">document<\/span>.getElementById(<span class=\"hljs-string\">'squarespace-custom-map'<\/span>), {\n                <span class=\"hljs-attr\">zoom<\/span>: <span class=\"hljs-number\">12<\/span>,\n                <span class=\"hljs-attr\">center<\/span>: { <span class=\"hljs-attr\">lat<\/span>: <span class=\"hljs-number\">40.7128<\/span>, <span class=\"hljs-attr\">lng<\/span>: <span class=\"hljs-number\">-74.0060<\/span> },\n                <span class=\"hljs-attr\">styles<\/span>: &#91;\n                    {\n                        <span class=\"hljs-string\">\"featureType\"<\/span>: <span class=\"hljs-string\">\"all\"<\/span>,\n                        <span class=\"hljs-string\">\"stylers\"<\/span>: &#91;{<span class=\"hljs-string\">\"saturation\"<\/span>: <span class=\"hljs-number\">-50<\/span>}]\n                    }\n                ] <span class=\"hljs-comment\">\/\/ Optional custom styling<\/span>\n            });\n\n            <span class=\"hljs-comment\">\/\/ Create an info window<\/span>\n            <span class=\"hljs-keyword\">const<\/span> infowindow = <span class=\"hljs-keyword\">new<\/span> google.maps.InfoWindow();\n\n            <span class=\"hljs-comment\">\/\/ Add markers to the map<\/span>\n            locations.forEach(<span class=\"hljs-function\">(<span class=\"hljs-params\">&#91;title, lat, lng, description]<\/span>) =&gt;<\/span> {\n                <span class=\"hljs-keyword\">const<\/span> marker = <span class=\"hljs-keyword\">new<\/span> google.maps.Marker({\n                    <span class=\"hljs-attr\">position<\/span>: { lat, lng },\n                    <span class=\"hljs-attr\">map<\/span>: map,\n                    <span class=\"hljs-attr\">title<\/span>: title,\n                    <span class=\"hljs-comment\">\/\/ icon: '\/your-custom-marker.png' \/\/ Optional custom icon<\/span>\n                });\n\n                <span class=\"hljs-comment\">\/\/ Add click listener for info window<\/span>\n                marker.addListener(<span class=\"hljs-string\">'click'<\/span>, () =&gt; {\n                    infowindow.setContent(<span class=\"hljs-string\">`\n                        &lt;div style=\"padding: 12px; max-width: 200px;\"&gt;\n                            &lt;h4 style=\"margin: 0 0 8px 0;\"&gt;<span class=\"hljs-subst\">${title}<\/span>&lt;\/h4&gt;\n                            &lt;p style=\"margin: 0; color: #666;\"&gt;<span class=\"hljs-subst\">${description}<\/span>&lt;\/p&gt;\n                        &lt;\/div&gt;\n                    `<\/span>);\n                    infowindow.open(map, marker);\n                });\n            });\n        }\n\n        <span class=\"hljs-comment\">\/\/ Load the Google Maps API<\/span>\n        <span class=\"hljs-keyword\">const<\/span> script = <span class=\"hljs-built_in\">document<\/span>.createElement(<span class=\"hljs-string\">'script'<\/span>);\n        script.src = <span class=\"hljs-string\">`https:\/\/maps.googleapis.com\/maps\/api\/js?key=YOUR_API_KEY&amp;callback=initMap`<\/span>;\n        script.async = <span class=\"hljs-literal\">true<\/span>;\n        script.defer = <span class=\"hljs-literal\">true<\/span>;\n        <span class=\"hljs-built_in\">document<\/span>.head.appendChild(script);\n    }\n});\n<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">script<\/span>&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This code creates a fully responsive, multi-marker map with custom styling and detailed info windows that appear when clicked.<\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>The Significant Challenges of This Method<\/strong><\/p>\n\n\n\n<p>While powerful, this DIY approach presents major hurdles for most Squarespace users:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>API Key Security Risk:<\/strong> You are personally responsible for <strong>properly restricting your API key<\/strong>. A mistake here can lead to unauthorized use and substantial, unexpected charges on your Google Cloud bill.<\/li>\n\n\n\n<li><strong>Code Injection Complexity: <\/strong>Using Code Injection requires precision. A single syntax error in the JavaScript or CSS can break your site&#8217;s functionality or design.<\/li>\n\n\n\n<li><strong>Limited Design Flexibility: <\/strong>Making simple changes like adjusting the map height, adding a new location, or changing a marker icon requires going back into the Code Injection settings and modifying the code directly.<\/li>\n\n\n\n<li><strong>Maintenance Overhead:<\/strong> If you need to update locations or information, you must manually edit the coordinates and descriptions in the code, which is error-prone and time-consuming.<\/li>\n<\/ul>\n\n\n\n<p class=\"has-text-align-center\"><strong>The Simple, Professional Alternative: <a href=\"http:\/\/mapsfun.com\">MapsFun.com<\/a><\/strong><\/p>\n\n\n\n<p>Why navigate the complex landscape of API keys and code injection when you can achieve a superior result in minutes?<\/p>\n\n\n<p><iframe src=\"https:\/\/panel.mapsfun.com\/embed-map?code=668ecbcced7931f89205d1e881bb82aa&#038;lang=uk&#038;tpl=photo\" width=\"100%\" height=\"600\" style=\"border:0\" loading=\"lazy\" referrerpolicy=\"no-referrer-when-downgrade\"><\/iframe><\/p>\n\n\n\n<p><a href=\"http:\/\/mapsfun.com\">MapsFun.com<\/a> is designed specifically to solve this problem, offering a seamless, codeless experience for Squarespace users.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>1.&nbsp; Absolutely No Coding Required: <\/strong>Our intuitive visual editor lets you search for locations and add pins with a single click. No APIs, no Code Injection, no technical knowledge needed.<\/li>\n\n\n\n<li><strong>2.&nbsp; No API Keys or Billing: <\/strong>We handle all the backend infrastructure and security. There is zero risk of unexpected charges from Google.<\/li>\n\n\n\n<li><strong>3.&nbsp; Perfect Squarespace Integration: <\/strong>Once your custom map is designed, you get a clean embed code. Just paste it into a Squarespace Code Block, and your map will appear instantly.<\/li>\n\n\n\n<li><strong>4.&nbsp; Superior Customization: <\/strong>Easily apply custom map styles, upload your own marker icons, and design beautiful info windows with text and images\u2014all through a simple point-and-click interface.<\/li>\n<\/ul>\n\n\n\n<p>Stop risking your site&#8217;s stability with complex code injection. Create a stunning, high-performance Google Map for your Squarespace site in just a few clicks with <a href=\"http:\/\/mapsfun.com\">MapsFun.com<\/a>.<br><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"How to Embed a Custom Google Map in Your Squarespace Website Want to showcase your business locations, event venues, or service areas with a custom Google Map on your Squarespace site? While Squarespace has a built-in map block, it&#8217;s limited to a single location and basic styling. Creating a true multi-location, custom Google Map requires [&hellip;]","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,1],"tags":[],"class_list":["post-165","post","type-post","status-publish","format-standard","hentry","category-embed-google-map-in-squarespace","category-1"],"_links":{"self":[{"href":"https:\/\/mapsfun.com\/index.php?rest_route=\/wp\/v2\/posts\/165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mapsfun.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mapsfun.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mapsfun.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mapsfun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=165"}],"version-history":[{"count":3,"href":"https:\/\/mapsfun.com\/index.php?rest_route=\/wp\/v2\/posts\/165\/revisions"}],"predecessor-version":[{"id":199,"href":"https:\/\/mapsfun.com\/index.php?rest_route=\/wp\/v2\/posts\/165\/revisions\/199"}],"wp:attachment":[{"href":"https:\/\/mapsfun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mapsfun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mapsfun.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}