How to Set Up GA4 with Google Tag Manager

- Tuesday, December 23, 2025

In the ever-evolving world of digital marketing, data is the new gold. To stay ahead of the curve, transitioning to Google Analytics 4 (GA4) isn't just an option it's a necessity. But how do you ensure your data is accurate and your setup is scalable? The answer lies in Google Tag Manager (GTM).

Google Analytics 4 (GA4) has become the standard for tracking web and app analytics, giving businesses a powerful way to understand user behavior. But installing GA4 correctly is key to getting accurate data. In this guide, we'll walk through exactly how to set up Google Analytics 4 (GA4) using Google Tag Manager (GTM) from creating accounts to firing your first analytics tag.

How to Set Up GA4 with Google Tag Manager

Why Use Google Tag Manager for GA4?

Before we dive into the "how," let's talk about the "why." Using GTM allows you to manage all your tracking codes (tags) in one place without manually editing your website's code every time you want to add a new event or platform. This flexibility is crucial for brands looking to maintain a clean codebase while scaling their marketing efforts.

Step 1: Secure Your GA4 Measurement ID

The foundation of your setup is the GA4 Measurement ID. To find this:

  1. Navigate to your Google Analytics Admin panel.
  2. Select Data Collection and Modification > Data Streams.
  3. Choose your web data stream and copy the Measurement ID (which typically starts with G-).

Step 2: Install the GTM Container

If you haven't already, you must install the GTM container code on your website. This consists of a JavaScript snippet placed in the <head> of your site and a non-script version placed after the opening <body> tag. For modern web development, ensure the head script is placed as high as possible to capture data early.

Step 3: Create a Constant Variable in GTM

As an experienced marketer, efficiency is key. Instead of pasting your Measurement ID into every tag, create a Constant Variable.

  • In GTM, go to Variables > User-Defined Variables > New.
  • Name it {{GA4 Measurement ID}}.
  • Choose Constant as the variable type and paste your ID.

Step 4: Configure the Google Tag

Now, let's create the actual tag that sends data to GA4:

  1. Go to Tags > New.
  2. Name your tag something descriptive, like GA4 - Configuration - All Pages.
  3. In Tag Configuration, select Google Analytics > Google Tag.
  4. Use your newly created variable for the Tag ID.
  5. Set the Trigger to Initialization - All Pages. This ensures the tag fires before other elements, improving data accuracy.

Step 5: Test and Debug

Never publish without testing. Use GTM's Preview Mode to open your site in Tag Assistant. Verify that your GA4 tag fires successfully. Additionally, check the DebugView in Google Analytics to confirm that events are being received in real-time.

Conclusion

Setting up GA4 via Google Tag Manager is a fundamental step for any brand serious about its digital presence. It provides the infrastructure needed for reliable data collection and the agility to add complex tracking in the future. Once your configuration tag is live, you are ready to start tracking custom events, conversions, and more.


Get latest updates in your inbox

Copyright © Orion Technology News 2026. All Rights Reserved.