Implementing Google Tag Manager (GTM) on a Squarespace site allows you to manage and deploy various marketing tags, such as Google Analytics, Facebook Pixel, and Google Ads, without having to modify the site’s code directly. Here’s how to set up Google Tag Manager on a Squarespace site:
Step 1: Create a Google Tag Manager Account
- Sign up for Google Tag Manager:
- Go to Google Tag Manager.
- If you don’t have an account, click on Create Account.
- Enter your account name and container name (typically your website name or domain).
- Choose Web as the platform and click Create.
- Agree to the terms of service.
- Get the GTM Container Code:
- After the account and container are created, Google Tag Manager will give you a container code snippet.
- The code consists of two parts:
- The first part goes in the
<head>
section. - The second part goes immediately after the opening
<body>
tag.
- The first part goes in the
Step 2: Install Google Tag Manager on Your Squarespace Site
To implement Google Tag Manager, you need to add the GTM container code snippets to the appropriate places on your Squarespace site. Here’s how to do that:
Method 1: Using the Code Injection Feature
- Log in to Your Squarespace Account:
- Open your Squarespace site and log in to the admin dashboard.
- Navigate to Settings:
- In the left sidebar, click Settings.
- Access Code Injection:
- Under the Advanced section, click on Code Injection. This is where you can insert custom code into your site’s header and body.
- Add the GTM Snippet to the Header:
- In the Header field, paste the first part of the Google Tag Manager code (the
<script>
code that goes in the<head>
section).
- In the Header field, paste the first part of the Google Tag Manager code (the
- Add the GTM Snippet to the Body:
- In the Footer field, paste the second part of the GTM code (the
<noscript>
code that should go immediately after the opening<body>
tag).
- In the Footer field, paste the second part of the GTM code (the
- Save Changes:
- Once you have added both code snippets, click Save to apply the changes.
Step 3: Verify the GTM Installation
After you’ve implemented the GTM container on your Squarespace site, you should verify that it’s installed correctly.
- Use Google Tag Assistant (Chrome Extension):
- Install the Tag Assistant Chrome extension.
- Open your Squarespace site and enable Tag Assistant to verify that the GTM container is firing.
- Use GTM Preview Mode:
- Go to your Google Tag Manager account and click on Preview.
- Enter your Squarespace URL to start the preview mode.
- Once the preview mode is activated, visit your website and the GTM debug console should appear at the bottom of the screen. This will show you which tags are firing and when.
- Check Source Code:
- On your Squarespace site, right-click and select View Page Source.
- Ensure that the GTM snippets are visible in the
<head>
and just after the opening<body>
tag.
Step 4: Set Up Tags, Triggers, and Variables in Google Tag Manager
Once GTM is installed on your Squarespace site, you can start creating tags, triggers, and variables. Some common tags you might set up include:
Google Analytics Tag
- Create a Tag for Google Analytics:
- In GTM, go to the Tags section and click New.
- Select Google Analytics: Universal Analytics (or GA4 if you’re using the new version).
- Choose Page View as the track type.
- Enter your Google Analytics Tracking ID.
- Set the Trigger:
- For the trigger, select All Pages to fire the tag on every page load.
- Save and Test:
- Save the tag and use the GTM preview mode to test if the tag fires correctly.
Facebook Pixel Tag
- Create a Facebook Pixel Tag:
- In GTM, create a new tag and select Custom HTML.
- Paste the Facebook Pixel tracking code into the tag.
- Add a trigger to fire this tag on the relevant pages (e.g., all pages or a specific page like the checkout page for conversion tracking).
Google Ads Conversion Tracking Tag
- Create a Google Ads Conversion Tag:
- In GTM, create a new tag and select Google Ads Conversion Tracking.
- Enter the Conversion ID and Conversion Label from your Google Ads account.
- Set the trigger to fire when a specific event occurs, such as a form submission or a transaction.
Step 5: Publish Your Tags
After you’ve configured your tags and triggers in Google Tag Manager, make sure to publish your changes:
- Click on Submit in GTM:
- After testing your tags, click on the Submit button in Google Tag Manager.
- Add a version name and description for the change (e.g., “Initial setup for Squarespace site”).
- Click Publish to make the changes live.
Step 6: Test and Monitor
It’s important to test all your tags and ensure they are firing correctly on your Squarespace site. Here are some tools to help with that:
- Google Tag Assistant (Chrome Extension): This extension allows you to see which tags are active and firing on your website.
- Google Tag Manager Preview Mode: This allows you to debug your tags and see the triggers and events in real time.
- Google Analytics Real-Time Reporting: If you’ve set up Google Analytics, you can use its real-time reports to check whether page views and other events are being tracked.
Step 7: Maintain and Update Tags
Once GTM is set up and working on your Squarespace site, you can use it to easily manage and update your tags as your marketing needs change. For example, you can:
- Add new tracking codes for additional services like Hotjar or Crazy Egg.
- Set up custom events for tracking user actions such as button clicks or form submissions.
- Use triggers and variables to control when and where tags fire.
Conclusion
Implementing Google Tag Manager on your Squarespace site allows you to manage marketing tags efficiently without having to modify your site’s code every time you want to add a new tag or tracking code. By using the Code Injection feature in Squarespace, you can easily install GTM and start tracking user interactions on your site. Once implemented, GTM provides a powerful platform to manage tags for Google Analytics, Facebook Pixel, Google Ads, and more, making it easier to track and optimize your marketing efforts.