What Is Google Tag Manager? (And How Does It Work With Google Analytics?)


For quite some time, Google Analytics (GA) has been around to help you collect, process, configure, and report website and mobile app data that results in actionable insights. Then in 2012, Google announced the release of its new groundbreaking product, known as Google Tag Manager (Tag Manager or GTM).

In short, we love it. And we write about it often! Despite GTM’s usefulness, there’s still a lot of confusion about what it is, what it does, and how it’s different from Google Analytics. So, we’ve decided to dedicate this bit to dissolve the confusion.

Where People Get Tag Manager Wrong

A common misconception is that Tag Manager is the same thing as (or the latest version of) Google Analytics. This is not the case! In actuality, Google Tag Manager is a completely separate tool.

Breaking It Down

In short, Google Tag Manager is a user-friendly solution to managing the tags, or the snippets of JavaScript that send information to third-parties, on your website or mobile app. Adding other products to your site, including but not limited to AdWords Conversion Tracking and Remarketing, DoubleClick Floodlight, and of course, Google Analytics, is a breeze.

In more detail, GTM makes your life easier by simplifying the process of adding these JavaScript snippets to your website. Instead of updating code on your website, you use the interface to decide what needs to fire and on what page or what action. GTM then adds the appropriate tracking to your site to make sure it all works.

Google Tag Manager consists of these three main parts:

  1. Tag: A snippet of code (usually JavaScript) added to a page.
  2. Triggers: Defines when and where tags are executed.
  3. Variables: Used to receive or store information to be used by tags and triggers.

Before And After Tag Manager

Before Google Tag Manager, the JavaScript on your website or mobile app had to be hard-coded. In other words, you were forced to team up with developers to make even the slightest changes to your tracking. Need to add an event? Get in line behind the urgent site issues and routine maintenance. Or, if you’re the one in charge of updating your site, tracking certain links or forms may require wrestling with JavaScript/jQuery to get the exact thing you need.

Now, Tag Manager gives you a friendly user interface that walks you through creating tags step-by-step, which eliminates the need to have extensive experience with JavaScript. To get started, you add the custom-generated tracking code, also called the container tag, to your website or mobile app.

Afterwards, Google Tag Manager allows anyone with the appropriate user permissions to add, change, and debug tags for your website. You can use it to control and fine-tune what fires on your website while it delivers the JavaScript to your site for you.

Most importantly… You can take tagging into your own hands, and steer your tracking however you desire, quickly and easily, without those sometimes pesky backseat drivers (your developers).

So GTM And GA Aren’t An Old Married Couple?

Not necessarily. Google Tag Manager and Google Analytics are two completely separate tools, and can live independently of one another: You can use Google Analytics on your site by itself, just as much as you can use Google Tag Manager on your site by itself.

However, as our Technical Marketing Manager, Jon, always says, “Google loves Google.” Therefore, it should’t be surprising that they work very well together.

GTM And GA Working Together

Quite honestly, the possibilities of how the two tools work together are endless!

However, there are a few ways to use Google Tag Manager with Google Analytics that are commonplace. For instance, you can use GTM to send different pieces of data to Google Analytics, such as pageviews and events. Let me reiterate that normally, you would have had to add JavaScript on your site, but not when using Tag Manager.

Here’s an example:

For Google’s sake, we’ll show you how to send data to Google Analytics using Tag Manager. Let’s say that you need to track resource downloads on your website (pdfs, docx, xls). For tracking purposes, it’s important to know two things:

  1. How many people downloaded the file?
  2. What page was the user on when it was downloaded?

In this case, GTM allows you to easily set up a Click Trigger and a Google Analytics Tag to see what and where resources are being downloaded without needing to add any additional code to your site.

Furthermore, you can use Google Tag Manager triggers to dictate when this data should be sent to Google Analytics. To expand on our previous example, maybe you want to only send a virtual pageview to Google Analytics when a user clicks on a resource download link. If so, you can use Tag Manager’s triggers to specify these conditions.

7 Reasons Why Google Tag Manager Is Special

1. It’s F-R-E-E, Free.

Not to worry, it’s both free and awesome! Google Tag Manager has a multitude of robust features, including (but not limited to) usability, accounts and user roles, tag firing rules, and supported tags (Google, third-party, and custom HTML tags).

2. Do It Yourself

Insert the container tag once, make changes whenever you want without much hassle, and voilà! With the available debugging tools and preview mode, you can be sure of what you’re doing before you publish it.

3. Forget About Limitations

