How to Install Google Tag Manager on Your Website: Wordpress Drupal Wix & Others

How to Install Google Tag Manager on Your Website: Wordpress Drupal Wix & Others

A Step-by-Step Guide to Installing Google Tag Manager on Your Website

Why using Google Tag Manager?

In today's digital age, tracking user behavior on your website is essential for understanding your audience and optimizing your online presence. Google Tag Manager (GTM) simplifies this process by providing a centralized platform for managing and deploying various tracking codes and tags without the need for manual coding. In this article, we'll walk you through the process of installing Google Tag Manager on your website, empowering you to gain valuable insights into your website's performance.

How to install Google Tag Manager

How to Install Google Tag Manager

Here's a simple table outlining the steps to install Google Tag Manager on your website:

Step Description
1. Sign Up Visit the Google Tag Manager website and sign up for an account.
2. Create Container Create a container for your website within Google Tag Manager.
3. Get Container Code Copy the container snippet provided by Google Tag Manager.
4. Paste in <head> Paste the container snippet into the <head> section of your website's code.
5. Paste in <body> Paste the container snippet into the <body> section of your website's code.
6. Verify Installation Verify that Google Tag Manager is installed correctly using browser extensions or preview mode.
7. Add Tags Log in to your Google Tag Manager account and start adding tags and tracking scripts to your website.

This table provides a clear overview of the steps involved in installing Google Tag Manager, from signing up for an account to adding tags and tracking scripts to your website.

Let me add a couple more details on how to go about each of those steps in the table above to make it easier for you to follow every step.

Step 1: Sign Up for Google Tag Manager

The first step is to sign up for Google Tag Manager if you haven't already. Visit the Google Tag Manager website (tagmanager.google.com) and sign in with your Google account. If you don't have a Google account, you'll need to create one. Once logged in, click on the "Start for free" button and follow the prompts to create a new Google Tag Manager account.

Step 2: Create a Google Tag Manager Container

After signing up, you'll need to create a container for your website in Google Tag Manager. A container is a snippet of code that you'll add to your website to enable Google Tag Manager functionality. To create a container, click on the "Create Account" button and follow the on-screen instructions. You'll be prompted to enter details such as the container name, website URL, and select the target platform (Web).

Step 3: Install Google Tag Manager Code on Your Website

Once you've created a container, Google Tag Manager will provide you with a container snippet – a small piece of JavaScript code. Your Google Tag Manager tracking code should look like this below, except with a different value than "GTM-XXXXXXXX".

<!-- 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-XXXXXXXX');</script>
<!-- End Google Tag Manager -->

Copy this snippet and paste it into the <head> section of every page on your website, just after the opening <head> tag. This code allows Google Tag Manager to load and function correctly on your website.

There are some instances where you may only want to add your Google Tag Manager tracking code in some pages and not all of your website, or even on an external website. Just mind that in order for any of your Google Tag Manager implementations to work, your GTM tracking code MUST be present.

Where do I Find my Google Tag Manager tracking code?

Navigate to the Google Tag Manager container of interest and click on the blue hyperlink with text outlining "GTM-SOMECHARACTERS" on the top right corner near where your profile picture is and a legend currently reading "Workspace changes: XYZ" and a "Preview" button. Here is an image below to help you find it:

 

image describing where to find your google tag manager tracking code snippet
Once you click on that hyperlink, a pop up window will open looking like this:
image of google tag manager pop up showing tracking code snippet and instructions for installation

How to Install Google Tag Manager?

But wait, what if you are using a Content Management System like Wordpress?! In general, instructions in this page should be enough to guide you though any CMS or website builder. HOWEVER, no worries, here are a couple of them for you. Reach out if you don't see yours listed below. 

How to Install GTM in WordPress

There are a few ways to install GTM on a WordPress website. Here are two common methods:

a. Using a Plugin:
  • Log in to your WordPress dashboard.
  • Go to the "Plugins" section and click on "Add New".
  • Search for a GTM plugin such as "Google Tag Manager for WordPress" by Thomas Geiger.
  • Install and activate the plugin.
  • Go to the plugin settings and paste the GTM container snippet into the provided field.
  • Save the changes.
