Google Analytics is one of the best free tools for understanding how visitors interact with your Squarespace website. It shows you where your traffic comes from, which pages perform best, how long people stay, and where they drop off.
Setting it up on Squarespace takes just a few minutes. Below is a full walkthrough of where to enter your tracking code and how to confirm everything is working correctly.
What Is the Google Analytics Tracking Code?
The Google Analytics tracking code is a unique identifier tied to your Google Analytics account and website. For GA4 (Google Analytics 4), the code starts with "G-" followed by a string of letters and numbers. This Measurement ID tells Google which Analytics property should receive data from your site.
Each Squarespace site can only have one Google Analytics ID installed at a time. Squarespace has the necessary tracking scripts built into its platform, so you do not need to paste any JavaScript code manually. You just enter the Measurement ID in the right settings field.
![]()
How Long Does It Take for Google Analytics to Start Working?
Once you add your Measurement ID to Squarespace, data usually appears in your Google Analytics dashboard within 24 hours. The Realtime report will show activity almost immediately if someone is browsing your site at that moment.
Google Analytics cannot pull in historical data from before installation. It only tracks visits that happen after the code is active. Also keep in mind that your own browsing activity will be recorded unless you set up a filter (covered below).
How to Add Google Analytics to Squarespace (Step by Step)
Follow these steps to connect Google Analytics to your Squarespace website:
- Log in to your Squarespace dashboard
- Click Settings in the left-hand menu
- Click Advanced
- Click External API Keys
- Find the field labeled Google Analytics
- Paste your GA4 Measurement ID (starts with "G-") into this field
- Click Save
That is all you need to do on the Squarespace side. Data will begin populating in your Google Analytics account within 24 hours.
Creating a Google Analytics Account (If You Do Not Have One)
If you have not set up Google Analytics yet, go to analytics.google.com and sign in with your Google account. Click Start Measuring and follow the prompts to create an account and property. Google will generate your GA4 Measurement ID at the end of the setup process. Copy this ID for use in Squarespace.
Make sure you select "Web" as your platform type when creating the data stream. The Measurement ID will be displayed on the data stream details page.
Verifying That Google Analytics Is Working
After adding the Measurement ID to Squarespace, open your Google Analytics account and go to Reports > Realtime. Open your Squarespace site in another browser tab and browse a few pages. If the Realtime report shows active users, the integration is working correctly.
If you see zero users after several minutes, double-check that you entered the correct Measurement ID and that you clicked Save in Squarespace. Also make sure there are no ad blockers or browser extensions interfering with the tracking script.
Tips for Getting Accurate Data
Verify Your Measurement ID Format
GA4 Measurement IDs start with "G-" (for example, G-ABC123DEF4). The older Universal Analytics format started with "UA-" but Google has fully transitioned to GA4. If you still have an old UA code, you will need to create a new GA4 property in your Google Analytics account.
Exclude Your Own Visits
Your own browsing can skew your analytics data, especially on smaller sites. To filter out internal traffic in GA4, go to Admin > Data Streams > your stream > Configure Tag Settings > Define Internal Traffic. Add your IP address so your visits are not counted in reports.
Check Data Accuracy Regularly
After setup, periodically check that your tracking is still working. Compare the Realtime report with actual site activity. Look at traffic sources and page views to make sure they match your expectations. Catching discrepancies early prevents months of unreliable data.
Frequently Asked Questions
Where exactly do I put the Google Analytics code in Squarespace?
Do I need to add any JavaScript code to Squarespace for Google Analytics?
Can I use Google Analytics 4 (GA4) with Squarespace?
How long does it take for Google Analytics to show data from Squarespace?
Why is Google Analytics not tracking my Squarespace site?
Can I use Google Analytics and Squarespace Analytics at the same time?
How do I exclude my own traffic from Google Analytics on Squarespace?
* Read the rest of the post and open up an offer