How to Setup Google Analytics 4 with Google Tag Manager

2022/03/122 min read
bookmark this
Responsive image

Table of Contents

  1. Introduction
  2. Create GA4 Property
  3. Create New Google Tag Manager Container
  4. Install Google Tag Manager into Your Site
  5. Add Google Analytics GA4 Configuration
  6. Conclusion

Introduction

This page shows an example of how to set up Google Analytics 4 with Google Tag Manager. Please be aware that Google Universal Analytics will no longer process new data beginning July 1, 2023. You'll need to switch to a Google Analytics 4 Property.

Create GA4 Property

Here, we'll create a GA4 property. If you have an existing account with the old Universal Analytics, you can use the same account, create a new property, and use the GA4 Setup Assistant to set up GA4. GA4 Setup Assistant

Choose the option to create a new Google Analytics 4 Property. Create GA4 - Get Started

Click Create Property to create a new GA4 property. Once you create a GA4 property, make a note of the measurement ID, because we'll need this value later when adding it to Google Tag Manager. Create GA4 Property

Create New Google Tag Manager Container

Here, create a new Google Tag Manager container under your account. GTM Code Snippet

Install Google Tag Manager into Your Site

Then go to the admin section and follow the instructions to use the code snippet and add it to your site. Once you add the Google Tag Manager code to the site, you can later configure additional tags or scripts to load on the site.

Here, add a new tag and add the Google Analytics GA4 Configuration. GTM - GA4 Configuration

Add Google Analytics GA4 Configuration

Add the GA4 measurement ID, so Google Tag Manager's GA4 configuration will connect to the new GA4 Analytics measurement ID. GTM - GA4 Configuration with Measurement ID

Now, if you load the page with the GTM script you added earlier, it should load the script for GA4 to start collecting default data and sending it to Google Analytics, such as page views.

Conclusion

Setting up GA4 with Google Tag Manager is straightforward: create a GA4 property, set up a GTM container, install the GTM snippet on your site, and configure the GA4 tag with your measurement ID. This approach gives you the flexibility to manage your analytics configuration without modifying site code directly.