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

[GA4] Set up Google Analytics 4 events with Tag Manager

This article is for Google Analytics 4 users who maintain their tags with Google Tag Manager. This article covers how to unlock additional insights in GA4 by creating recommended and custom events.

About the Google Analytics 4 Event tag

An event allows you to measure a specific interaction or occurrence on your website or app. For example, you can use an event to measure when someone loads a page, clicks a link, or completes a purchase, or to measure system behavior, such as when an app crashes or an impression is served.

What types of events exist?

Google Analytics 4 events can be categorized into automatically collected events and events you manually need to enable.

The following types of events are collected automatically:

  • Automatically collected events are events that Google Analytics collects by default when you set up the Google tag or the Tag Manager snippet on your website or the Google Analytics for Firebase SDK in your app. Learn more
  • Enhanced measurement events are events that Google Analytics collects from websites when enhanced measurement is enabled within Google Analytics. Learn more

The following types of events require some setup to see the events in Analytics:

  • Recommended events are events that you implement, but that have predefined names and parameters. These events unlock existing and future reporting capabilities.
  • Custom events are events that you define. Make sure you only create custom events when no other events work for your use case. Custom events don't show up in most standard GA 4 reports, so you need to set up custom reports or explorations for meaningful analysis.

Measure user activity with recommended events in Google Analytics

This guide shows you how to set up recommended events and custom events on your website using Google Tag Manager. You don't need to do anything to set up automatically collected and enhanced measurement events.

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 events

To set up an event using Google Tag Manager, you will configure a Google Analytics: GA4 Event tag and then create a trigger that specifies when you want to send the event.

The following steps show you how to send a custom event to a Google Analytics 4 property when a user clicks a button to sign up for your newsletter. The steps show you how to implement the event using Tag Manager and don't require you to implement a data layer object.

Step 1: Create a GA4 Event tag

Start by creating a Google Analytics: GA4 Event tag for the new custom event.

  1. In Google Tag Manager, click Tags > New.
  2. Enter a name for the GA4 Event tag at the top (e.g., "GA4 Event - Signup newsletter").
  3. Select Google Analytics: GA4 Event and configure:

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.

Step 2: Create a trigger

Next, create a trigger to send the event when someone clicks the button.

  1. Click the Triggering box in your GA4 Event tag.
  2. Click + on the top right.
  3. Enter a name for the trigger (e.g., "Trigger - Signup newsletter").

You can choose the conditions for sending the event. The following example sends the event based on the button label:

  1. Click the Trigger Configuration box in your trigger.
  2. Choose All Elements.
  3. Click Some Clicks.
  4. Set the following trigger condition: "Click Text contains Sign up for the newsletter".
  5. Save all your changes.

If you want the event to trigger when someone views a page (e.g., on a confirmation page), you could use a Page View trigger instead.

Step 3: Preview your changes

Before you publish your new event in Tag Manager, click Preview to see the data that's recorded when you click the "Sign up for the newsletter" button.

You can use preview mode to test changes to your container before you publish those changes to your website. Learn more about preview mode

See your events in Analytics

You can see your events and their parameters using the Realtime and DebugView reports. Note that the DebugView report requires some additional configuration before you can use the report. These two reports show you the events users trigger on your website as the events are triggered.

Next steps

Was this helpful?

How can we improve it?
Clear search
Close search
Google apps
Main menu