How to Set up GA4 with Google Tag Manager in 2024

Google have changed the way we set up Google Analytics 4 (GA4) in Google Tag Manager.

Anyone who is familiar with setting up GA4 will notice that the option for Google Analytics 4 Configuration is no longer available and has been replaced with Google Tag

Having just set up GA4 with Google Tag Manager for a client, I wanted to share with you how to do it in 2024 with step-by-step images so you can follow along. 

This article will cover the following: 

So, Let's set up Google Analytics 4 with Google Tag Manager

To begin with, head over to Google Analytics and click, Start measuring. 

Setting GA4 with Tag Manager

Make sure you’re logged into the right Gmail account that you’d like attached to your Google products. 

Enter your company name, or website name. 

Leave the ticked boxes that are already selected, unless you would like to unselect any specifics – I leave them as they come with the top unselected. 

Setting GA4 with Tag Manager in 2024

Set the name of the property, this is your company name, or blog’s name. 

Make sure you select the correct time zone for your country and update the currency to match. 

The New Way to Setup GA4 with Tag Manager

Set your business details for the industry category and size. 

Setting GA4 with Tag Manager

Set your business objectives for what you’d like to track. 

For the business I am setting this us up for they will not be making sales so I have left this unchecked.

If you are setting up for an ecommerce store make sure to select Drive online sales. 

Setting up new Google Tag

On the popup window, make sure to select the country / region from the dropdown that you are accepting the Terms of Service in.

Tick the box below and select Agree. 

Once you have accepted the Terms you need to select your data stream. 

For websites, and this guide in particular, we will be selecting Web. 

Setting up new Google Tag

Enter the URL for your website and give it a name. 

Make sure the https protocol is selected – this is usually automatically selected but if it is not, choose https from the dropdown. 

Select Create stream

How to set up GA4 in 2024
The New Tag Manager Configuration

You will then be given installation instructions for installing manually or with a website builder or CMS. 

We will be installing manually with Google Tag Manager. 

Create an Account with Google Tag Manager

Make sure you are logged into the same Gmail account that you have started setting up Google Analytics with. 

Go to Google Tag Manager and click Create Account on the right-hand side. 

Creating a Google Tag Manager Account

Enter the account name; this can be your company or blog name or URL. 

Select your country and give your container a name, again, your company name. 

Select the platform you are installing this on, we will be selecting Web. 

Googles New Tag Manager

After you select Create you will have to read and accept the Terms of Service Agreement. 

Tick the accept box and select Yes up in the rop right-hand corner. 

Accept Googles Terms of User Tag Manager

Before you can move onto the next bit, you now need to install the Google Tag Manager code to your website. 

Copy the <head> script by pressing the copy icon in the top right-hand side inside the first box. 

Google Tag Code

Did you know

Google only changed the GA4 configuration early September 2023!

Media Cause

"In early September 2023, Google announced that they would replace the Google Analytics 4 (GA4) Configuration Tag with a new Google Tag. The tag is one of the many changes that Google has made this year—the biggest being the launch of Google Analytics 4 in July 2023."

Adding the New Google Tag to Your WordPress Website

Head over to your WordPress website and log in.

Setting Up Google Tag in WordPress

This next bit is really important as you can cause issues with your website if you get this wrong. 

If you’re not confident doing this yourself, consider having a web developer do this bit however, I will provide step by step guidance for you to follow to make sure you do so correctly. 

Adding Google Tag Manager Code To WordPress

Find Appearance in the left-hand side of your dashboard.

Select Theme file editor from the last option under Appearance on the left. 

Make sure you have the correct theme selected from the dropdown in the top right-hand side.

If you have more than one installed the correct one is the active one. 

Find Theme Header in the right-hand side of your Theme files. 

Copy Header Code

It is good practice to make a copy of your Theme Header code before you make any changes in case you need to revert back. 

I save this in a Word document safely in OneDrive. 

Script 1

Adding First Script

Script 2

Adding Second Script

Adding the New Google Tag Using Elementor

If you are using the Elementor plugin and their templates you will need to add your Google Tag script using their plugin. 

If you add these scripts using the previous method in WordPress Theme files it will not be found by Google. 

