GA4 set up through Google Tag Manager

June 5, 2026

If you’re looking to add GA4 to your site, Google Tag Manager (GTM) is often the best approach.

Let’s take a look at how to do it.

Table of Contents

Key Takeaways

  • Developer Freedom: Using a tag manager removes the constant need for technical engineering support when changing web tracking.
  • The Constant Shortcut: Creating a constant variable for your GA4 measurement ID prevents errors and saves configuration time down the line.
  • Better Debugging: Adding your container ID to shared event settings gives you immediate clarity on where your marketing data originates.

Why implement GA4 Through Google Tag Manager?

While it is entirely possible to paste a tracking script straight into your website header, managing analytics directly through Google Tag Manager offers three distinct advantages for digital marketing teams:

  1. Reduced Developer Dependency: Once the main container script is on your site, you can deploy or alter marketing tags without needing a code deployment cycle.
  2. Centralised Tracking Tools: Keeping your pixels, heatmaps, and analytics tags inside a single dashboard makes your entire marketing setup far easier to audit.
  3. Simpler Consent Management: Handling privacy frameworks and user cookie choices is significantly less complicated when built directly through a centralised tag system.

Step 1: Where Is That Measurement ID?

Before opening your tag container, you need to grab your specific measurement ID from your analytics account.

Log into your GA4 property and use one of these two methods to find it:

  • The Quick Search: Type “tracking” into the global search bar at the top of the interface to display your ID immediately.
  • The Admin Path: Go to Admin, select Data collection and modification, and click on Data streams. Select your web data stream from the list.

Keep an eye out for the specific formatting: you are looking for the alphanumeric string that starts with G-, not the stream ID. Copy that code to your clipboard.

tracking in Search Box

Step 2: How Do You Configure the Google Tag?

Head over to your tag management container dashboard.

Click on New to bring up a fresh tag setup panel.

Click inside the Tag Configuration box.

Because both systems belong to the same ecosystem, you will see Google Analytics listed prominently near the top of the featured list.

Select Google Analytics, and you will be met with a couple of choices.

You want to select the Google tag option.

The other option, the GA4 event tag, is strictly for tracking specific user actions later on.

Adding a Google Tag via GTM

Using a Constant Variable

You could simply paste your measurement ID straight into the empty tag field. However, a smarter trick is to turn that ID into a reusable variable:

  1. Click the small building icon next to the Tag ID input field, then click the + (plus) icon in the top right.
  2. Click Variable Configuration and choose Constant as the variable type.
  3. Paste your G-dash measurement ID into the value box.
  4. Name it clearly, such as constant – ga4 – [Your ID], and click save.

By setting this up as a constant, you will never have to dig back into your analytics settings to find the tracking code whenever you build a new custom event tag in the future. It is right there waiting for you.

Constant in GA4 Event

Step 3: Triggers

Scroll down to the Triggering options.

By default, the system will look to fire this tag on Initialization – All Pages or Initialization – Pages.

Leave this exactly as it is.

It is highly beneficial for your core analytics tag to fire as early as possible during the page load cycle so you do not miss hasty visitors who bounce quickly (or other events firing quickly too).

Setting Up for the Future 

 

Before saving, look at the Shared event settings section.

This feature allows you to set default variables that automatically attach themselves to every single analytics event sent by the tag.

Debugging

A highly effective practice when starting out is to add a row for your container_id using the built-in system variable.

Adding an event settings variable

Why bother doing this? It makes troubleshooting incredibly straightforward.

If you are debugging your data later on and spot an event missing that specific container ID parameter, you instantly know that piece of data is leaking from somewhere else on the site and isn’t originating from your tag manager.

You can also use this area later down the line to standardise your content groups across the entire domain.

To wrap things up, name your tag using a clean, standardised format like GA4-configuration, hit save, and then click Publish in the top right corner of your dashboard to make the changes live on your website.

Frequently Asked Questions

Can I find my measurement ID if I have multiple data streams?

Yes. When you visit the Data streams menu within your admin settings, you will see a list of all active streams for that property. Simply click on the specific web stream you are currently configuring to view its unique G-dash code.

Should I change my configuration trigger from Initialization to All Pages?

There is generally no need to change it. Initialization ensures that the tracking script loads at the earliest possible moment during the browser session, which helps capture precise page view data.

What is the difference between a Google tag and a GA4 event tag?

The Google tag acts as the foundational base layer that connects your website to your analytics property. The GA4 event tag is a secondary element used to track distinct, isolated interactions, such as button clicks, file downloads, or video plays, after that primary foundation is established.

Kyle

Author

Hello, I'm Kyle Rushton McGregor!

I’m an experienced GA4 Specialist with a demonstrated history of working with Google Tag Manager and Looker Studio. I’m an international speaker who has trained 1000s of people on all things analytics.

Scroll to Top