Google Tag Manager

How to Install Google Tag Manager on Squarespace

Install Google Tag Manager on Squarespace using Code Injection: which plans include it, where each snippet goes, and how to verify your container fires.

7 min read
Quick answer

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.

Before you start

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

1

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):

Snippet 1: goes in the Header box
<!-- 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 -->
Snippet 2: goes in the Footer box
<!-- 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) -->
2

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 Injection

You 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.

3

Paste both snippets and save

  1. Paste snippet 1 into the Header box.
  2. Paste snippet 2 into the Footer box.
  3. 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.

4

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.

Avoid double-installing GA4

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:

  1. Add GA4 through GTM (if it isn’t already on the site another way): how to add GA4 with Tag Manager.
  2. Track your first interaction, like clicks on your contact button: button click tracking with GTM.
  3. Learn how triggers decide when tags fire, which is the concept everything else builds on: GTM triggers explained.
  4. Name things cleanly from the start: GTM naming conventions.

Frequently asked questions

Which Squarespace plans support Google Tag Manager?
GTM needs Code Injection, which is included on the current Core, Plus, and Advanced plans and the legacy Business and Commerce plans. The current entry-level Basic plan and the legacy Personal plan don't have Code Injection, so they can't run GTM. If you only need Google Analytics, every plan can use the built-in integration instead, no GTM required.
Where do I paste the GTM code in Squarespace?
Click Website, scroll to the bottom of the Pages panel, 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. Paste GTM's first snippet into the Header box and the second snippet into the Footer box, then save. Squarespace applies both to every page of your site.
Is it a problem that the second GTM snippet goes in the footer instead of after the body tag?
No. Google recommends placing the second snippet right after the opening body tag, but Squarespace doesn't offer that placement, and the footer is the closest available spot. The second snippet is only a noscript fallback for the rare visitor with JavaScript disabled; your actual tracking runs from the first snippet in the header, which is placed correctly.
Do I need Google Tag Manager on Squarespace if I already have GA4?
Only if you want tracking beyond what GA4 collects on its own. If your GA4 is connected through Squarespace's built-in integration and you just want traffic reporting, you don't need GTM. GTM earns its place when you want click tracking, scroll tracking, or other platforms' tags (Meta Pixel, LinkedIn Insight Tag) managed in one container.
Can I run GA4 through GTM on Squarespace instead of the built-in integration?
Yes. Install GTM via Code Injection, add a GA4 tag inside the container, and leave the Google Analytics field in External API keys empty. Pick one route only: if GA4 loads from both the built-in integration and your GTM container, every visit and page view counts twice.
How do I know GTM is working on my Squarespace site?
Use Preview mode: in your GTM workspace, click Preview, enter your site's URL, and click Connect. Your site opens with a Tag Assistant badge, and page-load events appear in the Summary view as you browse. For a quick check without GTM access, view your page source and search for googletagmanager.com/gtm.js followed by your container ID.

Keep learning