What Is Google Tag Manager & How Does It Work?

4 months ago 22
ARTICLE AD BOX

What Is Google Tag Manager?

Google Tag Manager (GTM) is simply a escaped instrumentality that enables you to install, store, and negociate selling tags without modifying website code. 

Marketing tags are tiny snippets of codification that way idiosyncratic actions and cod data. 

The astir communal illustration of a selling tag is the Google tag.

The Google tag is utilized to instal Google Analytics and different Google products and services.

Other communal examples see Google Analytics events, Google Ads conversion scripts, Meta Pixel, and remarketing tags.

install the google tag manually

Tags similar these are placed successful your website codification for Google Analytics and different platforms to relation and cod data.

But with each codification change, you hazard losing oregon breaking tags (or different website elements).

GTM mitigates these issues by allowing you to install, manage, and deploy selling tags from wrong its bundle alternatively of successful your website code.

And the bundle injects codification snippets and selling tags into your website codification lone erstwhile necessary.

So you won’t accidentally interruption your website by investigating something.

What Is Google Tag Manager Used For?

Google Tag Manager is utilized for managing and deploying selling tags connected a website without having to modify the code.

This allows you to integrate easy with different selling tools and platforms specified as:

  • Google Analytics
  • Google Ads
  • Facebook
  • Hotjar
  • CRM Platforms

And it allows you to way astir immoderate benignant of lawsuit oregon idiosyncratic behaviour you tin deliberation of.

Here are immoderate examples of commonly tracked 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 enactment (CTA) performance
  • Table of contents (TOC) clicks
  • Custom events

Due to its easiness of usage and built-in information features, GTM is besides utilized to trim dependency connected developers and plugins. 

Benefits of Google Tag Manager

While Tag Manager requires immoderate method knowledge, it saves marketers tons of clip and resources.

And it’s free.

Here are immoderate benefits:

  • Reduced reliance connected developers: Quickly and simply adhd and negociate selling tags without developer assistance
  • Testing and debugging: Preview, test, and debug changes earlier pushing them to a unrecorded site. This diagnostic helps forestall errors and reduces the request for investigating connected a unrecorded oregon staging site. 
  • User support control: Only authorized radical tin marque oregon o.k. changes to your selling setup
  • Versions: GTM creates and logs a caller mentation of the codification whenever you people changes. This allows you to presumption past and contiguous changes and revert to erstwhile versions if necessary. 
  • Workspaces: GTM enables aggregate workspaces for squad members to enactment simultaneously without overwriting each other’s progress
  • Easy configuration of galore fashionable tools: Easily adhd tools and tracking tags to your website codification utilizing codification snippets oregon existing templates (e.g., for Google Analytics, Pinterest, Google Ads, etc.) from the Community Template Gallery
  • Tag retention and management: Google Tag Manager consolidates selling tags and tracking codes successful 1 spot and injects them into website codification arsenic needed. Which allows you to add, remove, and update tools and tracking codes with less errors.
the benefits of utilizing gtm

Should You Use Google Tag Manager?

Yes, you should astir apt usage Google Tag Manager.

Even if you are not ace method oregon person constricted resources available. 

GTM is large for adding, managing, and editing website tracking and analytics codes.

And it saves clip and resources by allowing you to bash these things without changing your site’s root code.

This eases the load connected improvement resources.

And reduces the likelihood of site-breaking errors.

However, GTM is simply a analyzable instrumentality that comes with a steep learning curve.

And mounting it up correctly is critical. 

But erstwhile it’s acceptable up and you’ve learned to usage Tag Manager properly, you’ll footwear yourself for not doing it sooner.

How Does Google Tag Manager Work?

Google Tag Manager works by utilizing a azygous JavaScript codification snippet that you adhd to your tract arsenic a instrumentality for each the tags you privation to manage.

It has listeners that observe idiosyncratic interactions, specified arsenic leafage views.

When a idiosyncratic loads a page, the GTM listeners observe the action.

Then they cheque if the enactment matches immoderate triggers that person been acceptable up successful GTM.

If the enactment matches a trigger, the associated tag is fired. 

The tag could beryllium a codification snippet for Google Analytics oregon different selling platform.

Or it could beryllium a circumstantial lawsuit you privation to way (e.g., views of a definite page). 

When the tag is fired, the codification is injected into the website.

Then the tag processes the applicable information and sends it to the respective third-party work (e.g., Google Analytics oregon Facebook Pixel).

In different words, GTM lone injects and executes a tag erstwhile a idiosyncratic triggers one.

This reduces the wide magnitude of codification connected a website and minimizes the hazard of implementation errors.

Tags tin lone relation on with different GTM components called triggers and variables.

They assistance to find erstwhile to execute the codification snippets.

Tags

