Skip to main content

Conversion Uplift

The Google Tag in Google Tag Manager

How to Configure the New Google Tag and Variables in Google Tag Manager

The Google Tag plays a crucial role in setting up Google Analytics 4 within Google Tag Manager (GTM). Understanding the fundamentals of how to correctly configure this Tag in GTM is essential for effective tracking and analytics. This blog assumes you already use Google Tag Manager to deploy GA4. If not, please read our blog on how to migrate Google Analtyics to GTM.

The Google Tag should fire before pageview events, especially if you want the Google Tag’s settings to apply to the event tags.

To learn more about how to implement and configure the Google Tag, you can either watch our video here or you can read the blog below.

Understanding the New Google Tag Message in GTM

You may have seen this message in GTM: “Your Google Analytics GA4 Configuration tags are now Google tags with new capabilities, including settings variables. Your existing measurement has not changed, and no action is required.”

While partly correct, to fully utilise these new tags and variables, there will need to be some changes. Let’s dive into your GTM container for a detailed walkthrough.

Navigating the Google Tag Manager Container

In your GTM container, use the search icon to find the Google Tag. Even if not named Google Tag, it appears because that’s now the type of tag.

Step-by-Step Guide to Configuring the Google Tag

1. Renaming and Reviewing the Tag

First, rename your Config Tag to the “Google Tag”. Click into the tag to see if send_page_view is set to false, meaning no page view is sent with this tag. If it is set to “true”, it originally fired a page view with the Config tag. However, if you also have a separate page_view event, and the Google Tag is set to send a page_view event, this will result in duplicate page_view events.

Create a separate page_view event in GTM so that you do not rely on the Google Tag to fire the page_view event. This is because the sequence and timing of events can be critical to get the optimal event tracking configuration. For example, the Google Tag should always fire before a page_view event. But the page_view event may have to be aligned with certain dataLayer events (e.g. login event) to ensure user status is up-to-date. It is best to have a separate page_view event.

For server-side GTM users, you’ll see “server_container_url” has been automatically added to the Google Tag.

2. Changing the Tag ID to a Variable

Consider changing the tag ID to a variable. This allows you to more easily add the measurement ID to each tag and event in GTM. Go to Variables > User-Defined Variables, and create a new constant variable. Add the measurement ID for the GA4 Property as the value and save. You can then add the variable to all tags and events instead of manually pasting the measurement ID into the tag ID field. For multiple environments, use a lookup or RegEx table to define the measurement ID for each environment.

3. Configuring Settings Variables

Next, check the configuration settings variable. Create a new variable to easily add settings to any Google tags. Name it Configuration Settings or GTAG, then add parameters like send_page_view (false) and UTM parameters. Save the variable, then remove duplicated parameters from the parameters section. Google has a list of valid parameters for the configuration settings variable..

4. Setting Up Event Settings Variables

Look at the event settings variable. If not created, set up a new variable. Add all your custom parameters like client_id, session_id, content_group, custom_timestamp, page_location, browser_language and so on. Save the new variable and add it to all your event tags. This simplifies sending custom parameters with event tags. You can delete any of these parameters that were previously added to individual GA4 events.

Google provides documentation on valid parameters for the events settings variable. However, this does not prevent you from adding your own custom parameters.

Configuring Individual Events in GTM

Now, save the Google Tag and configure individual events. Check each GA4 event, ensuring the shared events settings variable is added. Remove unnecessary user properties from the event itself.

For pageview events, ensure parameters are added via the shared events settings variable. Set your tag sequence to fire the Google Tag before page_view events. This ensures the Google Tag fires first, especially important for single-page applications.

Summary of Key Steps

Here you will find a link to an excellent article by Simo on Google Tag implementation.

Finally, to summarise:

  1. Fire the Google Tag early on initialization or consent initialization.
  2. Set up a tag sequence to ensure it fires before pageview events.
  3. Create new configuration settings and event settings variables.
  4. Remove redundant parameters from event tags.
  5. Add user scoped parameters to the event settings variable.

By following these steps, you’ll optimise your use of the new Google Tag and variables in Google Tag Manager. Thanks for watching. You can watch more of our YouTube videos here, or you can find more of our articles about Google Tag Manager here.

Neal Cole

Neal Cole

Neal is the founder of Conversion Uplift and the author of the official GA4/GTM audit course for CXL. It's the course much of the industry trains on. He's spent over 20 years in digital analytics, including senior roles in online gaming and financial services, working out where businesses' numbers go wrong and what it costs them. His work now focuses on server-side tracking, GA4 and BigQuery: getting the data right, and being the person who's accountable for it when a decision depends on it.
Neal Cole

Neal Cole

Neal is the founder of Conversion Uplift and the author of the official GA4/GTM audit course for CXL. It's the course much of the industry trains on. He's spent over 20 years in digital analytics, including senior roles in online gaming and financial services, working out where businesses' numbers go wrong and what it costs them. His work now focuses on server-side tracking, GA4 and BigQuery: getting the data right, and being the person who's accountable for it when a decision depends on it.
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

Free audit checklist to

Fix GA4 Tracking Like a Professional

Acceptance
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

Free audit checklist to

Fix GA4 Tracking Like a Professional

Acceptance