How to Track Ecommerce Purchase on Squarespace Using GA4 and GTM

Introduction

If you’re running an online store on Squarespace, tracking purchases is crucial for understanding your customers and optimizing your marketing. In this guide, you’ll learn how to track purchases on Squarespace using Google Analytics 4 (GA4) and Google Tag Manager (GTM). This method ensures accurate and detailed eCommerce tracking using the latest GA4 data model.

This tutorial is ideal for those looking to improve their Squarespace analytics, implement GA4 eCommerce tracking on Squarespace, or set up conversion tracking on Squarespace using Google tools.

Prerequisites

Make sure you have the following ready:

  • A Squarespace website.
  • A Google Tag Manager (GTM) container.
  • A GA4 property created in your Google Analytics account.
  • Access to Squarespace’s Code Injection feature.

🚀 Need help?
Hire Me for Setup: WhatsApp Me
Book a Consultation: Schedule a Call

Step 1: Add Google Tag Manager to Squarespace

  1. Go to your Squarespace Dashboard
  2. Navigate to: Website > Pages > Custom Code > Code Injection
  3. Paste your GTM container code inside the Header field
  4. Click Save

Setup GTM on squarespace

Step 2: Add Purchase Data Layer to the Order Status Page

We’ll push the purchase event into the data layer so GTM can capture it.

  1. Still under: Dashboard > Website > Pages > Custom Code > Code Injection
  2. Scroll to the Order Status Page section
  3. Add the following script:

How to add Data Layer on Order status page

Step 3: Create a Trigger for Purchase Event in GTM

  1. Go to GTM → Triggers > New
  2. Name it: Purchase
  3. Trigger Type: Custom Event
  4. Event Name: purchase
  5. Fire on: All Custom Events

GTM Purchase Trigger

Step 4: Create Data Layer Variables in GTM

In GTM, create variables to capture key values from the data layer:

  1. DLV – transaction_id = ecommerce.transaction_id
  2. DLV – value = ecommerce.value
  3. DLV – currency = ecommerce.currency
  4. DLV – email = customerEmailAddress

You’ll use these for both the GA4 Purchase Event and Google Ads Enhanced Conversions.

GTM Data Layer Variable

Step 4: Create GA4 Purchase Event Tag

Now, let’s send this data to GA4:

  1. In GTM, go to Tags > New.
  2. Name it: GA4 – Purchase
  3. Tag Type: GA4 Event Tag
  4. Configuration Tag: Select your GA4 config.
  5. Event Name: purchase
  6. Parameters:
    • transaction_id: {{DLV – transaction_id}}
    • value: {{DLV – value}}
    • currency: {{DLV – currency}}
  7. Trigger: Event equals purchase

Squarespace GA4 Purchase Tag

Step 5: Test Your Setup

  1. Use GTM Preview Mode to test the setup.
  2. Complete a test order in Squarespace.
  3. Check purchase event in Tag Assistant.
  4. Visit GA4 > Admin  > Debug View to verify the data.

Squarespace GA4 Test Purchase

Step 7: Publish the GTM Container

Once verified:

  1. Click Submit in GTM.
  2. Add a name like GA4 Purchase Setup for Squarespace.
  3. Hit Publish.

🎉 You’ve now implemented GA4 Ecommerce Tracking for Squarespace!


Need help with Squarespace analytics or conversion tracking?

Hire Me for Setup: WhatsApp Me
Book a Consultation: Schedule a Call

✅ Frequently Asked Questions (FAQs)

Q1: How do I add Google Analytics code to Squarespace?
Go to Dashboard > Website > Pages > Custom Code > Code Injection, and paste your GA4 or GTM code in the Header. This activates Squarespace analytics tracking via GA4.


Q2: Can I track purchases on Squarespace using GA4?
Yes! With Google Tag Manager and a custom data layer, you can track purchase events using GA4 Ecommerce tracking on Squarespace.


Q3: Does Squarespace support Enhanced Ecommerce tracking?
Not natively. But you can use GTM and a purchase data layer to enable Squarespace Enhanced Ecommerce Tracking.

Conclusion

Using Google Tag Manager and GA4, you can fully track purchases and enhance conversion tracking in Squarespace. You now know how to:

  • Add GTM to Squarespace
  • Push a data layer on the Order Status Page
  • Send purchase events to GA4
  • Use email for Enhanced Conversions

Need Help with Squarespace Conversion Tracking?

Feeling confused or overwhelmed with data layers, JavaScript, or Google Tag Manager? Don’t worry—I’ve got you covered!

I specialize in setting up Google Ads Enhanced Conversion Tracking and GA4 Ecommerce Tracking for Squarespace. I handle everything—from adding GTM to Squarespace to implementing accurate conversion tracking that helps you see more conversions in your reports.

Message me on WhatsApp
Book a Free Consultation

Let’s get your Squarespace analytics working properly today.
For more insightful guides and tips on conversion tracking and digital marketing, check out my other Blogs Here

Author

Md Zubayer Islam
Marketing Data Analyst

LinkedIn
Facebook
Twitter

Leave a Comment

Your email address will not be published. Required fields are marked *