You can use Google Tag Manager with more than just Google products. Take a peek at the other predefined tags, such as Marin, comScore, AdRoll, and more! Can’t find the tag you need? Customize one! You can also add Tag Manager to not only your website, but also to your iOS and Android apps. You’re truly unlimited.

4. Cool Features With Google Analytics

Google Tag Manager makes it easier to implement some of the more complicated Google Analytics features, such as User ID tracking. User ID tracking gives you the ability to measure real users instead of devices. This provides more accurate data for you, which ultimately helps your users! It’s a win-win. Tag Manager also helps with common challenges in Google Analytics, such as Custom Dimensions, Cross-Domain Tracking for multiple sites that are tracked together in Google Analytics, and Enhanced Ecommerce that requires collaboration with developers.

5. Easily Track More Things

With so many great resources available on the web (and our own site!) it’s easier than ever to track things like YouTube videos on your site, print tracking, or AJAX form submissions.

6. Worry-Free Security

No need to worry. Google Tag Manager has all of the security features you need. One awesome feature is two-factor authentication that requires both your normal password and then a numeric code that you receive via a text message, voice call, or mobile app. You are also able to control the access by granting different levels of permission at both the account and container levels.

7. Debug Central

With debug options, built-in error checking, and version controls, you can rest easy knowing that everything you do with Google Tag Manager can be tested and debugged before it goes live.

When Can You Migrate To Google Tag Manager?

Any time is a good time to migrate, especially if you haven’t already upgraded to the latest version of Google Analytics (Universal Analytics), then it would be a great opportunity to also migrate to Google Tag Manager. Check out the important migration tips and tricks linked below that you should put into practice. Migrate whenever you feel you’re ready to take advantage of its many awesome features!

How Can LunaMetrics Help?

Are you ready to try it out? LunaMetrics is a Google Tag Manager Certified Partner that is here to help you implement Google Tag Manager and Google Analytics through GTM. You can reach out to us, check out some of our other blogs on Google Tag Manager, check out our GTM Book and GTM recipes, or find out when our Google Tag Manager trainings are coming to you!