Adding Google Tag Manager Using the Elementor Plugin

Find Elementor in the left-hand side of your dashboard. 

Select Custom Code then Add New

Adding Google Tag to Elementor

Set the name of this script so you can differentiate between the <head> and <body> codes later on – I have called this one, Google Tag Manager Head Tag. 

Paste the <head> script in the box. 

In the Location dropdown select <head> and leave the priority set to 1. 

When you select Publish it should automatically have the Condition selected for Entire Site, however, if that is not the case update it to Entire Site and click Save. 

Adding Google Tag to Elementor

Then, paste your <body> script in the text box and give it a name – I have called this one, Google Tag Manager Body Tag. 

This time, in the Location dropdown select <body> – Start and leave the priority set to 1.  

Again, when you select Publish you will need to make sure the Condition is set to Entire Site and click save. 

Testing Your Tag Code Is Installed Correctly

Head back over to your Google Tag Manager tab, enter your website URL and hit Test

If Google successfully picks up your tracking code you will see a green tick in the test box. 

Click OK and you will be brought to your new Google Tag Manager Workspace

Creating the New Google Tag Configuration for GA4

Click New Tag within your Workspace. 

Google Tag Manager Workspace

This is where you’ll notice things are a little different. 

You now need to select Google Tag from the tag types. 

Select Google Tag

In the new window, enter the name of this Tag – I called this the Google Tag Configuration

Google Tag Configuration

To find your Tag ID, head back into your Google Analytics tab. 

Navigate to your Measurement ID in the Web stream details. 

Copy this using the copy icon to the right of the ID and paste in the Tag ID box back in Google Tag Manager. 

Measurement ID Google Analytics

Back in Google Tag Manager, select Initialization – All Pages for the Trigger. 

This will ensure this Tag is the very first trigger, even before other GA4 event tags. 

Click Save in the top right-hand corner. 

Now it’s time to test everything is working. 

Test and Debug Google Tag

Click Preview from the options along the top of your Workspace. 

In the popup window enter your website URL and click Connect

Test and Debug Google Tag

In the left-hand side of the debug window you should see the Initialization Tag fire.

If you click on this you will also see it was successful in the Tags Fired Output

Finally, notice Google Tag and Google Analytics appear along the top, this also confirms that both have fired correctly. 

Preview and Debug Google Tag

As a final check, you can also look inside your new Google Analytics under the Real Time report and look for a new Page View hit. 

You can now click Submit along the top right-hand side to publish your changes and make this live. 

Submit New Tag

You will then be brought to this screen. 

To get back to your Workspace click on the X on the top left-hand corner. 

Published Container Tag Manager

You can go back to your Google Analytics page and hit Next. 

Finish Set Up In GA4

It will then show that data collection is pending. 

Click Continue to Home and then you will be asked for your email communications preferences. 

Data Pending

Select whichever settings you’d like to hear about and click Save

Email Preferences Google Analytics

You’ll see a hit in your Google Analytics which tells you that everything has set up correctly. 

Google Analytics is Collecting Data

And that’s it!

This will connect the new Google Tag with Google Analytics and allow you to add future code to your website quickly in future. 

If you don’t see any data in your new Google Analytics dashboard, come back in a day or two as it can take up to 48 hours for data to start flowing. 

What Does the New Google Tag Track?​

This new Google Tag allows for more accurate, automatic tracking, such as: 

  • Page views: Detect a page view event each time a page loads. 
  • Page view on browser history change: Detect a page view event each time the website changes the browser history state. 
  • Scrolls: Detect scroll events each time a visitor gets to the bottom of the page. 
  • Outbound clicks: Detect an outbound click event each time a visitor clicks a link and is taken to a different domain from your website. 
  • Form interactions: Detect a form interaction or form submission event each time a visitor interacts with a form on your website. 
  • Video engagement: Detect video play, video progress, and video complete events as visitors view embedded videos on your website. 
  • File downloads: Detect a file download event each time a link is clicked with a common document, compressed file, video, application, or audio extension. 

If you’re interested in setting up custom event tracking for Google Analytics I will be updating this blog soon with steps on how to do that soon. 

Don't forget to share this post!