Google Analytics and Squarespace
Wondering how to add Google Analytics (GA4) to Squarespace? You need to add a Google tag to your website to be able to use many Google products and services. You can use one Google tag on your site and connect the tag to multiple destinations, or Google accounts, such as Ads and Analytics. This article covers these basics:
Best practice: If an agency or consultant is helping your business with GA4 setup, create your own account and then add the agency as a user.
NOTE: Google’s Universal Analytics (the version used before GA4) began shutting down in July 2023 and by October all UA properties stopped processing data. You will lose access to historical UA data in July 2024, so export any needed data before that time.
What is Google Analytics?
In a nutshell, Google Analytics (GA4) is a free product that gives you information on how website users engage with your content. It allows you to know what’s working and what’s not on your site, so you can take action to improve user experience.
Google Analytics tracks user activity such as bounce rate, pages per session, and session duration. It integrates with Google Ads, allowing you to track landing page quality and conversions. Google’s high-level dashboard reports are helpful for casual users (i.e. most Squarespace users), and in-depth data is always available if needed.
Should you add Google Analytics to your website? Adding GA allows you to begin collecting insightful data even if you won’t refer to it for a while. And it allows you to filter out or exclude your team’s visits to the website which is particularly helpful for low traffic sites—it is not possible to block specific IP addresses with Squarespace Analytics.
Google UA vs. Google Analytics 4
If your Squarespace site has been around for a while, you might still have a legacy UA tracking code on the site. If so, you’ll need to swap it out with a newer GA4 tag ID to see current data in Google Analytics. Note, there are differences between the two data models and GA4 data will look different from UA data.
Universal Analytics (UA) was the default property type prior to October 2020 and was completely phased out by October 2023. A UA tracking ID looked something like UA-XXXXXX-Y. This tracking code no longer works.
Google Analytics 4 (GA4) is a newer property that is used for a website, an app, or a website and app together. GA4 uses a Google tag ID that looks something like G-XXXXXXXX.
If you aren’t sure whether or not you already have a Google tag, follow Google’s instructions to find a tag ID.
Adding Google Analytics to Squarespace
Using Google Analytics (GA4) with Squarespace is accomplished by adding a Google Analytics 4 tag ID or Google tag (gtag.js) to your site. The Google Analytics setup process is straightforward—refer to Google’s step-by-step instructions. You will come to a point in the process where you “create a stream,” after which Google offers instructions for manual installation or adding to website builders, including instructions for Squarespace.
The methods for adding a Google tag to Squarespace are different for tag IDs starting with "G-" (created via Google Analytics) versus tag IDs starting with "AW-" (created via Google Ads). The two easy methods are:
1. Squarespace Built-in Integration
This can be used with a tag ID that starts with "G-". And if you have a store that uses Google’s eCommerce tracking, Squarespace will automatically send information such as Order ID, Total, and Product Name to Google Analytics for each order.
Install Google Analytics via the Squarespace integration: copy your GA4 tag (G-XXXXXXXX) to your clipboard, then on Squarespace, visit Settings > Developer Tools > External API Keys, paste the tag ID here and click save.
2. Code Injection
If using an "AW-" ID, or if preferred for a "G-" ID, you can install the code manually. Code injection is available on the Squarespace Business Plan or higher, learn about Squarespace pricing plans for more information. Note, do not use both the built-in integration above and this code injection method at the same time.
Install a Google tag via code injection: copy the entire Google tag (gtag.js) to your clipboard, then on Squarespace, visit Website > scroll down, Website Tools > Code Injection > paste the code under Header and click save.
Note, you can also use Google Tag Manager, these tag IDs start with "GT-", but advanced GTM setup is rarely used by the average DIY small business on Squarespace.
Next Steps
Verify data: After adding a Google tag, it can take up to 30 minutes for data collection to start—use the GA4 Realtime report to verify you’re receiving data.
Filter internal traffic: Remember to exclude your team’s traffic. You can find your current IP address by searching “what is my IP” on Google.
Link other Google accounts: You can integrate other Google products such as Ads, Search Console, or Merchant Center with Google Analytics.