Google Tag Manager (GTM) is a no-cost instrument that allows you to add, save, and manage marketing tags, without the need to modify website code.
Marketing tags are small fragments of code that trail user behavior and assemble data. The most common illustration of a marketing tag is the Google tag used to integrate Google Analytics and other Google products.
Some other frequently-used examples include Google Analytics event codes, Google Ads conversion scripts, Meta Pixel code, and remarketing tags.
In order for Google Analytics and other platforms to perform and gather data, you need to include tags like these in your website code.
However, each addition and change of code comes with the risk of overlooking, misplacing, or disrupting tags (or other website elements).
GTM tackles these issues by allowing you to integrate, control, and deploy marketing tags from within its software, rather than within your website code.
Moreover, the software embeds code fragments and marketing tags into your website code solely when it is necessary. Hence, you can experiment with the code without accidentally damaging your website.
What Is Google Tag Manager Used For?
With GTM, you can monitor almost any type of event or user action that comes to your mind.
Below are a few instances of frequently-monitored events:
- Link clicks
- Button clicks
- Form submissions
- Conversions
- Shopping cart abandonment
- Adding items to cart
- Removing items from cart
- File downloads
- Scroll behavior
- Video views
- Call to action (CTA) performance
- Table of contents (TOC) clicks
- Custom events
How Does Google Tag Manager Work?
Google Tag Manager functions by utilizing a single JavaScript code snippet that you incorporate into your site as a container for all the tags you wish to manage.
Whenever a user activates a tag (for instance, by clicking on a link or loading a page), GTM retrieves it and injects it into your website code.
Afterward, GTM executes the tag.
In simpler terms, GTM only inserts and runs a tag when a user activates it. This decreases the overall quantity of code on a website and diminishes the chance of implementation errors.

Tags operate in conjunction with other GTM elements called triggers and variables to determine when to execute code fragments.
Let’s delve into the concept of tags, triggers, and variables, and how they operate.
What Are Tags?
Tags are small code snippets that analytics, marketing, and support platforms utilize to integrate with websites and applications.
For instance, Google Analytics uses tags to amass data on website visitors. Here, the Google tag allows you to transmit data from your site to a linked Google Analytics property.
By means of GTM, you can devise, manage, and publish tags, without having to code them yourself.

Sample Tags
The subsequent examples are some of the frequently-employed tags. These are tools and platforms that are frequently integrated with GTM:
- Google Analytics
- Google Ads Conversion Tracking
- PageImprove
- Crazy Egg
- Hotjar
- ImpactHero
- Pinterest Tag
- LinkedIn Insight
- Twitter Universal Web Tag
- Facebook/Meta Pixel
- SplitSignal
- Appcues
- HubSpot
- Intercom
- Mixpanel
- Salesforce
- Custom events and tracking
What Are Triggers?
Triggers are directives that specify when tags should be activated.
Page views, form submissions, and link clicks are some typical examples of triggers. When a user views a page or clicks on a link, the associated tag will be activated.
It is essential to assign a trigger to each tag so that Tag Manager knows when to activate the tag.
Analytics platforms such as Google Analytics commonly use page views as a trigger, as you want data on every page a user visits.
Alternatively, you may want a conversion tracking tag to activate only when a user adds an item to their cart or completes the checkout process.
Once each tag’s designated event takes place, its trigger signals the tag to activate.
Otherwise, the tag will not be activated, and GTM will not execute the code fragment.
Filters can also be added to triggers to specify when tags should be activated.
For example, you may want your support chat to be activated only on pages in the checkout process. In such cases, you could include a filter that specifies the tag to activate only on page views of pages with “/checkout/” in the URL.
Multiple triggers can be assigned to a single tag as well.

Examples of Triggers
Here are some of the most commonly used triggers:
- Page views
- Link clicks
- Button clicks
- Form submissions
- Scroll depth
- Time spent on page
- Custom event
What Are Variables?
Variables are additional pieces of information that GTM uses to activate a tag or trigger.
They help to specify precisely what the tag or trigger is intended to accomplish.
For instance, “Constant” and “Google Analytics Settings” are prevalent variables.
They are both typically used to identify Google Analytics account IDs (i.e., “Tracking ID” in Universal Analytics and “Measurement ID” in GA4).
When creating a Google Analytics tag, you must enter your tracking or measurement ID each time.
As most of us don’t memorize these IDs, this can become tedious.
Instead, you can generate a variable that stores your ID and attach it to any new tag that requires this information.

