Squarespace + Google Analytics 4 E-Commerce purchases showing $0 value?
If you're a Squarespace user who wants to track your website's analytics, you may have noticed that the built-in integration with Google Analytics 4 (GA4) isn't working as expected. Specifically, the problem seems to be that Squarespace doesn't pass along the currency code for e-commerce purchases, leading to purchase values not being tracked.
Update September 9th 2023
I have a solution for this annoying bug. If you want me to fix the bug for you, please fill out the form below 👇👇👇👇👇👇👇
👆👆👆👆👆👆👆
You can skip the stuff below.
Update Aug 1st 2023
Please read this first. So, in a nutshell, there used to be a “secret” JavaScript object on the Squarespace order confirmation page. We were able to parse that with custom javascript code injection and get all the hidden extra information about the e-commerce purchase. We could use that to get a list of products, and SKU’s prices for each product. That was a solution to make custom conversion tracking, and also a workaround for problems Squarespace has with their built-in Google Analytics implementations. Now with the new order status page, we no longer have access to that workaround.
The problem is that Squarespace built-in Google Analytics 4 e-commerce tracking doesn’t work at the moment, and we no longer have the option to disable the built-in Google Analytics for integration and replace it with a custom-made option (using for example Google tag manager). However, there is another workaround available in the new GA4 allowing us to hard-core the missing parameters, finally making the GA4 purchases work for Squarespace, allowing us to track our sales and their traffic source.
Wanna see purchase values ($, £, € etc) for Squarespace e-commerce purchases?
Get in touch.
Get in touch at @hire and I can implement a fix for you.
The old original blog post below:
Fortunately, there is a solution to this problem: using the Google Tag Manager (GTM) data layer and a custom Google Analytics purchase tag in Squarespace to manually send the e-commerce purchase event. In this blog post, we'll look at this issue and solution.
But first, let's talk a bit more about the issue at hand. Google Analytics 4 requires that a currency code is included in e-commerce purchase events. This allows Google Analytics 4 to properly display revenue reports in your chosen currency, and it's also necessary if you want to use Google Analytics 4 's advanced analysis features such as predictive analytics.
Squarespace, however, doesn't include the currency code in its e-commerce purchase events. As a result, Google Analytics 4 can't properly track purchase values.
To fix this issue, we can either wait for Squarespace to maybe one day fix the Google Analytics 4 integration, or take matters into our own hands and use the Google Tag Manager data layer to manually send the e-commerce purchase event with the proper currency code.
How to do it? It’s a little tricky First we gotta add the ecommerce purchase to Google Tag Manager data layer. We could hope that a simple code like this would do it…
However for the purchase event 3 fields are required.
The required events are:
currency
value
items
This presents a problem.
We don’t get the items using the built- in order confirmation page variables:
{orderId}
: The order number of the confirmed order{orderSubtotal}
: The subtotal of the confirmed order{orderSubtotalCents}
: The subtotal of the confirmed order, in cents{orderGrandTotal}
: The grand total of the confirmed order{orderGrandTotalCents}
: The grand total of the confirmed order, in cents{customerEmailAddress}
:The customer's email address, as it was entered in the "Billing Info" section
To get what Google Analytics 4 requires, list of items that was purchase in the e-commerce transaction we need this “secret” Squarespace javascript object
Y.Squarespace.CommerceAnalytics._yuievt.events["commerceTrack:commerce-checkout-confirmed"].details[0] javascript object.
With this data layer format, we would now make the Google Analytics 4 play nicely with Squarespace.
If you need 1-on-1 help, get in touch at @hire