Notification

G Suite is now Google Workspace: everything your business needs to get work done.

[GA4] Configure Google Analytics 4 in Google Tag Manager

This article is for users who want to maintain their Google Analytics 4 tags within Google Tag Manager. This article covers what you need to do so a Google Tag Manager web container sends events to GA4.
For more information on setting up GA4, refer to Set up Analytics.
The Google Analytics: GA4 Configuration tag is now the Google tag

If you were using GA4 configuration tags, they have been automatically upgraded to the Google tag. Your measurement and capabilities will work just as before and you don’t need to take any action.

Your GA4 event tags stay the same.

Google Tag Manager allows you to set up and manage GA4 events all in one place. To send event data from Google Tag Manager to GA4, you need two tags that work together:

  • Google tag
    The Google tag establishes the data flow from your website to Google Analytics and other destinations you might have set. Create one Google tag per domain and place it on every site that you want to measure.
  • Google Analytics: GA4 Event
    The GA4 Event tag lets you set up events on your website without writing code. The event data shows up in your GA4 reports.
    Create as many event tags as you need to measure your recommended or custom events.

Diagram that shows how Google Tag Manager relates with your website or app and Google Analytics 4. The Google Analytics Configuration tag ensures data flow from your website to Google Analytics. The Events tag lets you set up events without writing code.

This article shows you how to set up the GA4 Configuration tag.

How the Google tag works with GA4

The Google tag loads your Google Analytics 4 property on a particular page by:

About parameters

A parameter is a key-value pair (e.g., 'currency': 'USD') that provides additional information about events or configuration settings on your page. The Google tag sends event parameters with automatically collected and recommended events already.

If you need more information about an event, you can add parameters. You can look up pre-defined parameter names or create a custom parameter, if you need it.

For example, when someone adds a product to a shopping cart, the Google tag sends an add_to_cart event. To get more detailed data on the item, you can encode parameters for that event, such as the product name, and price.

Share parameters across tags

To keep data consistent across all your tags, you can configure shared parameters using configuration and event settings variables. The Google tag can inherit parameters from a settings variable like measurement IDs, user ID, and many more.

GA4 Event tags inherit the parameters of the Google tag. Parameters set by the Google tag remain static for all events occurring on a page. The parameters are refreshed only when the Google tag fires again, typically the next time the page is loaded.

If a GA4 Event tag has a parameter with the same name as a Google tag parameter, the GA4 Event tag parameter value will override that of the Google tag, but only for that event. All other GA4 Event tags that do not have the same parameter name will continue to reference the parameter value initially set by the Google tag.

Before you begin

This guide assumes that you've done the following:

It also assumes that you have the following:

  • Access to the Tag Manager container for the website
  • The Editor (or above) role to the Google Analytics account

Set up the Google tag

Step 1: Create a Google tag

Start by creating a Google tag to send data to your Analytics property.

  1. Open Google Tag Manager
  2. Select the container you want to configure. Open the Tags menu.
  3. Create a New tag. Enter a name for the tag at the top (e.g., "Google tag configuration - example.com").
  4. In the Tag Configuration box, select Google tag.
  5. Configure your tag. In the field Tag ID, enter your Google tag ID.

    Where is my Google tag ID?

    You can find your Google tag settings within Google Ads, Google Analytics, and Google Tag Manager. Log in to a product and follow the instructions to view your tag ID:

    Google Ads instructions

    Google Analytics instructions

    1. Open Google Analytics.
    2. Go to the Admin screen.
    3. In Data Streams, click on a stream to see details.
      Result: Your screen should show you the Google Analytics settings and the Google tag settings.Screenshot of the Google Analytics 4 data stream settings. The Google tag settings are located in the data stream settings

    Google Tag Manager instructions

    Note: To see Google tag IDs in Google Tag Manager, you need to manage a Google Ads, Analytics or Google tag in a container.

    1. Open Google Tag Manager.
    2. Click on the tab Google tags to see Google tags you have previously set up.
      Google tag overview in Google Tag Manager
    3. Click on the tag name to edit the Google tag settings.
  6. Optional: You can set up additional configuration options to govern how your Google tag communicates with its destinations. If you set up the Google tag and want to keep all its default settings, you can now skip to Step 2: Create a trigger.

Optional settings

Global parameter settings

If you need to establish common context across several Google tags, you can specify global parameters using gtag.js directly on your website.

Global parameters are read by all Google tags on your website. Use this option only for non-sensitive data.

Learn how to reuse parameters across multiple tags, in the developer documentation.

Configuration settings

You can specify additional configuration parameters that influence the Google tag settings.

To reuse configuration across Google tags, create a configuration settings variable.

Shared event settings

You can specify additional parameters that are sent with every event, for example the currency of a price. Event parameters are only valid for the tag you add them to.

To reuse event settings across Google tags, create an Google Tag Event Settings variable. Use recommended event parameter names so that Google Analytics can populate dimensions and metrics for you.

Send data to a tagging server

Server-side tagging allows you to move some tags off of your website or app and onto a server instead, which allows you to improve performance. Learn more about server-side tagging.

To send all events to a Tag Manager server container instead of Google Analytics, you need to configure the following parameter:

  1. Open the Configuration settings menu.
  2. Set up the server container URL by adding a new configuration parameter:
    • Name: server_container_url
    • Value: Set to the server container URL of your Tag Manager server container

Result: Your configuration parameters should look like this:Screenshot of a server-side tagging implementation in the Google tag.

Set up user properties

User properties are attributes that describe groups of your user base, such as their language preferences or geographic locations. You can use user properties to define audiences.

For example, you can set a user property called favorite_food, which you can use to record each user's favorite food. You can use the data to segment users by their favorite food.

Analytics automatically collects some user dimensions so you don't have to define user properties for them. You can set up to 25 additional user properties per Google Analytics 4 property.

To measure custom user properties you need to create a new Google Tag Event Settings variable and then assign it to the Google tag.

7. Save your Google tag.

Step 2: Create a trigger

Next, set up a trigger to load the Google tag when someone loads your website.

  1. To ensure that the Google tag fires before other triggers, click Triggering and use the Initialization - All pages trigger. Learn more about Page triggers.
  2. Name the tag and Save the tag configuration.

Result

Your tag configuration should look like this:

Screenshot of the finished Google tag setup

Step 3: Verify your tag works

To make sure your tag works as intended:

  1. In your Workspace, click Preview. Tag Assistant opens.
  2. Enter your site's URL.
  3. Check if the Google Analytics: GA4 Configuration fired when the page loaded.
    • ✅ If your tag fired successfully, the Tag Assistant UI look like this: Screenshot of the Google Tag Assistant showing a successfully configured Google tag
    • ❌ If your tag didn't fire, check your tag's trigger settings.
  4. When you are done with debugging, close Preview mode.
  5. In your Workspace, click Submit to publish your changes.

Next steps

Now that your Tag Manager container can communicate with your Google Analytics property, add event tags to your site.

Set up GA 4 Event Tags

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
12740813093066551246
true
Search Help Center
true
true
true
true
true
102259