Using Google Analytics with Squarespace

Install a tracking ID on your site to gather and analyze traffic data.

Last updated December 11, 2024

Use our built-in integration to connect your site to Google Analytics for visitor tracking and other reporting.

Note

This is a built-in integration with Google Analytics. If you use this option, you don't need to add separate script code.

Tip

Register for our Uncover Customer Trends with Squarespace Analytics webinar where we’ll teach you how to use our built-in reporting platform. You’ll learn how to review key performance indicators, connect Google Analytics and Google Search Console to your site, and use analytics data to track how your business is doing and identify opportunities for growth.

Before you begin

Note

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 go through the setup steps below using your Google Analytics 4 Measurement ID.

Add your Google Analytics measurement ID

To connect Google Analytics to your site, add the tracking code for your Google Analytics property to your site. Your code starts with G- and is known as a measurement ID.

To add your measurement ID to your site:

  1. Open the Developer tools panel.
  2. Click External API keys.
  3. In the Google Analytics account number field, enter your measurement ID.
  4. Click Save.

It may take up to 24 hours for site statistics to populate in Google Analytics.

With Google’s consent mode, you can communicate your visitors’ consent choices to Google.

To use consent mode with your Squarespace site:

  1. Add your Google Analytics measurement ID.
  2. Enable your cookie banner by opening the Cookies & Visitor Data panel and switching on the toggle beside Cookie banner.
  3. Select the Opt in & out cookie banner type, which displays two customizable buttons for customers to accept or decline your site’s cookies, then click Save.
  4. (Optional) Click Customize to edit your cookie banner text. 
  5. Click Save.

Note

Consent mode is a feature provided by Google. To learn more, visit Google's documentation.

Hide your activity

Every time you preview a page when you're logged in, Google Analytics registers it as a pageview. If you don't want data from your visits mixed in with data from visitors, you can create a filter in Google Analytics to exclude your IP address. For help finding your IP address, see Google's documentation.

Conversion tracking

If you're using Google Analytics to track conversions for your ecommerce store, Squarespace sends the following information to Google Analytics for every received order:

  • Order ID
  • Your store name
  • Purchase total (includes shipping)
  • Customer's city, region, and country
  • Product name
  • SKU

For more help, visit Google's documentation.

Disconnect Google Analytics

To disconnect Google Analytics:

  1. Open the Developer tools panel.
  2. Click External API keys.
  3. In the Google Analytics account number field, delete your measurement ID.
  4. Click Save.

Differences between Squarespace and Google Analytics

There are always variations between any two analytics platforms based on how each platform is built to calculate results.

Counting internal traffic when logged in

Squarespace doesn’t count internal traffic when you’re logged in. Google Analytics does, but you can set up a filter to exclude certain IP addresses.

Filtering bots and non-human activity

Squarespace and Google Analytics have different measures for filtering non-human traffic like crawlers and bots.

Rounding numbers based on sample data

In Squarespace, numbers are always calculated 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 documentation.

Tracking Commerce conversion

Some Squarespace users who track sales in both platforms have reported that Google Analytics occasionally misses some orders.

Attributing traffic to a source

In Traffic sources, we identify a referrer based on a visitor’s last click. Google has a similar tracking method with some exceptions. As a result of these differences, direct traffic numbers in Squarespace analytics might be greater than what you’ll see in Google Analytics.

Note

In Google Analytics, you might see traffic coming from a URL ending in /?sqsscreenshot=true, which you can disregard. The traffic comes from a tool that creates the site's screenshot in your Account Dashboard.

Recording location data

In Geography, we identify visitors by location. Google has a similar tracking method, but due to differences in the way each service records IP addresses, you may see discrepancies between locations on Squarespace analytics and Google Analytics.

Ajax loading and Google Analytics

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. To avoid this issue, disable Ajax loading for your site.

Footer Image
  • Get help from our community

  • Get help from our community on advanced customizations.

  • Hire a Squarespace Expert

  • Stand out online with the help of an experienced designer or developer.

Using Google Analytics with Squarespace