Squarespace doesn't have a built-in GTM integration, so you install it through Code Injection: click Website, scroll to the bottom of the Pages panel, open Code Injection under Website Tools (labeled Custom Code on some sites), paste GTM's first snippet into the Header box and the second snippet into the Footer box, and save. Code Injection is a premium feature on the current Core, Plus, and Advanced plans (and legacy Business and Commerce plans); the Basic and legacy Personal plans don't include it. The install takes about 5 minutes.
Squarespace has no native Google Tag Manager integration, but the install is still one of the simpler ones: two snippets pasted into one panel, and Squarespace applies them to every page for you. The only real gate is your plan.
This is the Squarespace-specific version of our general GTM installation guide. New to GTM? The Tag Manager beginner’s guide explains tags, triggers, and variables before you install anything.
Check your plan first
GTM on Squarespace requires Code Injection, a premium feature:
- Included: the current Core, Plus, and Advanced plans, plus the legacy Business and Commerce plans.
- Not included: the current entry-level Basic plan and the legacy Personal plan.
On Basic or Personal, GTM isn’t available; if your goal was just Google Analytics, use the built-in GA4 integration instead, which works on every plan.
You’ll need a GTM container ID, the GTM-XXXXXXX code from the top bar of your workspace at tagmanager.google.com. Don’t have a container yet? The GTM setup guide covers creating one in about 2 minutes.
Install GTM via Code Injection
Copy the two GTM snippets
At tagmanager.google.com, click your container ID in the top bar (or go to Admin > Install Google Tag Manager). GTM shows two snippets with copy buttons.
They look like this, with GTM-XXXXXXX standing in for your real ID (copy yours from GTM so it carries the right ID):
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXXX');</script>
<!-- End Google Tag Manager --><!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->Open Code Injection in Squarespace
In your Squarespace dashboard, click Website to open the Pages panel, scroll to the bottom, and open Code Injection under Website Tools (labeled Custom Code on some sites). On older dashboards the same panel lives under Settings > Advanced > Code Injection.
Website Website Tools Code InjectionYou should see: a panel with Header and Footer text boxes. Commerce sites also show Lock Page, Order Confirmation Page, and Order Status Page boxes; ignore those for GTM.
Paste both snippets and save
- Paste snippet 1 into the Header box.
- Paste snippet 2 into the Footer box.
- Click Save.
Squarespace now loads GTM on every page of your site.
Why the footer? Google’s official placement for snippet 2 is right after the opening <body> tag, but Squarespace doesn’t offer that injection point, and the footer is the closest available spot. That’s fine in practice: snippet 2 is only a fallback for browsers with JavaScript turned off. The snippet that does the real work is the one in your header, and that one is placed exactly where Google wants it.
Verify with Preview mode
In your GTM workspace, click Preview in the top right. Tag Assistant opens; enter your site’s URL and click Connect. Your site opens in a new window with a Tag Assistant badge in the corner.
You should see: “Connected” in Tag Assistant, and page-load events (Consent Initialization, Initialization, Container Loaded) appearing in the Summary as you click around your site. A brand-new container shows nothing under “Tags Fired” yet, which is correct: GTM is installed and waiting for its first tag.
If Tag Assistant won’t connect, check for an ad blocker in your testing browser, confirm you saved the Code Injection panel, and make sure you’re testing the live site rather than a preview inside the Squarespace editor.
If Google Analytics is already connected through Squarespace’s built-in integration (External API keys) and you later add a GA4 tag inside GTM, GA4 will load twice and every visit counts double. Pick one route for GA4 and stick to it. The GA4 on Squarespace guide covers the built-in route; if you move GA4 into GTM, clear the External API keys field.
What to set up next
An installed container is infrastructure; the value comes from the tags you put in it:
- Add GA4 through GTM (if it isn’t already on the site another way): how to add GA4 with Tag Manager.
- Track your first interaction, like clicks on your contact button: button click tracking with GTM.
- Learn how triggers decide when tags fire, which is the concept everything else builds on: GTM triggers explained.
- Name things cleanly from the start: GTM naming conventions.