How to Install Google Tag Manager on Squarespace (2026 Step-by-Step Guide)
Squarespace's Code Injection panel lets you paste both GTM snippets (the <script> for <head> and the <noscript> for <body>) site-wide. The whole install is about 5 minutes - the only Squarespace-specific quirk is that the platform doesn't push ecommerce events into dataLayer automatically, so for Squarespace Commerce stores you'll need a custom snippet.
What you'll need before you start
- •A Squarespace site on a Business or Commerce plan (Personal plan does not include Code Injection)
- •Owner or contributor with Site Manager access
- •A Google account
How to install Google Tag Manager on Squarespace: Step-by-step
- 1
Create a GTM container
Go to tagmanager.google.com, sign in, click Create Account, fill in the details, choose Web platform. Accept the Terms. GTM gives you the two install snippets - copy both.
- 2
Open Squarespace's Code Injection panel
In your Squarespace admin: Settings → Advanced → Code Injection.
- 3
Paste the head snippet
Paste the GTM
<script>block (the longer one with(function(w,d,s,l,i)at the start) into the Header field. Click Save. - 4
Paste the noscript snippet
Squarespace doesn't expose direct access to the
<body>tag, so the<noscript>block goes into the Footer code injection field instead. This is acceptable - the<noscript>only fires for users with JavaScript disabled (a tiny fraction of traffic) and most tag platforms still receive the event from the head<script>regardless. Click Save. - 5
(Squarespace Commerce only) Add ecommerce data-layer events
For Squarespace Commerce stores, ecommerce events (
view_item,add_to_cart,purchase) don't flow intodataLayerautomatically. To capture them, paste a custom data-layer snippet that hooks into Squarespace's order confirmation page. There's no first-party Squarespace approach to this; community snippets are available on GitHub or via paid services like Stape. Skip this step entirely if you're not running Commerce. - 6
Add a tag in GTM and publish
In tagmanager.google.com, click Tags → New. For GA4, choose Google Analytics: GA4 Configuration, paste your Measurement ID, set trigger to All Pages, save. Click Submit in the top-right to publish the container.
- 7
Verify with GTM Preview
Click Preview in GTM, paste your Squarespace site URL, click Connect. A new browser window opens with the GTM debug overlay. You should see your container ID and any configured tags listed under Tags Fired.
How to verify your setup is working
GTM Preview mode is the most thorough verification - it shows every tag, trigger, and data layer event in real time. Outside Preview, the Google Tag Assistant Chrome extension confirms your GTM-XXXXXXX ID is firing on every page. If you've added GA4 inside the container, Realtime in GA4 should also show your test session.
Common issues and fixes
GTM Preview says "GTM container not found"
The script wasn't saved or didn't deploy. Confirm by viewing the live page source (Ctrl+U / Cmd+U) and searching for GTM-XXXXXXX. Squarespace's CDN occasionally caches Code Injection changes for a minute or two - wait and re-verify. If the snippet still isn't appearing, check that you saved at the bottom of the Code Injection page (Code Injection has its own Save button separate from page Save).
I'm on the Personal plan and Code Injection is missing
Code Injection requires a Business or Commerce plan. The Personal plan doesn't include it, so GTM can't be installed at all on that plan. Upgrade to Business as the cheapest path to GTM support.
I want to track Squarespace Commerce purchases without writing code
Squarespace Commerce doesn't push ecommerce events into dataLayer automatically. Without a custom data-layer snippet, you can fire a basic purchase event in GTM by configuring a trigger on the order confirmation URL pattern (/checkout/order-confirmation) and a custom HTML tag that reads order details from Squarespace's exposed window objects. Several agencies sell pre-built Squarespace Commerce data-layer scripts - search for Squarespace Commerce GTM data layer if you need a turnkey option.
Frequently asked questions
Does Squarespace support Google Tag Manager?
Yes, on Business and Commerce plans (which include Code Injection). The Personal plan can't install GTM - it has no equivalent for Code Injection. The cheapest path to GTM on Squarespace is upgrading to Business.
Where do I paste the Google Tag Manager noscript code on Squarespace?
In Code Injection's Footer field. Squarespace doesn't expose direct access to the opening <body> tag (which is technically where the <noscript> belongs), but Footer injection is an acceptable substitute - the noscript fires only for users with JavaScript disabled (a tiny fraction of traffic) and most tag platforms still log the event from the head script regardless.
Can I track ecommerce on Squarespace using Google Tag Manager?
Yes, but it requires a custom data-layer snippet - Squarespace Commerce doesn't push ecommerce events into dataLayer automatically. You can either write the snippet yourself (community examples are on GitHub) or buy a turnkey Squarespace Commerce data-layer template from an agency. Once the data layer is firing, GTM tags can pick up view_item, add_to_cart, purchase, etc.
Is Google Tag Manager free for Squarespace?
GTM itself is free. Squarespace charges for the plan that includes Code Injection (Business and above). There's no per-tag or per-event fee from Google. You only pay for the Squarespace plan.
Should I use Code Injection or the External API Keys field for Google Tag Manager?
Code Injection. The External API Keys field accepts only Google Analytics measurement IDs (and a few other specific integrations) - it doesn't support GTM container IDs. Always paste GTM into the Code Injection Header field.
How do I know if Google Tag Manager is working on Squarespace?
Use GTM's Preview mode - paste your Squarespace URL, click Connect, browse the site in the preview window. Every tag firing should appear in the Tags Fired list. The free Google Tag Assistant Chrome extension also confirms your container ID is firing on every page.
Related Guides
Once you're set up, MeasureBoard turns the data into action
MeasureBoard connects to your analytics, search, and SEO tooling and generates AI-powered weekly reports, GEO readiness scores, and a dedicated AI analyst that answers questions in plain English. Free to start, connects in 30 seconds.
Get Started Free