Implement events using Google Tag Manager

This article is for website owners using Google Tag Manager to implement events in Google Analytics 4 properties.

In a Universal Analytics property implemented via gtag.js ("UA-XXXXXXXX"), events are implemented as a separate hit type, using the dimensions Event Category, Action, and Label and the metric Event Value. When collected, they appear in your reports and there are no limits to the number of different event, dimension and metric values.

In a Google Analytics 4 property, every "hit" is an "event," meaning there is no longer a distinction between hit types.

Types of events in a Google Analytics 4 property

Google Analytics 4 events fall into four categories: automatically collected events, enhanced measurement, recommended events, and custom events.

  1. Automatically collected events are collected automatically with basic data collection.
  2. Enhanced measurement provides events that you can toggle on and off using the Admin interface within a Google Analytics 4 property. Enhanced measurement events DO NOT REQUIRE adding/modifying code on web or in app
    • Note that when events are/remain implemented as individual events and are also collected via enhanced measurement, those events will be logged twice. If you are sending an event to both a Universal Analytics and a Google Analytics 4 property, the solution is to add a "send_to" parameter in the event specifying the relevant Universal Analytics property ID. That way, the event only flows to the Universal Analytics property and not to the Google Analytics 4 property.
    • Technical note: Enhanced measurement is not based on HTML ID’s or classes, unlike situations where you have used HTML ID’s and classes as triggers or variables for events such as link clicks and downloads via Google Tag Manager.

  1. Recommended events are events that you manually implement, but that have Google-predefined names and parameters. Recommended events unlock existing and future reporting capabilities not available for custom events (events that you name yourself). Recommended events exist for:
  1. Custom events are events that you name and implement yourself.

Best practices when implementing events

  1. Wherever possible, use automatically collected and enhanced measurement events instead of implementing events yourself.
  2. If a desired event is not automatically collected and is not provided as part of enhanced measurement, look for a recommended event to implement.
  3. Implement a custom event only if (1) and (2) do not meet your needs.

Make an inventory of all the events that are being used in your Universal Analytics property and see if the automatically collected and enhanced measurement events can cover these needs for your Google Analytics 4 property. Focus on these events first as they do NOT have to be manually coded for migration.

Manually implemented events (i.e., recommended and custom events)

The data structure of events differs between Google Analytics 4 and Universal Analytics properties.

  • In a Universal Analytics property, events have “Event Category”, “ Event Action”, “ Event Label”, and “Event Value” fields and custom dimensions can be added.
  • In a Google Analytics 4 property, a manually implemented event consists of “Event Name”, automatically collected parameters, and manually specified parameters. These manually specified parameters replace the event fields from a Universal Analytics property, and they can also be used for specifying additional information with the event.

Add recommended events, custom events, and custom parameters

If you currently use Universal Analytics tags to collect any events that can be automatically collected via enhanced measurement, you should use the enhanced measurement events instead of manually instrumenting the events yourself. If the enhanced measurement events do not meet your needs, follow the steps below to set up Google Analytics 4 Event tags.

The Google Analytics 4 Event tag lets you send custom events to Analytics, in addition to the events that are sent automatically or through enhanced measurement. For example, if you want to collect more detailed scroll depth data than what is provided via enhanced measurement, you can trigger a Google Analytics 4 Event tag to fire based on Tag Manager’s scroll depth trigger.

To create a Google Analytics 4 Event tag:

  1. Click Tags and then New.
  2. Click Tag Configuration.
  3. Select Google Analytics: GA4 Event.
  4. For Configuration Tag, select the Configuration Tag you created earlier.
  5. For Event Name, specify the name of the event. Use the recommended event names for best results.
  6. Optional: Enter Event Parameters. Use recommended event parameter names for best results.
    1. Click Add Row.
    2. Enter a Parameter Name.
    3. Enter a Value.
    4. Repeat until all desired parameters have been added.
  7. Optional: Add any custom user properties that you'd like to configure in User Properties. Note: Analytics automatically logs some user properties. You can set up to 25 additional user properties per Google Analytics 4 property.
  8. Optional: Use Advanced Settings to set a Tag Firing Priority, or use Tag Sequencing to help ensure that the Configuration tag fires before any other event tags that require it.
  9. Click Triggering and select appropriate events that would cause the tag to fire.
  10. Save the tag configuration and publish your container.

Example Event tag configuration:

  • Event Name: scroll
  • Parameter Name: percent_scrolled
  • Parameter Value: {{Scroll Depth Threshold}} (populated by built-in variable)
Use Advanced Settings and then Tag Sequencing to specify that an Event tag should fire after a Configuration tag.

Follow the recommended event schema whenever possible when defining the event and parameter names. Example schema shown below; full schema here.

Event Trigger... Parameters
login when a user logs in. method
purchase when a user completes a purchase transactions_id, value, currency, tax, shipping, items, coupon
refund when a user receives a refund transactions_id, value, currency, tax, shipping, items
search when a user searches your content search_term
select_content when a user has selected content content_type, item_id
share when a user has shared content content_type, item_id

when a user has signed up

Allows you to see which methods of sign-up (e.g., Google account, email address, etc.) are most popular

Was this helpful?
How can we improve it?
Clear search
Close search
Google apps
Main menu
Search Help Center