Great news! Squarespace has recently added native support for Google Analytics 4 which makes it easier to integrate the two platforms.
It's also great timing now that Google has officially announced the retirement of Universal Analytics (the previous generation of Google Analytics).
Here's a step-by-step guide on how to add Google Analytics 4 to Squarespace.
In summary, we'll go over
Note that this method works for both Squarespace version 7.0 and 7.1.
Let's dive right in.
This step assumes you have created a Google Analytics Property for your site, if not then follow Google's documentation here.
Head to your Analytics dashboard, select Admin.
Then in your Admin dashboard, select Data Streams.
Select your website.
Click on the Copy icon to copy your Google Analytics 4 tracking ID.
Paste it in a notepad or a text editor, you will need this later.
Now head over to your Squarespace account.
First, login to your Squarespace account and select a site to edit.
In your site dashboard, select Settings.
Then, in the site settings, select Advanced ➞ External API Keys.
Paste the Google Analytics tracking ID that you copied earlier into GOOGLE ANALYTICS and hit Save.
You've now added Google Analytics 4 to Squarespace!
It takes about 24 hours Google Analytics to start populating results in your dashboard, which you can see in the home screen.