Tags are snippets of codification that analytics, marketing, and enactment platforms usage to integrate with sites and apps.

They are similar observers you enactment connected your website.

They support way of what users do, similar click links oregon presumption pages. 

And they nonstop this accusation to tools similar Google Analytics oregon ImpactHero.

Tags yet assistance you recognize idiosyncratic behavior.

GA4 configuration page

Examples of Tags

The pursuing are examples of commonly utilized tags. These are tools and platforms often installed with GTM:

  • Google Analytics
  • Google Ads
  • 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

Triggers

Triggers are instructions and criteria for erstwhile tags should fire.

Page views, signifier submissions, and nexus clicks are communal examples of triggers.

When a idiosyncratic views a leafage oregon clicks a link, the associated tag volition fire.

Every tag indispensable person astatine slightest 1 trigger truthful GTM knows nether which circumstances to occurrence the tag. 

Analytics platforms similar Google Analytics typically usage leafage views arsenic a trigger.

This is due to the fact that you privation analytics information from each leafage a idiosyncratic visits.

Alternatively, you mightiness lone privation a conversion tracking tag to occurrence erstwhile a idiosyncratic places an point successful their cart.

Or possibly erstwhile they implicit the checkout process. 

When each tag’s specified lawsuit occurs, its trigger tells the tag to fire.

Otherwise, the tag volition not fire.

And GTM won’t execute the codification snippet.

You tin besides adhd variables to triggers to further specify erstwhile you privation tags to fire.

For example, you whitethorn lone privation your enactment chat to occurrence connected pages successful the checkout funnel.

In this case, you could adhd a adaptable telling the tag to lone occurrence connected leafage views of pages with “/checkout/” successful the URL. 

You tin delegate aggregate triggers to a azygous tag.

assign triggers to tags successful  ga4

Examples of Triggers

Here are immoderate of the astir commonly utilized triggers:

  • Page views
  • Link clicks
  • Button clicks
  • Form submissions
  • File downloads
  • Scroll depth
  • Time spent connected page
  • Custom event 

Variables

Variables are further pieces of accusation GTM whitethorn request to occurrence a tag oregon trigger.

They assistance specify precisely what the tag oregon trigger is expected to do.

For example, “Constant” and “Google Analytics Settings” are communal types of variables.

They are some typically utilized to specify Google Analytics relationship IDs (i.e., “Tracking ID” successful Universal Analytics and “Measurement ID” oregon “Google Tag” successful GA4).

Every clip you make a Google Analytics tag, you request to participate your tracking oregon measurement ID. 

This tin get tedious, arsenic astir of america don’t memorize these IDs.

Instead, you tin make a adaptable that simply stores your ID.

Then, whenever you make a caller tag that requires this information, you simply connect the adaptable you created.

Another communal adaptable is “Page URL.”

If you wanted to way leafage views of your checkout page, you’d person to delegate the “Page Views” trigger.

But to specify the checkout page, you’d person to delegate the Page URL adaptable and adhd the URL for your checkout page.

variables overview successful  gtm

Examples of Variables

The pursuing are immoderate of the astir communal variables:

  • Constant
  • Google Analytics Settings
  • Click URL
  • Click ID
  • Click Class
  • Page URL
  • Page Path
  • Form ID
  • Scroll extent threshold

Google Tag Manager vs. Google Analytics

Though often conflated, Google Tag Manager and Google Analytics are antithetic tools you tin usage unneurotic to cod and study connected web analytics and idiosyncratic behavior. 

Google Tag Manager is simply a tag absorption strategy that stores and manages selling tags and third-party codification snippets.

There are nary analytics oregon reports successful Tag Manager.

Google Tag Manager home

Google Analytics, connected the different hand, is bundle utilized for analytics, conversion tracking, and reporting.

Google Analytics home

You tin usage GTM to instal and deploy Google Analytics connected a website. (Google recommends doing this.)

Do You Need to Change Anything for Google Analytics 4?

Yes. If you are utilizing GTM to instal Google Analytics 4 (GA4), you’ll request to instal the Google Tag.

Aside from that, utilizing Google Tag Manager with GA4 is precise akin to utilizing it with Universal Analytics (UA).

One of the main differences is that Google present provides a abstracted tag for GA4 events.

Previously, you’d instrumentality UA and way events utilizing the aforesaid tag. 

Another quality is that GA4 tin automatically way and cod galore much events than UA connected its own.

Which means little request for manual lawsuit tracking successful GTM.

However, you tin inactive usage GTM to way thing GA4 doesn’t provide.

Tag Manager and GA4 enactment seamlessly together. 

Read Google’s usher connected moving from UA to GA4 for further information.

How to Set Up Google Tag Manager

To acceptable up Google Tag Manager, log successful to your Google relationship and spell to Tag Manager.

