You set up GA4 with Google Tag Manager by creating a container, installing its code on your site, adding a Google tag that holds your GA4 measurement ID, and then adding event tags for the interactions you want to track. This guide walks through each step using the exact menus and options available in Tag Manager.
You will learn what Tag Manager does, how to install the container, how to configure the Google tag for GA4, how to build event tags, and how to preview and publish your changes safely.
What Tag Manager Is Used For
Google Tag Manager is a free tool that lets you configure and deploy marketing and analytics tags on your website without editing the site code directly. Instead of hard-coding tracking snippets, you place one Tag Manager container code on your pages. After that, you add, update, or remove tags through the Tag Manager interface, and the container loads them dynamically.
Tag Manager supports tags from Google products (like Google Analytics, Google Ads, and Floodlight) and from third-party vendors. You manage all tags in a container, which is a collection of tags, triggers, and variables. A trigger defines when a tag should fire (for example, on a page view or a button click). Variables hold values that tags and triggers can use, such as a measurement ID or a click text.
You create one container per website or app. Tag Manager offers container types for different platforms: Web for standard sites, iOS and Android for mobile apps, AMP for Accelerated Mobile Pages, and Server for server-side tagging. Server-side containers let you move tag processing off the user's browser to a server you control, which can improve performance.
Tag Manager does not replace Google Analytics. It sends data to GA4, but GA4 is where you analyze that data. Think of Tag Manager as the delivery service and GA4 as the warehouse. For a deeper comparison, see Google Tag Manager Vs Google Analytics: What Each One Does.
Install The Tag Manager Container
Before you can use Tag Manager, you need an account and at least one container. Go to tagmanager.google.com and sign in with your Google account. In the top left, click the Accounts tab, then select Create Account.
In the Account Setup section, enter an account name (usually your company name) and choose the country location. You can optionally check the box to share data anonymously with Google for benchmarking. Then move to the Container Setup section. Enter a container name. For a website, use the top-most URL (like www.example.com). You do not need a separate container for each page.
Select the container type. For a standard website, choose Web. The other options are iOS, Android, AMP, and Server. Click Create and accept the Terms of Service.
After creation, Tag Manager shows you the container installation code. You must add this code to every page of your website, as directed by Tag Manager. If you use a content management system or a framework, follow its method for adding scripts to the head and body.
Once the container code is live, you can add tags through the Tag Manager interface without touching the site code again. To manage multiple websites or apps, return to the Accounts tab, click the menu next to your account name, and select Create Container.
Short on time? Analytics Art can check this in your property for you.
Add The Google Tag For GA4
With the container installed, the next step is to send data to your GA4 property. The recommended method is to add a Google Analytics destination tag.
Before you start, make sure you have a GA4 property and a web data stream. If you haven't set that up, create them in Google Analytics first. You also need at least the Editor role on the GA4 account.
In Tag Manager, open your container. Click Add Tag on the overview page, or go to Tags > New. Name the tag (for example, "Google tag"). Click the Tag Configuration box and select Google Analytics > Google Analytics. In the Tag ID field, enter your GA4 measurement ID (a string starting with "G-"). See Where To Find Your GA4 Measurement ID (G-XXXXXXX) for detailed steps.
Under Triggering, select Initialization - All Initialization Events (or Some Initialization Events if you need to limit where the tag loads). This fires the tag early on every page. Click Save.
The Google tag automatically sends automatically collected and enhanced measurement events if enhanced measurement is enabled in your GA4 data stream.
Optionally, you can configure advanced settings. In the Configuration Settings menu, you can add parameters like server_container_url to route data through a server-side container. You can also set up User Properties by creating a Google Tag Event Settings variable and assigning it to the tag. GA4 allows up to 25 custom user properties per property.
If you prefer the alternate method, you can choose Google Tag as the tag type instead of Google Analytics > Google Analytics. The setup is similar, but the recommended destination tag offers a more unified management experience.
Add GA4 Event Tags
Once the Google tag is in place, you can track specific user interactions by adding GA4 Event tags. These tags let you send custom events like form submissions, button clicks, or purchases to GA4.
To create an event tag, go to Tags > New and name it (for example, "GA4 Event - Signup newsletter"). Click Tag Configuration and select Google Analytics: GA4 Event. In the Measurement ID field, enter your GA4 measurement ID. In the Event Name field, type a name for the event (e.g., signup_newsletter). Use a predefined event name from the GA4 events list if you want to populate standard reports. For custom events, choose a descriptive name following the GA4 naming rules.
Next, define when the event should fire by creating a trigger. Click the Triggering box, then click the + icon. Name the trigger (e.g., "Trigger - Signup newsletter"). In Trigger Configuration, choose All Elements for a click trigger. Select Some Clicks and set the condition: Click Text contains Sign up for the newsletter. This fires the event when a user clicks an element whose visible text contains that phrase. You can also use other trigger types like Page View if the event should fire on a specific page (like a thank-you page).
Optionally, add event parameters to send extra data. To reuse parameters across multiple tags, create an Event Settings variable and assign it in the tag's Event Settings section.
After you preview or publish the container, you can see the event in GA4's Realtime and DebugView reports. DebugView requires additional configuration (see documentation).
Preview, Test And Publish
Before you publish your changes, always test them in preview mode. Tag Manager's preview and debug mode lets you browse your site as if the current container draft were live, without affecting real visitors.
In the Workspace tab, click Preview (top right). Tag Assistant opens in a new tab. Enter your website URL. If your site breaks due to the debug parameter, uncheck Include debug signal in the URL. Click Connect; your site opens in a new window. Click back to the Tag Assistant tab and select Continue to see the debug interface.
The debug interface shows a summary of tags fired on each page, including which triggers fired and what data was sent. As you browse your site, the interface updates. You can inspect individual tags to see their firing status, properties, and any errors. This is where you confirm that your Google tag fires on every page and that your event tags fire only when expected.
You can share a preview session with teammates. In Tag Assistant, click More Actions > Share, enter the domain, and copy the preview URL. Anyone with the link can see the debug interface for that container draft. To preview an older container version, go to Versions in the workspace, find the version, click More Actions, and select Preview.
Once you are satisfied, publish the container. In the Workspace tab, click Submit (top right). In the Submission Configuration section, select Publish and Create Version to go live. Enter a version name and description so you can identify it later. Review the Activity History to see what changed since the last version. Click Publish (top right). To save without publishing, choose Create Version instead. Your changes are now live. For more on Tag Assistant, read How To Use Google Tag Assistant To Test GA4 Tags.
Frequently Asked Questions
What Is Google Tag Manager?
Google Tag Manager is a free tag management system from Google. It lets you add, edit, and remove marketing and analytics tags on your website without changing the site code. You place one container code on your pages, then manage everything from the Tag Manager web interface. It supports Google tags and third-party tags.
What Is The Difference Between Google Tag Manager And Google Analytics?
Google Tag Manager is a tool for deploying tags; Google Analytics 4 is a platform for analyzing data. GTM holds the tracking codes and fires them based on triggers. GA4 receives that data and generates reports on user behavior, traffic, and conversions. You often use them together: GTM sends data to GA4.
How Does Google Tag Manager Work?
Tag Manager loads a container on your site. Inside the container, you configure tags, triggers, and variables. When a user visits a page, the container evaluates the triggers and fires the appropriate tags. For example, an initialization trigger fires the Google tag, and a click trigger fires a GA4 event tag. In a web container, tag logic runs in the visitor's browser. For server-side containers, it runs on a server.
What Is GA4 In GTM?
GA4 in GTM refers to the integration that sends data from your website to a Google Analytics 4 property using Tag Manager. You set up a Google tag (or GA4 Event tags) in GTM with your GA4 measurement ID. GTM then handles when and how those tags fire, sending events and parameters to GA4 for reporting.
What Is Server-Side Google Tag Manager Used For?
Server-side Tag Manager moves tag processing from the user's browser to a server you control, which can improve performance. You configure a server container in GTM and route tags through it instead of sending them directly from the browser.
How Do I Install Google Tag Manager On My Website?
After creating a Tag Manager account and web container, you get two code snippets. Follow the installation instructions provided by Tag Manager. If you use a CMS or framework, follow its method for adding custom code. Once installed, you manage all tags through the GTM interface.
Related GA4 Guides
- Where To Find Your GA4 Measurement ID (G-XXXXXXX)Learn where to find your GA4 measurement ID in the Admin panel, how it differs from property and UA IDs, and where to paste it for GTM, WordPress, Shopify, and gtag.js.
- How To Use Google Tag Assistant To Test GA4 TagsLearn how to use Google Tag Assistant to debug your GA4 tags, check events, and fix connection issues. Step-by-step guide with screenshots.
- How To Add Google Analytics To Your WebsiteAdd Google Analytics 4 to your website: create a property, copy a measurement ID, and install the Google tag. Step-by-step guide for direct, GTM, or CMS installation.
- Google Analytics Admin: Every Setting And Where To Find ItFind every GA4 Admin setting with exact click paths. Learn where to manage accounts, properties, data streams, product links, and user access in Google Analytics.
- How To Add Users To Google Analytics 4Learn how to add users to Google Analytics 4 step by step. Understand roles, data restrictions, and account vs property access. Manage your GA4 users securely.
More in Setup & Tags or browse all GA4 guides.
Official Documentation Used