Paste your GA4 measurement ID into Squarespace at Settings → Developer Tools → External API Keys → Google Analytics account number, then click Save. Once it is saved, Squarespace says "you don't need to add separate script code." This is separate from Code Injection, where a tool like Google Tag Manager would go.
What do I need before I start?
A Google Analytics 4 property and its measurement ID. Squarespace says: "Your code starts with G- and is known as a measurement ID" (Squarespace, "Using Google Analytics with Squarespace"). In your GA4 property, the ID lives under Admin → Data Streams, in your data stream's details, where you "copy the Measurement ID (starts with 'G-' or 'AW-')" (Google Analytics Help, "About tracking [Google tag ID]"). If you have no GA4 property yet, Squarespace's guide points you to sign up for one first.
Squarespace supports only the current version of Google Analytics: "As of July 1, 2023, Google will only support Google Analytics 4. If you set up your integration with an older version of Google Analytics, you'll need [to] go through the setup steps below using your Google Analytics 4 Measurement ID." A leftover Universal Analytics property ID does nothing here.
How do I add my GA4 measurement ID to Squarespace?
Squarespace's steps:
- Open the Developer Tools panel.
- Click External API Keys.
- In the Google Analytics account number field, enter your measurement ID.
- Click Save.
"It may take up to 24 hours for site statistics to populate in Google Analytics." An empty GA4 report in the first few hours does not mean the connection is broken.
Is this the same as Squarespace Analytics?
No. This guide wires your site to an outside GA4 property. Squarespace's built-in reporting (Traffic, Traffic sources, Search keywords, Sales and the other panels in your dashboard) is a separate system that does not require GA4 and works as soon as your site has visitors. Our guide to what Squarespace Analytics shows covers each built-in panel, which are gated by plan, and how far back the data goes.
Connecting GA4 gives you a second, independent set of numbers in Google's tools. It does not feed into or replace Squarespace's panels, and Squarespace says "there are always variations between any two analytics platforms based on how each platform is built to calculate results," so do not expect the two to match exactly.
Should I use Code Injection instead of the built-in field?
Not for GA4, but possibly for a related tool. Squarespace's guide says: "This is a built-in integration with Google Analytics. If you use this option, you don't need to add separate script code. Other code-based solutions, like Google Tag Manager, fall outside the scope of our support." The External API Keys field is the supported path for a GA4 measurement ID. Google Tag Manager or any other script-based tracking tool goes in Code Injection's header field, which has its own plan requirement and limits. Our guide to Squarespace Code Injection covers where each field injects code, which plans include it, and where it does not work (checkout pages, for one).
What does the built-in connection do besides send pageviews?
Three things:
- Consent mode. If you enable your site's cookie banner (Settings → Cookies and Data Privacy) and turn on the "Decline all" button, Squarespace can pass visitor consent choices to Google through Google's consent mode, once your measurement ID is connected.
- Ecommerce conversion data. For a Squarespace store, Squarespace sends Google Analytics a defined set of order details on every purchase: order ID, store name, purchase total (including shipping), the customer's city, region and country, product name, and SKU.
- Excluding your own visits. Squarespace does not count your own logged-in pageviews in its Analytics, but Google Analytics does. Squarespace's guide points you to set up an IP-address filter inside Google Analytics to exclude your own traffic there.
Why don't the two platforms' numbers match?
Squarespace's help page lists these documented differences:
- Cookie-declined visitors
- when a visitor does not accept analytics cookies, "Squarespace analytics may inflate visitor numbers because we can't track those visitors' behaviors," for example counting one 10-page visit as ten separate visitors. Google Analytics uses behavioral modeling to estimate untracked behavior instead.
- Bot filtering
- the two platforms "have different measures for filtering non-human traffic like crawlers and bots."
- Sampling
- Squarespace calculates "from your full visitor activity, no matter your audience size," while "some numbers [in Google Analytics] may be estimates based on a sample of visitors."
- Referrer attribution
- both attribute a visit to a referrer based on the visitor's last click, "with some exceptions," which Squarespace says can make its direct-traffic numbers higher than Google's.
- A traffic-source artifact
- a URL ending in
/?sqsscreenshot=trueshowing as a traffic source in Google Analytics is Squarespace's own account-dashboard screenshot tool and can be disregarded.
What if my site is on version 7.0 with Ajax loading?
Google Analytics under-counts your traffic. Squarespace says: "If you have a version 7.0 site and your template uses Ajax loading, Google Analytics won't register all of your site traffic. Ajax interferes with site analytics, only logging the first page a visitor lands on. As the visitor then navigates around your site, Analytics won't record their traffic unless they refresh the page." The fix: "To avoid this issue, disable Ajax loading for your site." If your GA4 numbers look far lower than Squarespace's Traffic panel for the same period, check for an Ajax-loading 7.0 template first.
How do I disconnect Google Analytics?
Open the Developer Tools panel, click External API Keys, delete the measurement ID from the Google Analytics account number field, and click Save. There is no separate disconnect button. Clearing the field removes the connection.