Is gtag.js the same as Google Tag Manager?

Google Analytics is one of the most popular Analytics platforms out there, allowing site owners to monitor traffic to their website. It lets you see how many visitors you’re receiving, where they’re coming from, and what pages they are looking at. It’s an indispensable tool for figuring out how users are interacting with your website and can easily be implemented on everything from a basic WordPress site to a complicated eCommerce platform like Magento.

However, over the years, Google Analytics has changed a lot. As a result, Google has created several different ways to add Google Analytics to your website. Originally, everything was included in a piece of Javascript code that you would copy and paste into your site code. This script included all of the functions that Google needed to grab data from users and send it back to their servers for processing.

As the tool added more and more features, these functions also became more complex. In order to make it easier for users to add tracking to their websites, Google moved a lot of this code to a separate file called gtag.js. This is a Javascript file that is located on Google’s servers. Rather than copying and pasting a bunch of raw Javascript code, users could create a link to the gtag.js file and load all of these functions from Google’s servers. This made it easier for users to add Google Analytics to their site, and any updates to the code could be handled on Google’s end. Updates would be handled automatically, rather than requiring the user to update the code on their website. However, if a site owner wanted to enhance Google Analytics and add custom tracking, they would still have to add some Javascript code to their website.

Fast forward to today. Google’s latest innovation is called Google Tag Manager, and it lets users add Google Analytics (including custom event tracking) through a web interface, removing the need to write their own Javascript code. It made it a lot easier for the average user to customize Google Analytics without a lot of technical knowledge. In addition to Google Analytics, tag manager also lets you add a host of other features without the need to mess with your site code.

However, with three different ways to implement Google Analytics, things can get a bit confusing. This isn’t helped by the fact that gtag.js and Google Tag Manager can easily be confused! Despite the similar names, gtag.js and Google Tag Manager are not the same thing, and they are implemented in different ways. We recently had a client that was very confused that their Google Tag Manager settings weren’t working. As you can guess, they hadn’t added Google Tag Manager to their site at all; they were using gtag.js!

If you just want to add Google Analytics tracking to your site and only want to use the default features, gtag.js is a perfectly acceptable way to go. When you set up your Google Analytics account, it will provide the code and instructions on how to add it to your site.

If instead you want to add Google Analytics and include some custom tracking, and maybe integrate other features such as Facebook or Google AdWords conversion tracking, Google Tag Manager may be for you. If you have a WordPress site, the Google Tag Manager for WordPress plugin makes it easy to set this up.

So if you’re ever running into issues getting your Google Tag Manager settings to work, double check to make sure you’ve added the right code to your website!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Work With Us

We've been building websites for over twenty years, and have learned a thing or two about how to make web projects go smoothly.

CLOSE