Setting up Google Analytics 4 with Google Tag Manager

Katie Holmes
21st June 2023

Set up Google Analytics 4 with Google Tag Manager and generate more accurate insights into your website visitors and marketing performance.

Google Analytics and Google Tag Manager are two tools you often hear when it comes to marketing measurement. But what do they do, and how can they work together to generate better marketing and website insights?

Whether you’re new to Google Analytics and GTM or just need a refresher, this guide can put you on the right track towards setting up and configuring the two platforms.

Here’s what you’ll learn: 

💡 Pro Tip

Google Analytics isn’t the only kid on the block when it comes to tracking your visitors and conversions. There are other options like Ruler Analytics. Unlike GA4, Ruler tracks your data on a visitor level, allowing you to successfully attribute leads and revenue across multiple sessions, campaigns, ads, keywords and more.

Book a demo to see Ruler’s features in action 

What is Google Tag Manager and how does it work with GA4?

Google Tag Manager (GTM) is a centralised platform that allows you to add and manage tracking codes on your website without having to dive into the source code. 

Google Tag Manager has two parts: Triggers and Tags. 

Triggers define what actions you want to monitor, such as a single page view, click, scroll, video view or form submission. Tags receive input from Triggers and send the data to other services, such as Google Analytics, Google Ads, etc. 

Google Tag Manager uses a single code snippet that you add to your site. This code acts as a container for all the tags you want to manage. 

When a trigger is initiated, a tag will fire. Let’s say you use Google Tag Manager to manage Google Analytics. GTM could fire the Google Analytics script whenever a user visits a specific page on your website.

Here are some reasons why you might want to use Google Analytics 4 with Google Tag Manager:

What can you do with GTM and GA4 once it’s set up?

Here are some of the things you can do once you set up Google Tag Manager.

  1. Create custom tracking options
  2. Revenue tracking in GA4
  3. Recycled container templates

1. Create custom tracking options

Google Analytics 4 automatically tracks some site interactions that previously required custom setup in Universal Analytics. 

Related: GA4 vs Universal Analytics: 8 Key Differences

Enhanced Measurement can be enabled in Google Analytics 4 to fire events for interactions such as page views, button clicks, and form submissions.

💡 Important note

You can configure enhanced measurement directly in your Google Analytics 4 account. Go to Admin, Data Streaming and click Web Stream. Click on your desired Web Stream. Navigate to Enhanced Measurement and toggle enhanced measurement on/off. 

While these events provide some insights into user behaviour, they are limited in their scope. 

Related: Complete guide to events in Google Analytics 4

Let’s take scroll, for example. The scroll tracking option in Google Analytics 4 only triggers a “scroll” event once the user reaches the 90% point of the page. You can’t track when a user starts to scroll to earlier points on the page.

Google Tag Manager has more sophisticated tracking capabilities. In GTM, you could create custom events that fire when a user reaches a specific point on the page, such as 25%, 50%, 75%, etc.

3. Revenue tracking in GA4

Google Tag Manager allows you to track revenue in Google Analytics 4 by creating custom events that fire when a purchase or specific action is completed. 

Related: How to track marketing revenue in Google Analytics

This lets you see which traffic sources are driving the most revenue, allowing you to allocate resources and optimise your marketing spending more effectively.

While Google Analytics provides valuable insights into your revenue transactions, products sold, and customer demographics, it is built with eCommerce in mind. 

Businesses that generate leads for their sales pipeline shouldn’t rely solely on revenue tracking in Google Analytics. 

Lead generation businesses typically collect contact information through forms. When a visitor submits a form, they provide their contact information, such as their name, email address, and phone number. 

Google Analytics is prohibited from collecting personally identifiable information, so this data goes unrecorded. 

Related: 6 limitations of Google Analytics 4 and how to overcome them

Without this data, it can be challenging for marketers to identify leads and establish the actual revenue impact of their marketing efforts. This reporting gap has prompted lead-generation businesses to use marketing attribution tools instead.

Take Ruler Analytics, for example. Ruler can track each and every lead across the customer journey, from the initial touchpoint to the final conversion, and automatically attribute revenue back to your traffic sources, marketing campaigns, landing pages and more. 

💡 Pro Tip

We have plenty more content on how Ruler attributes revenue to your marketing. If you want to cut to the chase and see it in action, your best bet is to book a demo and get a more in-depth look at how it works.

