Connect Google Analytics to your site
- Connect Google Analytics to your site
- Add your Google Analytics measurement ID to your site to track visitors, traffic sources, and store conversions.
- Add your Google Analytics measurement ID
- Collect visitor cookie consent for Google Analytics
- Hide your own visits from Google Analytics
- What order data we send to Google Analytics
- Disconnect Google Analytics
- My numbers in Squarespace and Google don’t match
- My own visits appear only in Google Analytics
- Do cookie choices inflate Squarespace visitor counts?
- Why does bot traffic differs between platforms?
- Why are some Google Analytics numbers are estimates?
- Why direct traffic is higher in Squarespace analytics
- Why don't my visitor locations match?
- Why Ajax loading breaks Google Analytics tracking (version 7.0)
- Get more help with Google Analytics
false
Connect Google Analytics to your site
Last updated October 14, 2026 22:26
Add your Google Analytics measurement ID to your site to track visitors, traffic sources, and store conversions.
Connect your site to Google Analytics to track visitors, traffic sources, and sales. Our built-in integration does this without any script code.
Note: You can still use code-based solutions like Google Tag Manager, but we can't help you set them up or troubleshoot them. For help, visit the Squarespace forum or hire a Squarespace Expert.
Add your Google Analytics measurement ID
To connect Google Analytics, add your property's measurement ID to your site. Measurement IDs start with G- and come from a Google Analytics 4 property. If you connected an older version of Google Analytics, replace your old ID with your Google Analytics 4 measurement ID.
To add your measurement ID:
- If you don't have one, create a Google Analytics account.
- Open the Developer tools panel.
- Click External API keys.
- In the [Google Analytics account number] field, enter your measurement ID.
- Click Save. Statistics can take up to 24 hours to appear in Google Analytics.
Collect visitor cookie consent for Google Analytics
With Google's consent mode, you can share your visitors' cookie consent choices with Google. Google manages consent mode, so for details on how it handles that data, visit Google's consent mode documentation.
To configure your Squarespace site to require consent for Google Analytics and similar cookies:
- Add your Google Analytics measurement ID.
- Open the Cookies and Data Privacy panel, then switch on the toggle beside Cookie banner.
- Switch on the toggle beside Manage cookies button to ensure that non-essential cookies like Google Analytics will not be placed on site visitor devices unless the visitor consents. You may also wish to enable the Decline All button to make it easy for site visitors to quickly decline all non-essential cookies.
- (Optional) To edit your cookie banner and button text, use the Disclaimer text Manage button label, or Decline button label fields.
- Click Save.
Note:
- This applies to sites using Squarespace’s cookie banner. If you’re using a third-party consent management platform, work directly with your cookie banner provider.
- Learn more about Squarespace’s cookie banner and consent functionality.
Hide your own visits from Google Analytics
Google Analytics counts your own page previews as pageviews while you're logged in. To keep your visits out of your reports, create a filter in Google Analytics to exclude your IP address. To find your IP address, visit Google's documentation.
What order data we send to Google Analytics
If you track ecommerce conversions in Google Analytics, we send this data for every order:
- Customer's city, region, and country
- Order ID
- Product name
- Purchase total (includes shipping)
- SKU
- Your store name
To set up conversion tracking on Google's end, visit Google's ecommerce measurement documentation.
Disconnect Google Analytics
To disconnect Google Analytics:
- Open the Developer tools panel.
- Click External API keys.
- In the [Google Analytics account number] field, delete your measurement ID.
- Click Save.
My numbers in Squarespace and Google don’t match
Analytics platforms calculate results differently, so your Squarespace and Google Analytics numbers won't match exactly.
My own visits appear only in Google Analytics
We don't count internal traffic while you're logged in, and Google Analytics does. To exclude yourself, hide your own visits from Google Analytics.
Do cookie choices inflate Squarespace visitor counts?
Yes. When visitors don't accept analytics and performance cookies, we can't track their behavior, so Squarespace analytics may inflate visitor numbers. For example, Squarespace analytics counts one visitor who views ten pages as ten separate visitors.
Google Analytics fills these gaps with behavioral modeling, which uses data from tracked visitors to estimate the behavior of untracked ones. If you enable your cookie banner or restrict non-essential cookies, visitor numbers may be much higher in Squarespace analytics than in Google Analytics.
Why does bot traffic differs between platforms?
We and Google Analytics use different measures to filter non-human traffic like crawlers and bots.
Why are some Google Analytics numbers are estimates?
In Squarespace analytics, numbers always come from your full visitor activity, no matter your audience size. In Google Analytics, some numbers may be estimates based on a sample of visitors. Learn more in Google's data sampling documentation.
Why direct traffic is higher in Squarespace analytics
In Traffic sources, we identify a referrer based on a visitor's last click. Google uses a similar method with some exceptions, so direct traffic numbers in Squarespace analytics might be higher than in Google Analytics.
In Google Analytics, you might also see traffic from a URL ending in /?sqsscreenshot=true, which you can disregard. That traffic comes from the tool that creates your site's screenshot in your Account Dashboard.
Why don't my visitor locations match?
In Geography, we identify visitors by location. Google uses a similar method, but because each service records IP addresses differently, locations may not match.
Why Ajax loading breaks Google Analytics tracking (version 7.0)
If your version 7.0 site uses Ajax loading, Google Analytics only logs the first page a visitor lands on. It doesn't record the rest of their visit unless they refresh the page. To fix this, disable Ajax loading.
Get more help with Google Analytics
For issues with Google Analytics itself, like reporting, property settings, or data discrepancies inside Google Analytics, visit Google Analytics Help or contact Google.
Was this article helpful?
Yes No
2361 out of 3150 found this helpful
Yes No
Connect Google Analytics to your site
