Before we jump in we need to distinguish between the Google Analytics tracking method: Universal Analytics (UA) and GA4. The “old” and most common way is using the UA-Tracking ID, however, Google rolled out some updates to the GA4 tracking.
You can read more about which tracking method is right for you here.
Adding Google Analytics UA-Tracking ID to Squarespace
First, we also need to separate three different ways on how to add Google Analytics to Squarespace. The fastest way is to a) use external API Keys, or b) add the tracking ID to your Google Tag Manager. Just for comprehensive purposes, you can also c) add the code onto the page. We will need this step for GA4 implementation and skip it for Universal Analytics (UA) tracking.
Using Squarespace API Keys: You can add your Google Analytics Tracking ID without coding to Squarespace:
In your Squarespace account dashboard, navigate to Settings -> Advanced -> External API Keys and insert your UA tracking ID.
Using Google Tag Manager: Simply add a tag to Google Tag Manager and insert your GA tracking ID.
Learn how to add Google Tag Manager to Squarespace and why it’s the best solution.
In your dashboard, navigate to “Tag” in the left main panel, choose the Universal Analytics tag type for the UA tracking code:
In the next step, configure the tag: Choose the track type (Pageviews) and pick the Google Analytics settings. If you have a GA pixel added already you can pick it from the dropdown but if not you will need to add a “New Variable…”:
Insert your GA tracking ID:
Set the trigger for all page views, and your Google Analytics tracking is established.
If you want to track events and button clicks in your Google Analytics, refer to How to track button clicks in Google Analytics guide.
Find your Google Analytics Tracking Code
In your Google Analytics account -> click Admin -> Properties -> Property Settings
How to add Google Analytics GA4 to Squarespace
Again, we have two different options how to add Google Analytics GA4 to Squarespace: 1) add code to the Squarespace website, or 2) add GA4 tracking to Google Tag Manager.
1) Add GA4 to Squarespace: Grab your entire Global Site Tag (gtag.js) from Google Analytics and add it to your HTML header:
Admin dashboard -> Settings -> Advanced -> Code Injection -> copy/paste the gtag.js code snippet into the header section -> Save
2) Add GA4 to Google Tag Manager (GTM): Similar to the UA tag creation, we add a new tag in GTM, but this time we choose “GA4 Configuration”.
Next, insert your measurement ID starting with “G-“.
Test your Google Analytics pixel on Squarespace
Three possible ways (again): Use the Chrome Google Tag Assistant Legacy extension, check your Google Analytics Real Time view, or the Google Tag Manager preview functionality.
Track Goals of your Squarespace Site in Google Analytics
Seeing your website traffic or bounce rate is all great but what does it mean for your business? We want to add goals to track meaningful events on your Squarespace site.
The most common goal is to track form submissions and contact requests.
1) Destination Tracking
The easiest way is to track a destination URL as a goal. For example, you can easily create a Thank You page in Squarespace and automatically redirect users to that page when they filled out a contact form. The trick is that only people who fill out a form will reach that page.
In Google Analytics you can add a goal in the admin panel and use the page path as a destination:
Make sure to use the “regular expression” instead of “equal to” in case there are parameters attached to the final URL.
2) Event tracking
You can also track link clicks, button clicks, call widget clicks, and more in an advanced setup. See the full guide on how to track button clicks in Google Analytics.
3) Engagement metrics
You can also track site visitors’ engagement metrics like time on page, number of page views, etc. to further understand engagement. This can be important for blogs or content-heavy websites.
Sascha is a Lifecycle Marketing Consultant with over 8 years of digital marketing experiences in Silicon Valley, the UK, and Germany.
After leading the demand generation for a 100+ million company, he decided to venture out on himself. He’s now helping clients to attract and convert more leads and customers.
His main focus are SEO, paid media & marketing automation – all with the focus to tie marketing campaigns to revenue.
Sascha has been featured in industry publications.