Is gtag.js the same as Google Tag Manager? – Search Engine Optimization (SEO)

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


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.

What Our Clients Say

Watermelon Web Works, LLC place picture
4.7
Based on 19 reviews
powered by Google
OMS Anita profile picture
OMS Anita
22:20 29 Nov 24
Watermelon Web Works has been incredible to work with. They are patient, understanding, and quick to answer any questions (or emergencies) you might have. After switching over to them to help re-vamp our online retail store, we hired them to build our wholesale website as well. I can't recommend them enough - Thank you team!
Garrett Lister profile picture
Garrett Lister
19:55 10 Jul 24
Jared and the watermelon team were great - they quickly interpreted our website needs and designed a wonderful site. The project management site worked great to keep track of project.
N B profile picture
N B
21:23 14 Nov 23
My previous web developer who I was very happy with retired and I was pretty sad about it because it seems now days it is hard to hire a web developer close by with a good set of skills who is interested in helping small business at reasonable prices. Then I found Watermelon and I have been very happy. They are responsive, are able to solve problems, and work at reasonable prices.
Dark Star Magick profile picture
Dark Star Magick
18:05 03 May 23
We hired Watermelon to help us with our website. They were very thorough and took the time to explain in layman's terms what they were doing and how we could improve SEO and site functionality. We will definitely be back for future website needs!
Astoria Column profile picture
Astoria Column
18:42 24 Apr 23
Great work and amazing service! We're a non-profit, and our priorities are always focused on maintaining the Astoria Column. We had a website built by someone else a few years ago, but without regular updating and maintenance, sections of our site were no longer functional. Joanna and the rest of the team came in and had everything working within a week and it's been smooth sailing since then!
Ben Harris profile picture
Ben Harris
19:25 26 Aug 19
Watermelon has been a fantastic web development partner. Through every phase of our project they have always been 100% responsive to our requests and have always provided highly knowledgeable, creative, prompt, and personable team members to work with. As a financial institution we’re always concerned about the security and maintenance or our website and Watermelon has always provided the appropriate resources in order to meet and/or exceed our compliance and security requirements. We would surely refer them to any business associates looking for a qualified WordPress web designer in the future. – Denali Federal Credit Union
Mohr IP Law Attorneys profile picture
Mohr IP Law Attorneys
00:33 11 Apr 19
Watermelon Web Works did a great job creating a custom shopping cart page for our firm. Gavynn in particular was especially helpful and responsive. We appreciated the upfront costs and the technical competency of Watermelon Web Works and would not hesitate to work with the people there again.
Kim Markle profile picture
Kim Markle
23:36 08 Feb 19
Our company has been working with the Watermelon team for more than 10 years to help build and grow our website and customer portal. They are not only extremely talented and responsive, but are continuously looking for ways for us to enhance our current website. They are consistent, provide excellent customer service and really know what they are doing. Highly recommend!
Rick Brodner profile picture
Rick Brodner
23:23 12 May 17
I cannot say enough good things about Watermelon. They are terrific communicators, highly competent coders, and really, really nice people. They were instrumental in helping us to assemble a very usable, easily maintainable website for our organization. They' have demonstrated great flexibility in accommodating our evolving needs. They have been highly responsive to any technical issues, typically resolving them in less than 4 hours. Watermelon Web Works will make your organization better, and your CFO/Treasurer will be happy when they see the bill - what more can you ask for?
CLOSE