Kaelin Harmon is a former contributor to the LunaMetrics blog.

  • George

    Just getting started with GTM, it looks really useful. So far I have been testing GTM with a new Universal Analytics account in the last month or so while at the same time keeping my old UA account running on our website too.

    One thing I’ve noticed that that the data being collected by UA is different between the two. I’ve gone through every metric and not one has the same data despite their settings in GA being identical. I was just wondering if this is normal or if GTM is more accurate at recording activity? (overall we are seeing around 8% more traffic in the GTM-loaded version).

    • Kaelin Harmon

      Hi George!

      Assuming that everything was set up correctly in both properties, we would normally expect about a 1-2% difference in data, which can result from many reasons. For instance, one may load faster, one may be getting more spam, one may be located in a different part of the page, and the list goes on.

      However, since you’re seeing a much higher difference at around 8%, we encourage you to check out one of our other blog posts that you can use as a guide to safely migrate to GTM.


      Make sure the code is on every page, double check filters, etc.

      We hope this helps!


      • George

        Many thanks Kaelin.

        I think I have finally found the needle in our haystack (a randomly occuring problem in our CMS when loading the original GA code). So I feel happier about the data coming from GTM now and will follow the advice on your blogs as we continue the migration.

        Cheers, George

    • Most importantly… You can take tagging into your own hands, and steer your tracking however you desire, quickly and easily, without those sometimes pesky backseat drivers (your developers).

    • Quite honestly, the possibilities of how the two tools work together are endless!

  • Angela

    I recently set up GTM and am just now getting around to cleaning up some of the goals I have in GA. I have a question that I hope you’ll be able to answer. Is it better to track Goals such as Thank You pages through GTM via an event or better as an actual Goal in GA?

    • Kaelin Harmon

      Hello Angela,

      It’s best to use goals in GA when the interaction is vital to your business. For instance, if your “thank you” pages are some of the more important interactions, keep them as a GA goal. If they aren’t as important or if you’re running out of space for goals, create an event for each page you need to track.

      If there’s a pattern to your pages, you can use regular expressions to capture an entire group of “thank you” pages in order to consolidate goals or to create rule-based events.

      Here is a quick guide to regular expressions: http://www.lunametrics.com/regex-book/Regular-Expressions-Google-Analytics.pdf

      I hope this answers your question!

      • Angela

        Thank you Kaelin. This does answer my question.
        I had no idea I could use regular expressions to consolidate goals. I’ll definitely look into this.

        I appreciate you all!

  • Sachin Fadale

    Kaelin Hi,

    We always say if the GA tag is placed in middle or bottom of the page then GA wont be able to fire the pixel immediately (We may face high Click to visit discrepancy).
    GA tag has to be placed in the section.

    The same thing applies to GTM?
    GTM need to be placed on the head? or no matter for placement if it is GTM.
    Please let me know.


    • Kaelin Harmon

      Hey Sachin,

      It’s best to place the GTM code snippet after the opening tag. The snippet contains for instances where a user blocks JavaScript or if the user’s browser doesn’t support JavaScript. Therefore, if it’s placed in the section, this code may not function as intended. Please note that if you are using a dataLayer, the dataLayer should be placed above the GTM code snippet.

  • Kath

    Hi. Really appreciate your post! I’m curious though (and I know this might sound stupid) but if I already have a Google Analytics js code implemented on my site, and I want to use the Google Tag Manager, do I use that tag code instead and remove my GA code on my site? Thanks!

    • Vaibhav Raut

      Hi Kath,

      Ideally you should be able to do that i.e. remove your existing GA code and add GTM code instead. However, experts say that, you should keep both the snippets of GA and GTM there on the site until you’re sure that GA and GTM are in order. It is also recommended that you should create a different web property in GA for the GTM to make sure that you’re not losing any data in the transition process from GA to GTM. I hope this clears your doubt. For more details, you can read the Practical Google Analytics and Google Tag Manager for developers by Jonathan Weber.

  • Arunkumar

    Hey Kaelin.. Thanks for a great post. I just have a question. Excuse me it it is naive. Would I be able to track my Email Campaign through GA? Would GTM be helpful for that?

    • Vaibhav Raut

      Hi Arun,

      You won’t need GTM for that. Just track your email campaigns with the utm parameters and you’re good. It will automatically get tracked in GA. There is a built-in report for campaigns in GA. I hope this helps.

  • Benny Kline

    great article, thanks for explaining GTM so clearly. I think I now have to start incorporating it into my client work. bravo!

  • CR Rollyson

    Great article. All the references do make it sound like there is a gap to bridge between you and your developers. Many shared benefits when both camps come together, well beyond what a one-person chief can accomplish on a larger scale.

  • Benjamin Antoniadis

    Awesome article, helped me a lot and made things clear ! Thank you and keep up the good work

  • Denis Lamela

    How can i track the activity of CTA on my landing page ?

  • I didn’t realize it, but I’ve been waiting for this post. Thank you!

  • Jack Thomos

    Thank you

  • Iason Yannis Schizas

    Thanks a lot!
    Usefull and simpel explanation!

  • Informative post can any one tell how it will help with meta tags, we can change meta tags with the help of developers

  • Lance C. Braun

    Great post – very helpful. If GA is currently on our site, does the code need to be pulled and added back into Tag Manager, or can GA continue to run outside of Tag Manager?

    • Hi Lance,

      You can run both concurrently, though you won’t be getting the full benefits of GTM until everything is encompassed in there. Make sure that you do NOT duplicate tracking though. If you’re sending Pageviews from the on-page code, then do not create a Pageview tag in GTM. Same with events.

      If you do maintain on-page code and GTM, we’ve got a post for that.http://www.lunametrics.com/blog/2015/01/21/gtm-existing-tracking/


      • Catherine Arnold

        Hi Jon, I have GA and GTM on a new site and I can see tags are firing, but not recording in google analytics conversions in real time or historic. I was worried that having GA code on site might clash with the GTM code in someway? But not possible? As GA isn’t recording meaningful conversions at present, should I remove GA and do everything through GTM please?

    • I agree with you.

  • Thanks a lot for this beautiful Article.

  • Erica Germain

    My question is similar to Lance’s below. I am setting up a new website. I went to Google Analytics and opened the new propoerty and that’s where I saw a link about GTM. I also created a property there. Do I use both codes on the site or will they conflict?

  • SEO Training in Lahore
    SEO Courses in Lahore Become certified SEO expert with our SEO training in Lahore.SEO courses in Lahore and Pakistan with practical projects.

  • You are looking for SEO Courses in Lahore and Pakistan. SEO Courses Institute Lahore Provides SEO courses and training in Lahore. SEO training center in Lahore

  • Ehsan Zaery Moghaddam

    Nice and clear, thanks 🙂

  • Charles Roth

    The definition of “tag” in this article is TERRIBLE. It’s a snippet of code… except it’s not (anymore). So what *is* it? To be fair, Google’s own write-up is equally bad. Both sites basically say that a tag is something you manage with Google Tag Manager. Jeez. A better definition might look something like “A tag is an abstract concept. It’s used to track… (something). In the old days it was an actually snippet of javascript code that had to be added to your website. Now it’s… (something else)”. Fill in the ellipses and you’ll have a start of an actually meaningful definition.

    • Hi there – I can certainly understand the concept is tricky to define and explain. From a technical perspective, it’s been a slow evolution, so it doesn’t seem that far off. I don’t think the definition is really wrong, but perhaps it could be tweaked to be better based on the audience.

      Whether you add Google Analytics to your site via JavaScript or whether you add it via Google Tag Manager, the end result is the same – a small bit of JavaScript gets added to your page. GTM introduces a graphical interface that hides this from users, but it doesn’t change what technically happens. The info you add to the tag template gets inserted into a JavaScript tag, which gets added to your page.

      We’ll take your comments into consideration as we continue to try to explain these tools and concepts.


      • Charles Roth

        Um, no, that’s just flatly wrong. We’re using GTM and GA, and I’m adding some tags, but I’m also writing some reasonable documentation along the way. We add *one* bit of javascript to every page, and then (for the simpler cases), GTM does all the work of detecting the hits (triggers) based on unique CSS classes or HTML DOM Ids. But when I create a new tag, IT DOESN’T ADD ANY JAVASCRIPT TO OUR PAGES! That’s insane, our pages did not change. If you mean that the javascript we DO include monkeys with the DOM and adds stuff there, that’s a horse of a different color. (Although I’m dubious of even that, after fooling with the DOM in the chrome console.)

        Here’s a snippet from the doc I’m writing (for our developers who are new to GTM):

        *What’s a Tag?*
        This is a simple question that is
        surprisingly difficult to answer. Google’s own description is confusing
        and entirely circular (it’s what Google Tag Manager manages). My best
        answer is that it’s really an abstract concept: it’s a “thing” that you
        can get GTM & GA to report on. It is driven by a particular user
        action, but it is not quite the same as a user “event”.

        Some examples may help:

        1. You could create a tag that is attached to the OneSearch login button.
        Clicking on the button causes the tag to “fire” and report itself to
        GA. But pressing Enter also causes the tag to fire, even though it’s
        not a button click. The concept is, the tag is, that a Login is

        2. You can define a tag to the simple loading of a page
        (or even better, a pattern that matches a set of pages). When the
        relevant page loads, the tag is fired. No other user interaction is

        • Charles Roth

          I dug a little deeper. The precise mechanics are more like:
          1. We insert a ‘snippet’ of javascript into each and every page at our end.
          2. That snippet in turn downloads some more javascript, gtm.js, but with the container id embedded in the request.
          3. That download includes all of our currently-defined GTM tags and triggers encoded as DATA (not javascript).
          4. Then, when an event is fired on the page, the existing javascript walks through that data, and determines if there’s a match against a trigger (and thus a tag).
          5. In that case, it sends some info back to “the mothership” at Google to record the tag as having been “fired”.

  • good article. thanks for sharing useful information..

  • Great article..Thanks

  • Anbu Rabindra Arumugam

    Interesting Post., Here I am sharing an Infographic about “100 Useful Tags to Deploy in an E-Commerce Site” download it for free here: http://www.softcrylic.com/blogs/100-useful-tags-deploy-e-commerce-site/

  • We use Google Tag Manager for all of our clients! It is by far the most efficient way to collect valuable information about the visitors on your site as well as the actions they take.

  • lakelander

    Very helpful, thanks.

  • Well and informative !
    Thanks for sharing such informative things regarding GTM and more about the relation between web with Mobile. anyway I am looking much more things about search console.

  • Bob

    We recently migrated our GA code into GTM. This caused problems with in-page ga() calls not being able fire. It indicates ‘ga’ is undefined. I’m guessing that the GA codebase isn’t yet loaded when the in-page ga() function calls are made. I’m surprised to not find more people experiencing this issue. Any insights?

  • Great information – Does GTM code affects bounce rate on your site? I mean does it attract any irrelevant traffic to your site?

  • Thanks for the full guide about Google Tag Manager 🙂

Contact Us.

Follow Us




We'll get back to you
in ONE business day.
Our Locations
THE FOUNDRY [map] LunaMetrics

24 S. 18th Street
Suite 100

Pittsburgh, PA 15203


4115 N. Ravenswood
Suite 101
Chicago, IL 60613


2100 Manchester Rd.
Building C, Suite 1750
Wheaton, IL 60187