Trackum

Google Tag or Google Tag Manager: What You Really Need

The Google Tag and Google Tag Manager sound almost the same but are two different tools. Here is how to decide and how to avoid installing them twice.

Guide · · Updated · 6 min read · Written with AI, AI-assisted review on

Google Tag or Google Tag Manager: What You Really Need
📷 Pankaj Patel · Unsplash

The Google Tag is a single code snippet that loads the gtag.js library and sends data to Google Analytics 4 (GA4) and Google Ads. Google Tag Manager is a management tool in which you control many tags from Google and other providers without programming. For a simple site that only uses GA4, the Google Tag directly in the source code is enough. As soon as several platforms, forms, purchases and a cookie banner have to work together, Google Tag Manager is the better choice. In every case, one thing matters: use only one route, or every visit is counted twice.

What is the Google Tag and what does gtag.js do?

Google merged its earlier separate codes for Analytics and Google Ads into one shared code: the Google Tag. Technically, it consists of two parts. The first part loads the gtag.js file from Google’s servers. The second part calls the gtag() function and tells it which tag ID to send data to. A tag ID begins with a different prefix depending on the destination. G-… stands for a data stream in GA4, and AW-… for an account in Google Ads. There are also tag IDs with GT-…, for example for Google tags that bundle several destinations. You find the G- ID of your data stream in GA4, in Admin, in the details of the web data stream.

One Google Tag can serve several destinations. In the settings of the Google Tag, which you reach through the data stream in GA4, you can set, for example, which domains belong to it or which events are detected automatically. The enhanced measurement of GA4, meaning scroll depth, outbound clicks or file downloads, also runs through the Google Tag. For many small websites, that is already all they need.

Setting up the Google Tag: directly in the source code

To set up the Google Tag, you copy the code from the data stream settings in GA4 and paste it into the head section of every page. With WordPress, a plugin often takes care of this, and with Shopify the Google connection in the shop admin does. After that, the site sends page views automatically. Your own events, such as a submitted form, you have to trigger in the code with gtag('event', …), for example gtag('event', 'generate_lead'). That means every new measurement requires a change to the source code, and anyone who does not programme the site themselves needs a developer each time.

Consent under Google Consent Mode v2 can also be implemented directly with gtag. Before loading, you set all values to “denied” with gtag('consent', 'default', …), and after the decision the cookie banner calls gtag('consent', 'update', …). This works, but it is hard to check as soon as more than one or two services are involved.

→ Cookie banner with Consent Mode v2: compliant, with no monthly licence

Google Tag vs. Tag Manager: the key differences

Google Tag Manager does not replace the Google Tag but manages it. In the Google Tag Manager container, you create a tag of the type Google Tag with your tag ID. Google Tag Manager then loads gtag.js for you. You can also create tags for Meta, LinkedIn, Microsoft Ads, TikTok or Pinterest without touching the source code. The differences at a glance:

Google Tag vs. Tag Manager compared
PointGoogle Tag (gtag.js)Google Tag Manager
PlatformsGoogle products only, such as GA4 and Google AdsTags from Google, Meta, LinkedIn, Microsoft, TikTok, Pinterest and others
ChangesIn the page codeIn the interface, with tags and triggers
TestingNetwork tab and DebugView in GA4Preview with every event and every tag
Consentgtag('consent', …) in the codeConsent settings per tag, checkable in preview
Versions and accessNo version list of its ownVersion list, access through user management
SuitsA small site with GA4 onlySites with forms, a shop, advertising and a cookie banner

As a rule of thumb: the more services, events and people involved, the more speaks for Google Tag Manager. One point is often overlooked: the tag ID stays the same in both cases. Whether you install the Google Tag directly or create it as a tag in Google Tag Manager, the data lands in the same GA4 data stream. So you can switch routes later without recreating the property or losing old data. You find the Measurement ID in GA4 under Admin, in Data streams, when you open your web data stream.

When is the Google Tag enough, and when not?

