How to add Google Tag Manager to Squarespace (2024 Guide)
Need to add tracking codes to your website quickly?
Google Tag Manager lets you add, manage, and amend tracking for Google Analytics and Google Ads, as well as third-party tools like Crazy Egg, Hotjar, and Salesforce. You can also set permissions so that different people have different levels of access.
If you want to add Google Tag Manager to your Squarespace site, it’s really easy to do. Here’s how to install Google Tag Manager on Squarespace in three simple steps.
Step 1: Create a Google Tag Manager account
Before you begin, you need a Google Tag Manager account. Google Tag Manager will ask you to provide details about the website you want to track. Click Create when done and accept the terms of the service agreement.
Once you’ve accepted, a pop-up will appear with two pieces of code, which you need to add to your Squarespace site. Copy and paste the first piece of code (the <head> code) into Notepad for safekeeping.
Don’t worry about the second box of code; you don’t need this for Squarespace.
(If you accidentally close this pop-up, don’t worry. Go to Admin and Install Google Tag Manager, and you can get the code from there.)
Step 2: Add your Google Tag Manager code to Squarespace
Go to the Squarespace site you want to add your code to. Go to Website, Pages, and scroll down to the bottom until you see Website Tools.
Click on Code Injection. At the top of the section you’ll see a box called Header. By pasting your Google Tag Manager code in the Header box, you’ll be adding the code to every page on your Squarespace site.
If there is already code in the header box, add the Google Tag Manager code to the bottom of the box – don’t delete what’s already there.
Click back to Website Tools when done.
If you have already installed Google Analytics on your website, there is one final step.
If you will be moving your Google Analytics account to Google Tag Manager, you’ll need to remove the Google Analytics API from your Squarespace settings. This is to ensure accuracy and that Google Analytics doesn’t count metrics twice.
Go to Settings, Developer Tools and External API keys. Delete the ID from the Google Analytics box and click Save when done.
Step 3: Test your Google Tag Manager account
Go back to your Google Tag Manager account, click Admin and Install Google Tag Manager. If you enter your website URL in the bottom box and click Test, Google Tag Manager will test your site to see if it can find the code.
If it can find it, well done! You’ve successfully added Google Tag Manager to Squarespace! You can now start adding tags and triggers to your account. Here are some of our favorite guides to get started: