Connecting Google Analytics to your Squarespace website 2021
New Google Analytics 4 (GA4)
You now have the choice of getting an original Google Universal Analytics tag or a new Google Analytics 4 tag. That’s one too many options if you ask me. If you really want to be confused then check out the Squarespace help documents or even better read the Google support articles. Ha! No seriously, that wasn’t fun.
This blog post sets out:
why you should use a Google Analytics 4 tag (GA4)
a complete walkthrough of how to get a GA4 tag, and
how to install a GA4 tag on your Squarespace website
What is Google Analytics 4?
GA4 is the new iteration of Google Analytics released by Google in October 2020. The older UA will not be discontinued any time soon, however, at some point, all users will be required to switch to Google Analytics 4.
How is GA4 better than UA?
GA4 focuses on tracking events rather than tracking user sessions. Therefore, a deeper analysis based on what your user does on your site can be undertaken rather than just understanding how they came to your site.
More custom reports are available via the Analysis tab.
The one ID is used across a website and related apps. With UA a separate UA tag is required for each website and app.
What is Google Analytics used for?
Google Analytics provides insight into your site’s visitors, where they are located, how they found your site, what internal links they use, what your top page content is, and conversely what your worst performing pages are. You can see which device people used to browse your site and that information is handy to know where you should focus your website design efforts. If you run online campaigns you can use Google Analytics to track the success of each campaign.
Even if you don’t think you will use Google Analytics now, it’s worth putting in the time to set it up so that if you change your mind later, you will have historical data to work with.
Which Google Analytics tag should I use?
Google Analytics 4 or both! However, at this point (early 2021), you will need a Squarespace Business plan or above to use GA4.
If you already have a UA tag, then you should still get your GA4 tag sooner rather than later. You can have both tags installed on your website at the same time and tracking will run in parallel using both tags.
While UA won’t disappear anytime soon, it’s best to start collecting data on your new GA4 tag so that when UA is made redundant, you will have accumulated tracking history on the new GA4 property.
UA tag
If you remove your site’s UA tag, you will lose the historical information that your UA tag has accumulated. It is better to have both tags collect information in parallel so that you can make a seamless transition from UA to GA4 in the future without gaps in your data. Also, the new GA4 isn’t as feature-rich as UA yet, so you would be missing out if you put all your eggs in the new GA4.
How to get a Google Analytics 4 tag
Now that you know you need a GA4 tag, here is a step by step guide to get one AND install it on your Squarespace website.
Step 1: Sign up for a free Google Analytics account
Go to https://analytics.google.com/
Sign up for google analytics if you don’t already have an account. This is different from your Google Console, Google My Business or Gmail account, though you can sign up with the one Google user/email credentials to make it easy on yourself.
Step 2: Google Analytics Account setup
In the Account details field, enter your website name. You can decide your account data sharing settings. I like to keep Google as least intrusive as possible. Then click Next.
Step 3: Property setup
In the Property Name field, enter your website name. Set the correct time zone and currency for your location. Click Next.
Step 4: Business information
In my opinion, this screen is about Google wanting to know your objectives so that it can offer you some help (*cough* paid services) later. Enter the information, but don’t spend excess time pondering which check box to tick.
Step 5: Accept terms and conditions
Step 6: Email communication preferences
Choose your email preferences and press Save. Personally, I reject google’s attempts to spam me.
Step 7: Set up data stream
Enter your website’s URL and in the Stream name field, enter your website name. Click Create Stream.
Step 8: Web stream details
Stay with me. You’re so close now! Google is now showing you your website’s unique GA4 code. Grab the GA4 code snippet by clicking on the copy icon. This will add it to your clipboard.
Next we’re going to paste this into your websites code by going back to your Squarespace admin panel.
Step 9: Ignore Squarespace help documents *gasp*!
At the time of writing this in early 2021, the Squarespace settings in the Admin Console only allow for a UA tag.
This is not where you are going to enter your GA4 code. Instead, you will need to inject your GA code from Step 8 into your Site Code Header. Don’t sweat it. It’s not as daunting as it sounds.
Go to Settings>Advanced>Code Injections>Header.
Paste (Ctrl + V on Windows or Cmd + V on Mac) your code to Line 1. If there’s already something there, don’t worry everything else will move down rather than being overwritten.
If nothing changes after you Paste your code, go back to Step 8 and recopy your code from Google Analytics and try again.
Press save.
GA4 — excluding your own IP address
At this stage, GA4 properties cannot be filtered. This means that every time you open your website Google Analytics is also registering you as a site visitor. There’s nothing you can do about it at this stage, however, it’s a good thing to keep in mind if you’re trying to explain some data anomalies! Particularly in the early days of launching your site when you are looking at your website a lot :-)
Final words on GA4
Google Analytics takes up to 24 hours to show any data. It won’t show any historic data for site visits before the day you installed your GA4 code on your website.
Don’t forget… to meet your obligations of Privacy Laws, make sure your Privacy Policy is clear that you use GA4 to collect site traffic data and the reason why you do this.