Website Tracking

3 Ways To Install Google Analytics To Your Squarespace Site

Squarespace is a great option to create a new website. And once you created your website you would want to add the Global Site Tage of Google Analytics to it.

This article gives you the 3 options of how to do this.

I highly recommend adding the Google Analytics Global Site Tag to your site via Google Tag Manager, which is option 3 below.

Option 1 (the easy way): using the built-in option within Squarespace

Squarespace has an integrated way to install Google Analytics.

It is very straightforward to install this:

  1. In the home menu, click Settings, and then click Advanced.
  2. Click External Services.
  3. In the Google Analytics Account Number box, enter your tracking ID for this site.

To locate your Google Analytics tracking ID, login to your Google Analytics account and go to Admin > Property > Tracking Info > Tracking Code. The Google Analytics tracking ID looks like UA-XXXXXXXX-X.

Option 2 (the advanced way): adding the entire snippet to Squarespace

Squarespace also has the option to add the entire Google Analytics snippet into the header of your webpage. The benefit of this option is that you have more flexibility to make changes to your code snippet in the future.

To do this:

  1. In the home menu navigate to Settings > Advanced > Code Injection.
  2. Copy+paste the entire Google Analytics’ Global Site Tag into the Header field.

To locate your Global Site Tag, log in to your Google Analytics account and go to Admin > Property > Tracking Info > Tracking Code.

Screenshot of code injection page on Squarespace.

Option 3 (the recommended way): using Google Tag Manager

Google Tag Manager (GTM) is a free tool that makes it easier to add and update tracking tags within your website.

It’s recommended to use Google Tag Manager for all the tags on your site, including Google Analytics. It will make your life a lot easier going forward, and it potentially could also speed up your site. Also, it will allow you to track additional things on your site (like outgoing links, Youtube videos etc.).

Follow the steps in this article first to create a GTM account and install Google Analytics.

Then, to add the GTM code to your Squarespace site follow the steps below:

  1. Log in to Squarespace and from the home menu navigate to Settings > Advanced > Code Injection. 
  2. Replace GTM-XXXXXXXX for the code below with your GTM container ID. You can find this by logging into GTM. Copy and paste the code below into the ‘Header’ on the ‘Code Injection’ page. 
<!-- Google Tag Manager -->


new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],




<!-- End Google Tag Manager -->

Then, replace GTM-XXXXXXXX for the code below with your GTM container ID. Then copy and paste the code below into the ‘Footer’ on the ‘Code Injection’ page.

<noscript><iframe src="'GTM-XXXXXXX'"

height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>

And that’s it, you’re ready to start tracking your Squarespace website.

Squarespace website tracking FAQ

How do I add Google Analytics to Squarespace?

There are different ways to add Google Analytics to your Squarespace website. Read our article for step-by-step instructions on how to do this.

What is Google Analytics?

Google Analytics is a free web analytics tool that can give you most of the information you need to optimise your website. It’s the most popular web analytics tool around and is known to be easy to use and reliable. Made for small and medium-sized websites to give them an opportunity to track, analyse and improve their online presence.

How does Google Analytics work?

Google Analytics works based on a piece of tracking code that is being placed on every page of your website.

What are some of the benefits of Google Analytics?

See where your visitors are coming from. See which pages your visitors have visited. See how long your visitors spend on each page. Track key conversion points on your site.

Share this:

By Jeroen

Having worked as a PPC freelancer for many years, Jeroen helps businesses to get more results out of their online advertising budgets.

He is the founder of Vazooky Digital, a Google Ads agency in Sydney, Australia.

Leave a Reply

Your email address will not be published. Required fields are marked *