July 6, 2026Analytics

Google Tag Manager Squarespace: Conversion Tracking

Why Google Tag Manager Squarespace Setups Miss Conversions

Last month I audited a Squarespace Commerce store running EUR 4,200 per month on Google Ads. Their GA4 showed 31 purchases in June. Squarespace's order panel showed 58. That is a 47 percent gap. The store owner had been scaling ad spend based on a cost-per-acquisition that was nearly double the real figure.

The cause took five minutes to find. The GTM container was pasted into the site-wide header code injection. It loaded on every page visitors could browse. But Squarespace does not allow custom code on checkout pages -- they are locked down for PCI compliance. So GTM never loaded during checkout, and the purchase tag had nowhere to fire.

The fix was not complicated. But nobody had told this founder how to add Google Tag Manager to Squarespace correctly -- it requires a second code injection specifically for the order confirmation page, and the data layer push on that page uses Squarespace's own template variables, not the DOM elements you might expect.

This is the pattern I see on roughly six out of ten Squarespace ecommerce sites that come through my inbox: GTM is "installed," but conversions are not actually tracked.

How Squarespace Code Injection Works (and Where It Does Not)

Before you install Google Tag Manager on Squarespace, you need to understand the platform's constraints. Squarespace is not WordPress. You do not have access to theme files, hook priorities, or server configuration. You get a handful of code injection fields, and that is it.

Injection fieldWhere code rendersAvailable on
HeaderInside <head> on every pageAll pages except checkout
FooterBefore </body> on every pageAll pages except checkout
Order Confirmation PageOn the post-purchase confirmation page onlyOrder confirmation only
Per-page headerInside <head> on a single pageThe specific page you configure

The critical gap: checkout pages do not execute any injected code. Squarespace strips all custom scripts from checkout for security reasons, per their code injection documentation. Your GTM container, your Meta pixel, your Google Ads tag -- none of them load while the customer enters payment details.

This means your conversion tag cannot fire on a checkout event. It can only fire on the order confirmation page, after the purchase is complete. Every Squarespace Google Tag Manager setup must account for this.

Plan requirements

Code injection requires at least the Core plan (formerly Business). If you are on the Basic plan, code injection is disabled entirely, and you cannot add Google Tag Manager to Squarespace without upgrading. Squarespace lists this under their premium features.

Step 1 -- Add Google Tag Manager to Squarespace Header

Navigate to Settings > Developer Tools > Code Injection. In the Header field, paste the GTM <script> snippet:

<!-- 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 -->

In the Footer field, paste the <noscript> fallback:

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

Replace GTM-XXXXXXX with your container ID. Click Save.

This is the standard way to install Google Tag Manager on Squarespace. The header injection places the script inside <head> site-wide; the footer injection places the noscript fallback before </body>. Both match Google's official placement instructions.

Version 7.0 and Ajax loading

If your site runs Squarespace 7.0 with Ajax loading enabled, page navigations do not trigger full reloads. GTM's Page View trigger fires only once. The fix: create a History Change trigger in GTM that fires on gtm.historyChange events, per Squarespace's Ajax documentation. Version 7.1 does not use Ajax loading, so this is not a concern on newer sites.

Step 2 -- Set Up the Order Confirmation Data Layer

This is where most Squarespace GTM setups fail. The header and footer code injection fields do not render on the order confirmation page. You need to use the dedicated Order Confirmation Page code injection field.

Go to Settings > Developer Tools > Code Injection and scroll to the Order Confirmation Page field. Paste a dataLayer.push() that maps Squarespace's template variables into the GA4 ecommerce format:

<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ ecommerce: null });
window.dataLayer.push({
  event: 'purchase',
  ecommerce: {
    transaction_id: '{orderId}',
    value: {orderSubtotal},
    currency: 'EUR',
    items: []
  }
});
</script>

Replace 'EUR' with your store's currency.

Squarespace provides these template variables on the confirmation page, documented in their code injection reference:

VariableValue
{orderId}Order number
{orderSubtotal}Subtotal as a decimal
{orderSubtotalCents}Subtotal in cents
{orderGrandTotal}Grand total as a decimal
{orderGrandTotalCents}Grand total in cents
{customerEmailAddress}Customer email

Use {orderSubtotal} or {orderGrandTotal} depending on whether you want revenue before or after shipping and tax.

Why the data layer matters here

Without this push, your GTM container loads on the confirmation page (because the header injection fires there), but no purchase event exists in the data layer. Your GA4 tag and Google Ads conversion tag have nothing to trigger on. I wrote a full breakdown of why this pattern matters in What Is a Data Layer and Why Tracking Breaks Without One.

The items array limitation

Squarespace's template variables do not expose individual line items. You get the order total and order ID, but not a per-product breakdown. Your GA4 items array will be empty unless you parse the confirmation page DOM for product names and quantities. For conversion tracking and value-based bidding, the order total and transaction ID are enough. For product-level reporting, you need DOM parsing or a server-side integration.

Step 3 -- Configure GTM Tags and Triggers

Inside your GTM container, create the tags that consume the data layer push.

GA4 purchase event

Create a trigger of type Custom Event with the event name purchase. Then add a Google Analytics: GA4 Event tag:

  • Event name: purchase
  • Enable "Send Ecommerce data" with the data source set to "Data Layer"

GTM reads ecommerce.transaction_id, ecommerce.value, and ecommerce.currency directly from your push. If you have not set up GA4 event tracking yet, my post on GA4 events, parameters, and common mistakes covers the configuration in detail.

Google Ads conversion tag

