Skip to main content

Adding Google Tag Manager to Your Website

Before you can track bookings on your website, you need to install Google Tag Manager. This is a one-time setup that takes about 5 minutes.

Aaron Bird avatar
Written by Aaron Bird
Updated over 3 weeks ago

What This Guide Covers

Google Tag Manager (GTM) is a free tool from Google that makes it easy to add tracking codes to your website without editing code every time. You'll install it once, and then you can set up tracking for bookings, ads, and other tools through the GTM interface.

Time to complete: 5-10 minutes

You'll need:

  • Access to edit your website's code (or access to your website developer)

  • A Google account


Step 1: Create a Google Tag Manager Account

If you already have a GTM account, skip to Step 2.

  1. Click "Create Account"

  2. Account Setup:

    • Account Name: Your company name (e.g., "Acme Events Ltd")

    • Country: Select your country

    • Check the boxes to agree to terms

    • Click "Continue"

  3. Container Setup:

    • Container Name: Your website URL (e.g., "acmeevents.com")

    • Target Platform: Select "Web"

    • Click "Create"

  4. Accept the Terms of Service

  5. You'll see a screen with two code snippets - keep this open!


Step 2: Get Your GTM Container Code

If you just created an account, the code is already showing. Otherwise:

  1. In Google Tag Manager, click Admin (gear icon, bottom left)

  2. Click "Install Google Tag Manager" at the top

  3. You'll see two code snippets

Your GTM Container ID will look like: GTM-XXXXXX


Step 3: Install GTM on Your Website

You need to add two pieces of code to every page of your website.

Code Snippet 1: In the <head> section

Copy this code and paste it as high in the <head> of every page as possible:

html

<!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-XXXXXX');</script> <!-- End Google Tag Manager -->

Replace GTM-XXXXXX with your actual Container ID


Code Snippet 2: In the <body> section

Copy this code and paste it immediately after the opening <body> tag on every page:

<!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXX" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) -->


Installation Methods by Platform

WordPress

Option 1: Using a Plugin (Easiest)

  1. Install the "Google Tag Manager for WordPress" plugin by Thomas Geiger

  2. Go to SettingsGoogle Tag Manager

  3. Enter your Container ID (e.g., GTM-XXXXXX)

  4. Save changes

Option 2: Editing Your Theme

  1. Go to AppearanceTheme File Editor

  2. Find header.php

  3. Paste the first code snippet before </head>

  4. Paste the second code snippet after <body>

  5. Click Update File


Shopify

  1. Go to Online StoreThemes

  2. Click ActionsEdit code

  3. Open theme.liquid

  4. Paste the first code snippet before </head>

  5. Paste the second code snippet after <body>

  6. Click Save


Wix

  1. Go to SettingsCustom Code

  2. Click + Add Custom Code

  3. Paste the first code snippet

  4. Place code in: Head

  5. Apply to: All pages

  6. Click Apply

Wix doesn't support the <body> snippet, but the <head> snippet alone will work for most tracking.


Squarespace

  1. Go to SettingsAdvancedCode Injection

  2. Paste the first code snippet in the Header section

  3. Paste the second code snippet in the Footer section (Squarespace limitation)

  4. Click Save


HTML/Custom Website

If you have a custom-built website:

  1. Open your website's main template file (often header.php, index.html, or similar)

  2. Paste the first code snippet in the <head> section

  3. Paste the second code snippet after the <body> tag

  4. Upload the file to your web server

  5. Repeat for all template files if you have multiple

Not sure how to do this? Contact your web developer and send them this guide.


Step 4: Verify GTM is Installed

Method 1: Google Tag Assistant (Recommended)

  1. Install the "Tag Assistant Legacy" Chrome extension

  2. Visit your website

  3. Click the extension icon

  4. You should see your GTM container listed (e.g., "GTM-XXXXXX")

  5. Status should show "Working" with a green checkmark ✅


Method 2: View Page Source

  1. Visit your website

  2. Right-click → View Page Source

  3. Press Ctrl+F (or Cmd+F on Mac)

  4. Search for: GTM-

  5. You should see your GTM container code


Method 3: GTM Preview Mode

  1. In Google Tag Manager, click Preview (top right)

  2. Enter your website URL

  3. Click Connect

  4. If GTM is installed correctly, you'll see a debug panel at the bottom of your website


Troubleshooting

Tag Assistant shows GTM is not working


Check these:

  1. Did you paste both code snippets? (head AND body)

  2. Did you replace GTM-XXXXXX with your actual Container ID?

  3. Did you clear your browser cache? (Try in an Incognito window)

  4. Did you upload the changes to your live website?

I don't have access to edit my website code

Contact your web developer and send them:

  • This guide

  • Your GTM Container ID

  • Ask them to install Google Tag Manager using the official snippets

Most developers are familiar with GTM and can install it in 5-10 minutes.

My website platform isn't listed above

GTM works with any website. The installation is the same - you just need to find where to edit your site's header and body sections. Check your platform's documentation for "adding custom code" or "editing HTML."

Common platforms:

  • Webflow: Settings → Custom Code

  • Joomla: Extensions → Templates → Edit template

  • Drupal: Structure → Blocks → Add custom block

  • Magento: Content → Design → Configuration → HTML Head / Footer


Next Steps

GTM is now installed on your website!

Continue to: Track Event Bookings with Google Analytics 4 to set up booking conversion tracking.


Support

Need help installing GTM?

  • 💬 Live Chat: Contact

  • 🗓️ Book A Meeting: Book a meeting with one of our experts

  • 📚 Google's Official Guide: Install Google Tag Manager

Did this answer your question?