
When implementing GA4 (Google Analytics 4), using GTM (Google Tag Manager) is the most efficient approach. With GTM, you can manage all your tags centrally without directly editing HTML, making it easy to modify settings and add events.
This article provides a step-by-step guide to connecting GA4 and GTM. Whether you're setting up GA4 for the first time or are unfamiliar with GTM, this guide covers everything from creating a Google Tag to configuring custom events and verifying your setup.
Both GA4 and GTM are free tools provided by Google, but they serve entirely different purposes. GA4 is an analytics tool for understanding user behavior on websites and apps. GTM, on the other hand, is a tag management tool for deploying and controlling various tracking tags.
In short, you configure tracking in GTM and review the results in GA4. Combining both tools enables you to build a flexible and efficient measurement environment.
Without GTM, you need to embed tags directly into the HTML of each page you want to track. With GTM, you only need to install the GTM code across your site once during initial setup. After that, all tag additions and changes are managed entirely within the GTM dashboard.
GTM comes with pre-built tag templates for GA4. Simply fill in the required fields to complete the setup, allowing marketing teams to manage tracking configurations without relying on developers.
GTM saves settings by version. If a tag configuration goes wrong, you can instantly revert to a previous version, minimizing operational risk.
When outsourcing tag setup to agencies or vendors, GTM allows you to share only the tag management interface. There's no need to hand over CMS login credentials, making it much more secure.
Before starting the integration, make sure these two items are in place. First, create a GA4 property by logging into Google Analytics and setting up a web data stream. Second, create a GTM account and container from the GTM website using your site's domain name. Paste the issued GTM code into the head and body sections of every page on your site.
Log into the GA4 admin panel and navigate to Admin > Data Streams, then select your web stream. Copy the Measurement ID (in the format G-XXXXXX). You'll enter this ID in your GTM tag.
Open the GTM dashboard, go to Workspace > Tags > New. Click the tag configuration area and select "Google Tag" from the tag types. This was previously called "GA4 Configuration Tag" but has been renamed to "Google Tag." Paste the Measurement ID from Step 1 into the Tag ID field.
Click the Trigger area at the bottom of the tag configuration screen and select "All Pages." This ensures the GA4 tag fires on every page of your site. If you want to limit tracking to specific pages, create a custom trigger. Click Save when done.
Click the Preview button in the top right of the GTM screen and enter your site URL. Your site will open in a new tab, and Tag Assistant will show a successful connection. If your Google Tag appears under "Tags Fired," the tag is working correctly. If it appears under "Not Fired," review your configuration for errors.
If preview looks good, click the Publish button in the top right. Without publishing, tracking won't start in your production environment. After publishing, visit your site, then open GA4's Reports > Realtime view. If active users appear within the past 30 minutes, the integration is complete.
GA4 automatically collects basic events like page views and scrolls. To track specific user actions such as button clicks, form submissions, or file downloads, add a GA4 Event tag in GTM.
Go to Tags > New in GTM, select "Google Analytics: GA4 Event" as the tag type, and enter your Measurement ID and event name. Then create a trigger specifying the conditions you want to track (e.g., when a specific button is clicked). Verify the tag fires in preview mode, then publish.
GA4 events fall into four categories. Automatically collected events are tracked just by installing the Google Tag. Enhanced measurement events like scrolls and outbound clicks can be toggled on/off in the GA4 settings. Recommended events use Google-suggested names and parameters. Custom events are freely defined based on your business needs. Use GTM's GA4 Event tag for recommended and custom events.
The most common cause is forgetting to click Publish in GTM. Preview mode alone doesn't deploy to production. Also check for typos in your Measurement ID. It may take a few minutes for data to appear in GA4's Realtime report, so wait and recheck.
If you have gtag.js embedded directly in your HTML while also deploying a Google Tag via GTM, data will be counted twice. When managing tags through GTM, remove any GA4 tag code hardcoded in your HTML.
Browser extensions or popup blockers can prevent the connection. Try using Chrome's incognito mode or temporarily disable your extensions.
Connecting GA4 and GTM is an essential foundation for any website's measurement setup. GTM enables centralized tag management, no-code configuration, and safe version-controlled operations.
The process involves five steps: confirm your GA4 Measurement ID, create a Google Tag in GTM, set the trigger to All Pages, verify in preview mode, then publish. Custom events follow the same pattern using GA4 Event tags. Start with the basic Google Tag setup, then add event tracking as needed.

Learn how to create GA4 reports with Looker Studio (formerly Google Data Studio). Step-by-step guide covering data sourc...

A comprehensive guide to Google Analytics 4 covering all major features including event-based measurement, Explorations,...

Learn how to check bounce rate in GA4, how it differs from engagement rate and UA's bounce rate, step-by-step instructio...