Book a demo and see how Ruler attributes revenue 

Container templates that can be reused

Google Tag Manager allows you to export all tags, triggers, and variables into a single file. 

This means you can create templates with commonly used tracking codes and settings, which is especially useful for agencies that have to implement standard Google Analytics events repeatedly for clients.

For example, you could create a template for tracking page views, another for tracking outbound link clicks, and so on. Then, when you need to implement these events on a new website, you can simply import the template and save time.

How to setup Google Analytics with Google Tag Manager

Setting up Google Analytics with Google Tag Manager is easy when you know how to do it. 

By following the steps below, you can seamlessly integrate these powerful tools to track user behaviour, measure key events, and optimise your marketing strategies for better results.

So, let’s not waste any more time and dive straight in. 

Important note: If you already have a Google Analytics 4 property and a Google Tag Manager account, you can skip to step three. 

1. Create a GA4 Property & Data Stream

To create a new GA4 property, go to the Admin section of your Google Analytics interface and click Create Property.

This will open the Google Analytics 4 property setup wizard where you can name your property, select the reporting time zone, and choose the currency of your business.

To provide a better experience, Google will ask for more information, such as your industry, business size, and what you plan to do with GA4. Providing this information is optional, but it is recommended. Doing so will help Google personalise your experience and provide more relevant insights.

After clicking the Create button, you will be prompted to select a data source, also known as a data stream. You can choose from Web, Android App, or iOS App.

For this example, we picked Web. To create a Web data stream, you will need to provide information about your website, such as the URL, stream name, and enhanced measurement settings. Once you have provided this information, click the Create stream button.

After creating your data stream, you will see your Measurement ID. Make sure to copy it down, as you will need it to set up your Google Analytics tracking in Google Tag Manager.

Once you have verified that your property is set up correctly, you can go ahead and set up your Google Tag Manager account.

2. Create a Google Tag Manager account 

To create a new Google Tag Manager account, sign in to the Google Tag Manager and click Create Account on the right side of the page.

Enter the relevant information, including your account name, country, container name and target platform (e.g. Web, iOS, AMP, Android, Server). For this example, we chose Web as our target platform.

Once you click on the Create button and accept the terms of service agreement, your account will be created and you will be given the GTM code snippet that needs to be installed on your website. The code snippet will look something like this:

Once you install the Google Tag Manager code on your website, you can use it to manage all of your tracking tools without having to modify your website’s code again. And you’re now ready to create your GA4 tag and triggers.

3. Setting Up Google Analytics 4 With GTM

Now that you have set up your GA4 property and GTM account, you can install Google Analytics 4 with Google Tag Manager and create custom tags and triggers to track specific events on your website.

In the Google Tag Manager interface, click on the Tags tab in the left navigation and click on the New button.

Give your Tag a name. In the Tag Configuration section, select the “Google Analytics: GA4 Configuration” tag type from the list. 

Remember the Measurement ID that you copied earlier when you first set up the data stream in Google Analytics? You’ll need to paste that code into the Measurement ID box in Google Tag Manager. Once complete, hit Save.

Now it’s time to set up the Trigger. For the configuration tag, select All pages and click Save. You will be taken back to your Google Tag Manager Workspace. Click the Submit button in the top right corner to publish your changes.

That’s all there is to it. After publishing your changes, you will see a confirmation screen. You’ll be able to see a summary of your published tag and any details associated with it.

4. Verify your GA4 tracking

To test your Google Analytics 4 setup, follow these steps.

In Google Tag Manager, click Preview. Enter your website’s URL in the Enter URL to preview field. Click Connect.

Your site will open in a new tab. The GA4 Config tag should have fired, if set up correctly. You can click on the tag to see more details.

Final thoughts on GTM and Google Analytics 4

Google Tag Manager and GA4 offer a powerful combination for tracking and optimising website and marketing performance. 

By harnessing the flexibility of Google Tag Manager and the advanced features of GA4, businesses can generate valuable data on user behaviour and engagement

When paired with a marketing measurement tool like Ruler Analytics, marketers can get deeper insights into the revenue impact of each traffic source and make more informed decisions about where to allocate their budget.

Listen to what others have to say. See how Totalmobile used Ruler to increase their return on ad spend by over 23%. Or book a demo to get a glimpse of the Ruler platform and see how it can help evidence your impact on revenue.