Examples of Variables
The following are some of the most common variables:
- Constant
- Google Analytics Settings
- Click URL
- Click ID
- Click Class
- Page URL
- Form ID
- Scroll depth threshold
Benefits of Google Tag Manager
Google Tag Manager offers various benefits to marketers and helps save time and resources. It is also free of cost. Some of the advantages of using GTM include:
- Reduced dependence on developers: Marketers can add and manage marketing tags without requiring the help of developers. This simplifies the process of implementing tags and reduces the time taken to make changes.
- Testing and debugging: Before publishing changes to a live site, marketers can preview, test, and debug them. This ensures that errors are minimized, and the need for testing on a staging or live site is reduced.
- User permission control: Changes to the marketing setup can only be made or approved by authorized personnel.
- Versions: Whenever changes are published, GTM creates and logs a new version of the code. This enables viewing past and present changes and reverting to previous versions if needed.
- Workspaces: Team members can work simultaneously without overwriting each other’s progress using multiple workspaces.
- Easy configuration of popular tools: Using code snippets or existing templates from the Community Template Gallery, it is easy to add tools and tracking tags to the website code, such as Google Analytics, Pinterest, and Google Ads.
- Tag storage and management: Google Tag Manager consolidates marketing tags and tracking codes in one place and injects them into website code as needed. This allows adding, removing, and updating tools and tracking codes with fewer errors.
Google Tag Manager and Google Analytics
Google Tag Manager and Google Analytics are often mistaken for the same tool, but they are different and can be used together to gather and analyze web analytics and user behavior.
Google Tag Manager is a system for managing tags and third-party code snippets for marketing purposes. It does not include any analytics or reporting features.
Google Analytics, on the other hand, is software specifically designed for analytics, conversion tracking, and generating reports. By using GTM, you can set up and implement Google Analytics on your website.
Do You Need to Change Anything for Google Analytics 4?
Yes, if you want to install Google Analytics 4 (GA4) using GTM, you must install the “GA4 Configuration” tag.
The process of using GTM with GA4 is very similar to using it with Universal Analytics (UA). However, there are some differences to note.
For example, GA4 has a separate tag for tracking events, unlike UA where events are tracked using the same tag.
Also, GA4 can automatically track and collect more events than UA, which reduces the need for manual event tracking in GTM.
Nevertheless, GTM can still be used to track events that GA4 does not cover.
Fortunately, GTM and GA4 integrate well together. For more information, Google provides a guide on transitioning from UA to GA4.
How to Set Up Google Tag Manager
To start using Google Tag Manager, first, log in to your Google account and navigate to Tag Manager.
Then, click the “Create Account” button to create an account for your business or organization.

Enter an “Account Name” and select your country, with Google recommending that each business have only one account, whether you have one or multiple websites. You can use your company name as your account name.

Next, provide a name for your “Container,” which is the code you will add to your website to activate Google Tag Manager.

Typically, one container is used per website, so use your website name or URL as your container name.
Then, select “Web” as your “Target platform” for websites and click “Create” to generate your first container and Tag Manager account.

You will then see two pop-ups: the first containing the Google terms of service, which you must accept by checking the box at the bottom of the page and clicking “Yes” in the top right corner.

The second pop-up will display two code snippets you need to add to your site to install GTM.

Note that if you’re not comfortable editing your website code, you should seek assistance from a developer.
The first code snippet extracts information using JavaScript and should be placed as high as possible in the <head> section of your website pages.
The second code snippet is an HTML iframe and should be inserted immediately after the opening <body> tag on your webpages.
The HTML iframe element ensures that GTM remains functional even if users disable JavaScript in their browsers.
Once you’ve established your account and installed the two code snippets correctly, you can start using Google Tag Manager.
For best results, use the Tag Assistant Legacy extension to verify that your Tag Manager implementation is correct.
How to Use Google Tag Manager
Let me guide you through the process of connecting a Google Analytics 4 property to your website using Google Tag Manager.
Before you start, ensure that you have installed Google Tag Manager and removed the original Google Analytics code from your website to avoid registering double hits.
First, log in to your Google Tag Manager account and click “New Tag” or “Add a new tag” to create a new tag.

Give your tag a name, such as “GA4 Configuration.”

Then click on “Tag Configuration.”

And select “Google Analytics: GA4 Configuration” from the list.

Enter your GA4 property’s measurement ID or create a variable to store it for future use.

Click on the “Triggering” box.

And select “All Pages” from the options.

Click “Save.”

And go back to your workspace overview page. Click “Preview” to test your changes.

Enter your website’s URL on the next screen and click “Connect” to open your site in a new window and begin testing and debugging.

Once you’re connected, your site should open in a new pop-up window with the Tag Assistant in the lower right corner.

Keep that window open and return to the preview page, which should say “Connected!”

Hit “Continue” and start debugging your tags in the preview window.

You should see your GA4 Configuration tag firing on each page as you navigate your website. This means your tag implementation was successful.
When you’re done debugging, close the newly opened windows and go back to your page overview. Click “Submit” to submit your changes with a descriptive “Version Name” and “Version Description.”

Lastly, click “Publish” to push your changes to your live website and enable GA4. This will publish a new version of your container to your website.

Once you’ve completed the process, you should see hits registering in the “Realtime” report of your GA4 property as you and other users navigate the website.
Remember to always use the “Preview” function to test and debug your tags before publishing them.
Best GTM Extensions
Maximizing the benefits of Tag Manager is possible with the use of browser extensions.
These extensions offer valuable insights on fired (or not fired) tags, as well as identify issues that may arise in your implementations.
They also provide crucial information on your variables, triggers, and code snippets.
Here are some of the best extensions that can help streamline your GTM efforts: