The Basics of Google Tag Manager Set Ups for GA4

Navigating the world of web analytics and data can seem daunting, but tools like Google Tag Manager (GTM) make it far more accessible. GTM acts as a centralized dashboard for managing all the tracking codes (or “tags”) on your website, from Google Analytics 4 (GA4) to Facebook Pixels and more. Using GTM to implement GA4 is considered a best practice for its efficiency, flexibility, and control. This guide will walk you through the fundamental steps to get started.

Step 1: Set Up Your GA4 Property

Before you do anything in GTM, you need a GA4 property to send data to. If you haven’t already, go to Google Analytics and create a new GA4 property. During this process, you will create a “Data Stream” for your website. This is crucial because it’s where you’ll find your Measurement ID, which is a unique identifier (it looks like G-XXXXXXXXXX). This ID is the key to connecting your website to your GA4 property and is the first piece of information you’ll need.

Step 2: Create a GTM Account and Container

If you don’t have one, go to the Google Tag Manager website and create a new account. GTM uses a hierarchy: an “Account” can contain multiple “Containers.” A container is what holds all your tags, triggers, and variables for a single website or app. Name your account and container appropriately (e.g., “[Your Business Name] GTM Account” and “[Your Website Name] Container”). Select “Web” as the target platform.

After creating your container, GTM will provide you with two snippets of code. One goes in the <head> section of your website’s HTML, and the other goes in the opening <body> tag. This is a one-time setup. Once this code is installed, you can manage all your tags and tracking from the GTM interface without ever touching your website’s code again—a major benefit.

Step 3: Create the Google Tag in GTM

Now, it’s time to create the tag that will connect your website to GA4. In your GTM workspace, click on “Tags” in the left-hand menu and then “New.”

  • Name Your Tag: Give it a clear, descriptive name like “GA4 Base Tag” or “Google Tag.”
  • Tag Configuration: Choose “Google Analytics” from the list of tag types, and then select “Google Tag.” This is the modern replacement for the older “GA4 Configuration” tag.
  • Enter Your Measurement ID: This is where you paste the Measurement ID you copied from your GA4 property in Step 1.

Step 4: Configure the Trigger

The “Trigger” tells GTM when to fire your tag. For your GA4 base tag, you want it to fire on every page of your website to capture basic pageview data.

  • Triggering: Click on the “Triggering” section of your tag.
  • Choose a Trigger: Select the pre-built “Initialization – All Pages” trigger. This ensures the tag loads as soon as possible on every page of your site.

Step 5: Test and Publish

Before your changes go live, you should always test them.

  • Preview Mode: Click the “Preview” button in the top right corner of GTM. A new tab will open, and you can connect to your website.
  • Debug: As you navigate your site, the GTM Debugger will show you which tags are firing. You should see your “GA4 Base Tag” firing on every page. You can also check the “DebugView” in your GA4 property to see real-time data streaming in.
  • Publish: Once you’ve verified everything is working correctly, go back to GTM and click the “Submit” button. Give your version a name (e.g., “Initial GA4 Setup”), and hit “Publish.”

By following these steps, you’ve not only set up GA4 but also laid the foundation for a more robust and scalable data collection strategy for your website. Need help? Contact us today.

Share This Story
ga4google analyticsgoogle tag managergtm