Tag Manager - Analytics - Ecommerce SEO

How To: Set Up GA4 Ecommerce Tracking on Squarespace

How To: Implement Revenue Tracking On Square Space

TL;DR:
Squarespace has a built-in Google Analytics integration that can send purchase and revenue information to GA4. If you want more detailed ecommerce tracking across the customer journey, including product views, add to cart, checkout and purchase events, you’ll need a more comprehensive implementation. This guide looks at the limitations I encountered with Squarespace ecommerce tracking and how I used Google Tag Manager to get more useful ecommerce data into GA4.

Why I needed better Squarespace ecommerce tracking

One of the things that keeps me busy as a GA4 consultant is making sure websites aren’t simply collecting data, but are collecting the information actually needed to understand how users and customers interact with them.

Ecommerce tracking is a good example. Knowing that somebody visited a product page is useful, but ideally you want to understand the journey through product views, add to cart, checkout and ultimately the purchase and revenue generated.

Squarespace provides a built-in Google Analytics integration, but I ran into limitations when working on a Squarespace ecommerce site where the data reaching GA4 wasn’t giving us the revenue reporting we needed.

That led me down the rabbit hole of implementing more comprehensive Squarespace ecommerce tracking using Google Tag Manager.

What ecommerce data does Squarespace send to GA4?

There’s an important update to make here because Squarespace’s GA4 integration has changed since I originally wrote this article.

At the time, the implementation I was working on was sending basic ecommerce information into GA4, including purchases and the items bought, but wasn’t providing the associated revenue data we needed.

This resulted in reporting like this:

GA4 Product Data

Squarespace’s current documentation says its built-in Google Analytics integration can send information including the order ID, store name and purchase total for completed orders.

So I wouldn’t now describe missing revenue as a general limitation of Squarespace’s GA4 integration.

The wider problem is still relevant, though. If you want to understand more of the ecommerce journey rather than simply completed orders, you may need to go beyond the standard integration.

When do you need more advanced Squarespace ecommerce tracking?

Purchase and revenue data tell you what was sold, but they don’t necessarily tell you enough about what happened before the sale.

For a more complete ecommerce implementation, you may want to track events such as:

  • view_item_list – somebody views a list of products
  • view_item – somebody views a particular product
  • select_item – somebody selects a product
  • add_to_cart – somebody adds a product to their cart
  • remove_from_cart – somebody removes a product
  • view_cart – somebody views their shopping cart
  • begin_checkout – somebody starts the checkout process
  • purchase – somebody completes an order

Tracking these interactions gives you considerably more information about where customers progress through or drop out of the buying journey.

It also gives you much more useful data to work with when building ecommerce reports and dashboards in tools such as Looker Studio.

How I implemented Squarespace ecommerce tracking with GTM

I spent a lot of time looking for a way to get the ecommerce data I needed from Squarespace, but useful answers were surprisingly difficult to find.

I initially found an article suggesting there was a hidden JavaScript object that could be interrogated:

Y.Squarespace.CommerceAnalytics._yuievt.events["commerceTrack:commerce-checkout-confirmed"].details[0] 

Unfortunately, that didn’t work on the site I was dealing with.

I then stumbled across an excellent article by Taylor Martin covering a much more comprehensive GA4 ecommerce implementation for Squarespace using Google Tag Manager:

The Complete GA4 Ecommerce Setup Guide for Squarespace Using Google Tag Manager

I’m not going to reproduce Taylor’s implementation here because his guide covers the code and setup in detail. The important part for my purposes was that it provided a way of capturing the ecommerce interactions I actually wanted and sending them into GA4 through GTM.

The implementation can capture the major ecommerce interactions from viewing products through to completing a purchase, including product views, cart interactions, checkout and revenue-generating purchase events.

There is an important caveat. Some of the tracking relies on particular Squarespace elements, selectors and naming conventions being present on the page.

That means you shouldn’t simply copy somebody else’s code into GTM and assume it will work on your Squarespace site.

Depending on the template, design and way the store has been configured, you may need to adjust the implementation to match the HTML and CSS selectors used by your particular site.

This is exactly the sort of implementation where I’d spend plenty of time in GTM Preview mode testing each interaction before publishing anything.

Did the Squarespace revenue tracking work?

Yes. Once we’d adapted the implementation to the site, we were able to get the product and revenue data we actually wanted into GA4.

Revenue Data

Not every event worked perfectly out of the box. In this particular implementation, add_to_cart wasn’t available because of the way the site itself functioned.

But the important objective was getting accurate purchase and revenue data into GA4, and that’s what we achieved.

It’s also a useful reminder that ecommerce tracking isn’t simply a case of installing a generic script. You need to test the implementation against the actual website and make sure the events, parameters and values arriving in GA4 reflect what users are really doing.

Should you use GTM for Squarespace ecommerce tracking?

If Squarespace’s native GA4 integration provides all the ecommerce information you need, I wouldn’t add a more complicated GTM implementation simply for the sake of it.

But if you need more detailed measurement of the ecommerce journey, or the standard implementation isn’t providing the events and data your reporting requires, GTM gives you considerably more flexibility.

The important thing is to start with the measurement requirement rather than the tool. Work out what you actually need to know about product views, cart activity, checkout and purchases, then build the tracking needed to answer those questions.

If you need help implementing or troubleshooting a more advanced setup, this is the sort of work I cover through my analytics and ad tracking consultancy and Google Tag Manager consultancy.




About The Author

I'm Dave Ashworth, a freelance SEO and website optimisation consultant with a background in development and a focus on fixing what's broken, improving what's working, and helping businesses grow through clear, practical SEO.

I combine hands-on technical know-how with years of experience in analytics, content strategy and platform optimisation. Whether it's an audit, a migration, or ongoing performance support, my work's about making websites stronger, faster, and easier to understand for - users, search engines and AI platforms.

When I'm not writing guides or sharing insights, I'm working directly with clients to solve problems, track results, and keep their sites moving in the right direction.

Dave Ashworth

get in touch

If you need some expert website optimisation and configuration, want to find out more, or even just have a question, fill in the form below as I will always be happy to help