How does Google Tag Manager work?

When you place a Google Tag Manager JavaScript on a web page, it can listen to various user actions happening on the page. Based on the rules (also known as triggers) you define in the Google Tag Manager interface, it activates (also referred as “fire”) appropriate tags, as defined by the rules set in the tag manger.

In a nutshell, the Google Tag Manager code has four main functions

  1. Container of tags
  2. Rules Engine
  3. Event listener – user or page actions
  4. Tag activator.

 

  1. Tag Container - As mentioned in the “What is a Tag and a Tag Manager” section, all the tags are configured within Google Tag Manager interface and are used as needed. Google Tag Manager code on the page is the container that pulls and uses the tags as needed.
  2. Rules Engine – In Google Tag Manager, you define a set of rules that determine when and which tag(s) to trigger (fire).
  3. Event Listener – Google Tag Manager code on the webpage actively listens to user or page interaction on the site. These interactions are known as events. Almost any user or page interaction on a webpage can be captured by Google Tag Manager. Example of such action are page load, link clicks, button clicks, page scroll, form fill, video play etc. These actions are also called triggers.
  4. Tag Activator – When a condition, as specified in the rules, is met then Google Tag Manager fires the tag that is defined in that rule.

Let’s take an example to see how this works:

  1. Container – Contains Google Analytics Event Tracking tag.
  2. Rule – Fire Google Analytics Event Tracking tag when a button on a page is clicked.
  3. Event Listener – Listens for events on the page and evaluates them based on the rules. In this case, the rule is looking for a button click on a page. When a button is clicked then it trigger Tag Activation.
  4. Tag Activation - Fires Google Analytics event tracking tag

 

Follow this series of posts and learn Google Tag Manager - step by step.

Chapter 1: What is a Tag and what is Tag Manager

Enroll in our course

  1. Google Tag Manager (GTM) Online Training Course - From Zero to Hero
  2. Google Tag Manager Advanced Applications

Related Services

Leave a Reply

Your email address will not be published. Required fields are marked *