Google Tag Manager: What is Google Tag Manager and why use it?

**Have you ever heard about Google Tag Manager (GTM)? If not, you are probably wondering what it is and why you should use it. After having completed Google Tag Manager Fundamental course, I summarize some things I learned. Hope that you find it interesting and informative :). In this post, I help answer some popular questions such as:

  • What is Google Tag Manager?
  • Should you use Google Tag Manager?
  • How does Google Tag Manager work?
  • How can you create a Google Tag Manager account?
  • How can you install Google Tag Manager?

What is Google Tag Manager (GTM)?

Google Tag Manager is a free tag management solution that acts as a middleman between a website and 3rd party tracking tools (Google Analytics). You simply embed Google Tag Manager code into each page of your website, then configure rules when they should fire (on page load, click, form submission, etc.).

Google Tag Manager allows you to create and monitor tags on a user interface. So you can change your tags and the way they work without actually changing the source code of your website. You can also test your tags to make sure they are triggered when you load a page or click a specific button.

The question is that Google Analytics and Google Tag Manager, which one should you use? The answer is actually both. Google Tag Manager is not a replacement for Google Analytics, they work together.

If you’re not sure how Google Analytics and Google Tag Manager relate, I’ve got you covered with the post

Should you use Google Tag Manager?

In my opinion, there are some benefits you can get by using Google Tag Manager:

#1: Don’t depend on developers

Google Tag Manager helps marketers deploy tracking codes fast. Creating new tags and change the existing tags don’t require code changes in the website.

#2: Manage all your tags in one place

#3: Allow you to test to make sure that your tags work well

Google Tag Manager lets you correct tag errors via Google Tag Manager’s Preview and Debug mode. You can see which tags are fired on a page and which are not. This helps you make sure that your tags work well before you publish them to the live site. Also, you can use some browser addons that enable you to find troubleshooting such as Tag Assistant.

How does Google Tag Manager work?

To know how Google Tag Manager works, you need to understand three concepts that are used in Google Tag Manager including Tags, Triggers, and Variables.

A tag is tracking codes or code fragments that must be fired on a website under certain circumstances. When you create a tag, you basically tell Google Tag Manager what action to take on that page. For example, track page views of this visitor, track this click and send it to Google Analytics.

A trigger is a condition when a tag must be fired. For example,

  • A trigger with a condition to only fire a Tag when a user views URLs containing the path features/magento-pos/.
  • A trigger with a condition to only fire a Tag when a user clicks the button containing the class “book-demo-menu”

When a particular condition is met, a trigger is activated and all the tags (linked to it) are dispatched.

A variable is a value used in tags, triggers, or even in other variables to filter when a specific tag should fire. GTM provides built-in variables and allows you to create custom user-defined variables. A variable can:

  • hold a single piece of data (like page URL, website domain, product ID)
  • hold a set of data/settings (Google Analytics settings variable contains multiple settings related to GA, like Tracking ID, Display Advertising settings, etc.)

How to create a Google Tag Manager account

You can go to Google Tag Manager’s official website to create a Google Tag Manager account. Click the main call-to-action in order to create a new account.

Once you log in, you’ll be asked to create a new GTM account and a new container. Enter your GTM account (for example, Magestore), container name may be “Website” or “Blog”. A single container can contain many tags, triggers, and variables.

How to Install Google Tag Manager on your website?

After creating a Google Tag Manager account, you’ll get two codes to add to your website. The first code should be added somewhere in the of a website, while the second should be added right after the opening tag. Thanks to this code, all the tags will be fired when they are configured to do so.

Now you can create the first tags. To know more details about how to create a tag, variable, please read this my post :slight_smile:

6 Likes

Thanks chị @marcienguyen. Em phải save lại để đọc series bài này ạ. Dạo trước e chỉ đi học mót 1 xíu chứ chưa biết gì nhiều. Đọc chỗ Old way vs New way mới thấy có GTM tiện cho marketer thật đấy :smiley:

Thank em, đợt vừa rồi chị cũng mới học tử tế đó ^^