Add a Google Ads Conversion Tracking tag on the same purchase trigger. Map transaction_id, value, and currency from data layer variables. The transaction ID is critical -- it lets Google Ads deduplicate if the confirmation page is reloaded. For the full setup, see Google Ads Conversion Tracking: Complete Setup Guide.

Meta pixel purchase event

If you run Meta campaigns, fire a Purchase event using a Custom HTML tag:

<script>
  fbq('track', 'Purchase', {
    value: {{DLV - ecommerce.value}},
    currency: {{DLV - ecommerce.currency}},
    content_type: 'product'
  });
</script>

Because Squarespace's checkout page strips all scripts, the Meta pixel cannot fire during the payment flow. The browser pixel only fires on the confirmation page. This makes server-side tracking through Meta's Conversions API especially valuable for Squarespace stores -- it fills the gap where the browser pixel cannot reach.

Step 4 -- Validate the Full Flow

Once your Google Tag Manager Squarespace tags are configured, validate end to end.

GTM Preview mode

Click Preview in GTM, enter your Squarespace site URL, and walk through a test purchase. Confirm the purchase event appears in the debug panel on the order confirmation page with transaction_id and value populated. If the event does not appear, the order confirmation code injection is not firing -- recheck the field under Developer Tools.

GA4 DebugView

In GA4, open Admin > DebugView. Place a test order. The purchase event should arrive with the correct revenue. If the event name shows but value is zero, confirm your code uses {orderSubtotal} without quotes around the numeric value -- wrapping it in quotes sends a string, and GA4 silently drops string values from monetary metrics.

Cross-check with Squarespace orders

Compare three to five test orders between your Squarespace dashboard and GA4 Realtime. They should match one to one. If GA4 is undercounting, you likely have a trigger or consent issue. For a systematic audit process, I maintain a Google Analytics Audit Checklist for GA4 that covers every layer.

Common Failures on Squarespace

After auditing Google Tag Manager Squarespace setups, I see the same failures repeat.

1. GTM snippet only in the header, no order confirmation code. The container loads site-wide, but there is no purchase data layer push. Conversions never fire. This is the single most common Squarespace Google Tag Manager mistake.

2. Using {orderGrandTotal} with quotes. If your code reads value: '{orderGrandTotal}', Squarespace injects the number but JavaScript treats it as a string. GA4 records the event but drops the revenue. Remove the quotes.

3. Duplicate tracking from Squarespace's built-in GA4 integration. Squarespace has a native Google Analytics integration where you paste your Measurement ID. If that is active while GTM also fires GA4, every pageview and event is double-counted. Pick one path. I recommend GTM for its control over triggers, consent, and custom events.

4. No consent handling for EU visitors. If you serve European customers, your tags must respect consent. Without Google Consent Mode v2 defaults, tags either fire without consent or do not fire at all. Squarespace has no built-in CMP that integrates with Consent Mode, so you need a third-party solution loaded through header code injection.

5. Relying solely on browser-side tracking. Even with a correct setup, browser-side tags lose data. Safari caps JavaScript-set cookies at seven days -- and at 24 hours when the URL carries ad-click parameters like gclid. Ad blockers affect a meaningful share of traffic. A server-side GTM container on your own subdomain recovers data the browser path loses.

When Browser-Side Is Not Enough

A properly configured Google Tag Manager Squarespace setup with the order confirmation data layer push will capture most conversions. But "most" is not "all."

If your store runs meaningful ad spend, the gap matters. Smart Bidding optimises on conversions it can see. Feed it 60 percent of your purchases and it overbids on the wrong audiences.

Server-side tracking fixes this. Your web container sends events to a server-side GTM container on your subdomain, which forwards them to GA4, Google Ads, and Meta server-to-server. No ad-blocker interference. Durable first-party cookies. I break down the architecture in Server-Side Tracking: A Complete Guide.

If your conversion numbers in GA4 are more than 10 percent off from Squarespace's orders panel, you have a tracking gap silently degrading ad performance. I fix these for a living. Book a tracking audit and I will tell you exactly what is broken.

FAQ

Can I add Google Tag Manager to Squarespace on the Basic plan?

No. Code injection is only available on the Core plan and above. The Basic plan disables code injection entirely, so you cannot add any custom scripts including Google Tag Manager. You need to upgrade to at least the Core plan to use GTM on Squarespace.

Why does my GTM purchase tag not fire on Squarespace?

The most common cause is that the data layer push for the purchase event is missing from the Order Confirmation Page code injection field. The site-wide header injection does not render on the order confirmation page in the same way, so you must add a separate script in Settings, Developer Tools, Code Injection, Order Confirmation Page that pushes the purchase event with Squarespace template variables like orderId and orderSubtotal.

Does GTM load on Squarespace checkout pages?

No. Squarespace strips all custom code from checkout pages for PCI compliance and security reasons. Your GTM container does not load while customers enter payment details. Conversion tracking can only fire on the order confirmation page that appears after the purchase is complete.

Can I track individual product items in Squarespace purchase events?

Not natively. Squarespace's order confirmation template variables only expose the order ID, order totals, and customer email. They do not provide a per-item breakdown. For product-level data in GA4, you need a custom script that parses the confirmation page DOM or a server-side integration that pulls item data from the Squarespace API.

Should I use Squarespace's built-in Google Analytics integration or GTM?

Use one or the other, never both. Running the native Squarespace GA4 integration alongside a GTM-based GA4 setup will double-count every pageview and event. GTM gives you more control over triggers, consent mode, custom events, and server-side forwarding, which is why I recommend it for any store that runs paid advertising.

Not sure your Squarespace tracking is actually capturing conversions? Get in touch -- I will audit your setup and tell you exactly what is broken and what to fix first.

Ready to fix your marketing measurement?

Take assessment →