3 Ways To Install Google Analytics To Your Squarespace Site
Squarespace is a great option to create yourself a new website. And once you created your website you would want to add Google Analytics to it.
This article gives you the 3 options of how to do this.
I highly recommend adding Google Analytics 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:
In the home menu, click Settings, and then click Advanced.
Click External Services.
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 that you have more flexibility to make changes to your code snippet in the future.
To do this:
In the home menu navigate to Settings > Advanced > Code Injection.
Copy+paste the entire Google Analytics’ Global Site Tag into the Header field.
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:
Login to Squarespace and from the home menu navigate to Settings > Advanced > Code Injection.
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),
<!-- 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.
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
And that’s it, you’re ready to start tracking your Squarespace website.
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.