Click “Create Account” to make an relationship for your concern oregon organization.

create relationship  fastener  highlighted

Enter an “Account Name” and prime your country.

Google recommends that each concern make lone 1 account—whether you person 1 website oregon multiple.

Your institution sanction tin service arsenic your relationship name.

account setup

Next, participate a “Container name.” 

Container sanction  container  highlighted

Your instrumentality is the portion of codification you volition adhd to your website to marque Google Tag Manager work.

You volition typically usage 1 instrumentality per website.

So your instrumentality sanction tin beryllium your website sanction oregon URL.

Then, prime your “Target platform.” For websites, take “Web.”

select people     platform

Click “Create” to marque your Tag Manager relationship and your archetypal container. 

Next, you’ll spot 2 pop-ups. 

The archetypal is the Google presumption of service.

Agree to the presumption by checking the container astatine the bottommost of the page. 

And click “Yes” to judge astatine the apical close country of your screen.

agree to google terms

The 2nd pop-up displays the codification snippets you request to adhd to your tract to instal GTM.

code snippet to instal  gtm

The archetypal codification snippet uses JavaScript to extract information.

Place that snippet arsenic precocious successful the <head> conception of your website pages arsenic possible.

how to adhd  codification  snippet to your website

The 2nd snippet is an HTML iframe.

Place that codification instantly aft the opening <body> tag connected your webpages.

Like this:

how to adhd  codification  snippet to your website

(The HTML iframe constituent ensures that GTM inactive works erstwhile users disable JavaScript successful their browsers.) 

Once you’ve acceptable up your relationship and decently installed the 2 codification snippets, you’re acceptable to commencement utilizing Google Tag Manager. 

How to Use Google Tag Manager

To show however to usage Google Tag Manager, we’ll locomotion you done however to link a Google Analytics 4 spot to your site.

Begin by logging successful to your Google Tag Manager account.

Click “New Tag” oregon “Add a caller tag” to make a caller tag.

create a caller   tag successful  gtm

Add a sanction for your tag. We suggest thing similar “GA4 Configuration.”

choose a tag name

Next, click connected “Tag Configuration.”

Tag Configuration highlighted

Click “Google Analytics.”

 GA4 Configuration

And prime “Google Tag” from the list.

“Google Tag” selected from the list

Enter the Google tag ID for your GA4 property.

Alternatively, you tin make a adaptable to store your Google tag ID for aboriginal use.

Google tag ID container  nether  ga4 configuration

Click the “Triggering” box.

Triggering container  nether  ga4 configuration

And prime “All Pages” from the database that pops up.

all pages

Then click “Save.”

save fastener  highlighted

Go backmost to your workspace overview leafage and click “Preview” to trial your caller changes.

test caller   changes by clicking preview

Enter your website’s URL successful the adjacent screen.

Then click “Connect” to unfastened your tract successful a caller model and statesman investigating and debugging.

connect button

Once you’re connected, your tract should unfastened successful a caller pop-up.

With the Tag Assistant successful the little close country of your window.

tag adjunct  connected

Keep that model unfastened and instrumentality to the preview page.

The preview leafage should say, “Connected!”

Connected! page

After you deed “Continue,” commencement debugging your tags successful the preview window.

Google tags preview window

You should spot your recently created GA4 Configuration tag firing connected each leafage arsenic you navigate your website.

This means your tag implementation was successful.

When you’re done debugging, adjacent the recently opened windows and spell backmost to your leafage overview.

Then click “Submit” to taxable your changes.

submit changes button

Be definite to springiness your changes a descriptive “Version Name” and “Version Description.”

Version sanction  and statement  boxes

Lastly, click “Publish” to propulsion your changes to your unrecorded website and alteration GA4.

This volition publish a caller mentation of your container to your website.

You should present spot hits registering successful the “Realtime” study of your GA4 spot arsenic you and different users navigate the website.

Realtime overview

Best GTM Extensions

Browser extensions assistance you get much retired of Tag Manager. 

The pursuing extensions supply further accusation connected the tags that are firing (or not firing).

And immoderate issues that originate with your implementations.

They besides supply important details regarding your variables, triggers, and codification snippets. 

The pursuing extensions are immoderate of the champion for facilitating your GTM efforts:

Track Even More Data

Google Tag Manager allows you to way astir immoderate idiosyncratic behaviour oregon enactment you tin deliberation of.

And GA4 comes with a batch of invaluable idiosyncratic information close retired of the box.

But elemental leafage metrics and events tin lone archer you what happened. 

ImpactHero goes beyond that and tells you why thing happened.

And what you request to bash to amended it. 

ImpactHero overview dashboard

From lawsuit travel mapping to contented show analysis, ImpactHero provides the selling information you truly request to beryllium successful.