SS
Squarespace Sites
← All Answers
SEO

How do I add Google Analytics to Squarespace?

Step-by-step guide to connecting Google Analytics 4 (GA4) to your Squarespace website for tracking visitors, conversions, and marketing performance.

To add Google Analytics 4 to Squarespace, first create a GA4 property in your Google Analytics account at analytics.google.com. During setup, you will receive a Measurement ID that starts with G- followed by a string of characters. Copy this ID. In your Squarespace dashboard, go to Settings, then External API Keys (under Advanced), and paste the Measurement ID into the Google Analytics field. Squarespace will automatically add the GA4 tracking code to every page of your site.

For more advanced tracking, you can add the GA4 script manually through code injection. Go to Settings, then Advanced, then Code Injection, and paste the Google tag (gtag.js) script into the Header section. This method gives you more control and lets you add custom event tracking, but for most small businesses, the built-in integration through the External API Keys section is simpler and works perfectly well.

After connecting GA4, verify it is working by visiting your site and checking the Realtime report in Google Analytics. You should see your visit appear within a few seconds. Common issues include ad blockers preventing the tracking script from loading (test in an incognito window), caching delays on Squarespace (wait 10 minutes after adding the ID), and accidentally adding the tracking code in both the External API Keys section and Code Injection, which causes duplicate tracking.

Related Questions

Ready to build your website?

Browse our collection of premium Squarespace templates designed specifically for service businesses.

Browse Templates