The Google Tag directly in the source code is enough if you only use GA4, run no advertising and are content with page views and enhanced measurement. An example is a small club site or a business card website without a form. As soon as you run Google Ads with conversion tracking, want to count enquiries from forms, have a shop or also use Meta or LinkedIn, the direct route becomes laborious. Every change needs an intervention in the code, and there is no central place where you can see what fires when. For the question of Google Tag Manager or gtag, the answer for most business websites is therefore: Google Tag Manager, with the Google Tag as a tag inside it.

→ Setting up Google Consent Mode v2 correctly: no warning in Tag Assistant

How do you avoid installing it twice?

The most common mistake in how the two work together is double installation. A theme or plugin inserts the Google Tag directly, and in addition a Google Tag with the same ID runs in Google Tag Manager. The result is duplicate page views, distorted engagement metrics and duplicate conversions in Google Ads. Here is how to check: open the page, the developer tools and the Network tab, and filter by gtag/js. In the Initiator column, you can see whether the request comes from gtm.js or directly from the source code. If you see both for the same G- ID, or if two requests to collect with the event page_view arrive per page view, it is installed twice. In the page’s source code, also search for “gtag(” and for your tag ID. Remove the direct installation only once the Google Tag in Google Tag Manager has been tested and published, so that no gap arises.

The switch from a directly installed Google Tag to Google Tag Manager always follows the same order:

  • Create Google Tag Manager and install the code in the page, still without any published tags.
  • In Google Tag Manager, rebuild the Google Tag with the same tag ID and all your existing events.
  • In preview, check that page views and events arrive, with and without consent.
  • Remove the old Google Tag from the theme or plugin and publish the version in Google Tag Manager straight afterwards.
  • The next day, check in the realtime report and in the Network tab that every page view arrives exactly once.

Example: an agency with client accounts

An agency looks after twelve client websites. On half of them, the Google Tag was installed directly over the years, and on the other half everything runs through Google Tag Manager. On three sites both are active, which only becomes apparent when a client asks why GA4 shows twice as many page views as their hosting report. The agency sets a simple rule: every site gets its own Google Tag Manager container, the client is the owner, and the agency has access through user management. Directly installed Google Tags are removed after testing. New platforms are only added as tags in Google Tag Manager. Since then, every change has been documented in the version list, and a change of contact costs no rebuild.

Having the Google Tag set up cleanly

If you are not sure whether your site loads the Google Tag twice, the free Trackum check shows you in two minutes. For a clean rebuild, Trackum sets up Google Tag Manager, GA4 and Consent Mode v2 in your own account, with up to 15 events and tested with and without consent, for €150 excl. VAT. Google Ads or another ad platform can be added as an extra for €50 each.

Frequently asked questions

What is the Google Tag?

The Google Tag is a code snippet that loads the gtag.js library and sends data to Google products such as Google Analytics 4 and Google Ads. It is addressed through a tag ID, for example G-… for GA4 or AW-… for Google Ads.

Do I need the Google Tag if I use Google Tag Manager?

You need the Google Tag as a tag inside Google Tag Manager, but not additionally in your page’s source code. If it sits in both places with the same ID, page views and conversions are counted twice.

Is gtag.js or Google Tag Manager better for data protection?

Both can work with Consent Mode v2. In Google Tag Manager, though, you can set for each individual tag which consent it needs, and check that in preview. This article is not legal advice.

Does Google Tag Manager make my website slower?

Google Tag Manager itself loads a file, and every tag in it can load further scripts. What matters, then, is not the tool but how many tags you use. A lean Google Tag Manager container with a few, cleanly triggered tags keeps the extra load low.

Sources

  1. Google for Developers: Set up the Google tag with gtag.js developers.google.com
  2. Google for Developers: About Google Tag Manager developers.google.com
  3. Google Analytics Help: The Google tag support.google.com
  4. Google Tag Manager Help: Set up Google Analytics in Tag Manager support.google.com
  5. Google for Developers: Set up consent mode on websites developers.google.com
Help