b. Manually Adding Code:
  • Navigate to your WordPress theme files.
  • Find the header.php file in your theme folder.
  • Paste the GTM container snippet into the <head> section of the header.php file, just after the opening <head> tag.
  • Save the changes.

 

How to Install GTM in Wix

Installing GTM on a Wix website requires accessing the site's code through the Wix Editor. Here's how to do it:

  • Log in to your Wix account and navigate to the site you want to edit.
  • Go to the Wix Editor by clicking on "Edit Site".
  • In the Editor, click on "Settings" in the left sidebar.
  • Scroll down and click on "Tracking & Analytics".
  • Click on the "+ New Tool" button and select "Custom".
  • In the "Add Custom Code" window, paste the GTM container snippet into the "Paste the code snippet here" field.
  • Name your custom code (e.g., Google Tag Manager) for reference.
  • Make sure to select "All Pages" under "Place Code in".
  • Click on "Apply" to save your changes.
How to Install GTM in Drupal

There are a few ways to install GTM on a Drupal website. Here's a common method:

  • Log in to your Drupal website's admin dashboard.
  • Go to the "Extend" section and search for the "Google Tag Manager" module.
  • Install and enable the module.
  • Once the module is enabled, go to the "Configuration" section and click on "Google Tag Manager".
  • Paste the GTM container snippet into the provided field.
  • Save the changes.
Add GTM Container Code to GoDaddy Website

Depending on your GoDaddy website builder or hosting platform, you may need to access the HTML code of your website. Here are general steps:

  • Log in to your GoDaddy account.
  • Navigate to the website you want to edit.
  • Access the website builder or hosting platform.
  • Look for an option to edit the HTML or add custom code.
  • Paste the GTM container snippet into the appropriate section of your website's HTML code. This is typically in the <head> section of your website.
  • Save the changes.

Step 4: Add Google Tag Manager Container to Your Website

Next, you'll need to add the Google Tag Manager container code to your website. Again, copy the provided container snippet from Google Tag Manager and paste it into the <body> section of every page on your website, just after the opening <body> tag. This code loads the container and enables Google Tag Manager to manage your tags and tracking scripts.

Step 5: Verify Installation

After adding the container code to your website, it's essential to verify that Google Tag Manager is installed correctly. You can use browser extensions like the Google Tag Assistant or preview mode within Google Tag Manager to check for installation errors. Once verified, you're ready to start adding tags and tracking scripts to your website using Google Tag Manager.

You can also just open the same blue hyperlink we mentioned in Step 2, and when expanded punch in the URL of interest where you'd expect your GTM tracking code to exist. If the GTM verifier finds your Container's GTM ID, it will result in a green checkmark like in the image below.

image of a google tag manager verification successful

 

Step 6: Add Tags and Tracking Scripts

With Google Tag Manager installed and running on your website, you can begin adding tags and tracking scripts to track various user interactions, such as pageviews, button clicks, form submissions, and more. To add a new tag, log in to your Google Tag Manager account, navigate to the "Tags" section, and click on the "New" button. Follow the prompts to create a new tag, configure its triggers, and save your changes.

Why Should I Install Google Tag Manager on my Website?

Installing Google Tag Manager on your website is a straightforward process that empowers you to track and analyze user behavior effectively. By following the steps outlined in this guide, you'll be able to set up Google Tag Manager and start leveraging its powerful features to gain valuable insights into your website's performance. With Google Tag Manager, you can take control of your website tracking and optimization efforts, ultimately enhancing the overall user experience and driving better results for your business.

Regresar al blog

Deja un comentario

Ten en cuenta que los comentarios deben aprobarse antes de que se publiquen.

Did you enjoy this article?

Share it with your friends!

Author

Pavel Castillo

Marketing Consultant

Pavel is a Digital Marketer based in Vancouver, Canada. He is highly specialized in Search Engine Optimization and the Google Marketing Platform. Pavel has over 14+ years of experience helping brands compete in the most challenging industries, including Pharmaceuticals, FinTech, Cryptocurrency and the Public Energy sector.

More about this consultant
Sea to Sky Consultants logo secondary

About Us

At Sea to Sky Consultants, we specialize in crafting tailored strategies to elevate your brand's online presence and drive measurable results. From dynamic social media campaigns to cutting-edge SEO techniques, we harness the power of digital platforms to connect you with your target audience and maximize your ROI.

Get a free consultation