Analytics - Ecommerce SEO - Tag Manager

How To: Implement Revenue Tracking On Square Space

By on 7th October 2024

Reading Time: 2 minutes

  • LinkedIn
  • Twitter
How To: Implement Revenue Tracking On Square Space

One of the tasks that keeps me busiest these days as a GA4 Consultant is ensuring accurate user and revenue tracking is in place, not just for GA4 but for other 3rd party tracking scripts as well.  Now as much as I like a challenge, Square Space really does throw up one that shouldn’t even be a challenge in the first place.

Table of Contents

The Issue

Out of the box, Square Space GA4 tracking offers standard user tracking and the most basic of ecommerce tracking by tracking purchases and which items were bough, but doesn’t track the associated revenue – which leads to a mostly useless report such as:

The only question I have is, Why Not?

Why even bother tracking any ecommerce at all if you not going to do the fundamentals.

The good news is, it can be fixed, but you have to do it yourself.

The Solution

I spent a lot of time looking for answers, but few were forthcoming.  I found an article from 2023 suggesting there was a  hidden JS object you could interrogate as follows:

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

But it didn’t work.

And then I stumbled across this gem of an article by Taylor Martin who has put some bespoke code together.  The full article is here:

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

I won’t go into too much detail here as Taylor’s article covers it all but in summary, there is custom HTML and recommend triggers you can implement via Google Tag manager which will help you track:

  • View Item List
  • View Item
  • Select Item
  • Add to Cart
  • Remove from Cart
  • View Cart
  • Begin Checkout
  • Purchase

There are a couple of things to note – these are in some cases based on specific Square Space elements and naming conventions being visible on the page.  Therefore this may not work if you directly copy the code, and you may need to tweak to match the layout and css of your specific square space theme – but, do that, and you’re good.

And on my site, we now have items viewed and revenue tracking in place.  Add to cart doesn’t due to how the site functions but ultimately it’s the revenue we wanted:

Revenue Data

So there you go – I love blog posts that folk do like this, they can be absolute game changers for you or your client’s marketing efforts.  If you need any assistance implementing this, feel free to get in touch.

Dave Ashworth

About The Author -

I would describe myself as an SEO Expert and a specialist in technical optimisation with a professional approach to making websites better for people and better for search engines.

When I'm not blogging, I deliver website optimisation consultancy and organic SEO solutions by addressing a website's technical issues and identifying opportunities for growth


Get In Touch

Fill in the form below if you want to enhance your website's organic visibility