GA4 Event Naming Convention: Things to Know

Whether you’re in the midst of migrating from Universal Analytics to Google Analytics 4 or setting up a GA4 property for the first time, one thing’s for sure: custom events will be a key part of your analytics setup.

Yes, Google Analytics 4 collects a number of events for you automatically — and with enhanced tracking, you can collect more. Even so, no analytics setup can be considered complete without custom events that track not just the fundamentals, but also the activities and things that matter to you the most.

You’re here reading this, which means you know that getting the names of your GA4 events right is almost as important as determining which events to measure in the first place. And if you’re not quite sure which path to take in your naming convention, we’ve written this guide to help.

Understanding the Rules, Limits, And Best Practices

Google Analytics 4 collects a number of events automatically. As long as the GA4 tag is on your website, you don’t need to do any tagging or add any code to capture the data that they already collect. Google also recommends that customers use a number of standard names for certain events, such as login, purchase, search, and others.

If you look at the naming convention that Google uses for these events, you’ll notice that:

  • The names are lowercase
  • Adjacent words within a name are separated by an underscore
  • Names are self-explanatory and descriptive of the action (for example, click, scroll) or item (for example, ad_impression, error) being tracked

In an article about GA4 event naming rules, Google also lays out a number of requirements for naming events:

  • Event names are case-sensitive (for example, Google Analytics treats my_event and My_event as two different events)
  • Event names can include English and non-English words and letters
  • Event names must start with a letter
  • Event names must use only letters, numbers, and underscores
  • Event names must not use reserved event names and prefixes

And finally, in an article about GA4 event collection limits, the Google team informs us about the following limitations:

  • Event names shouldn’t be longer than 40 characters (event parameters, on the other hand, shouldn’t exceed 100 characters)

The character limits, the Google team says, are the same for single-width character languages (like English) as well as for double-width character languages (like Japanese).

Approaching the Naming Convention

Suppose you were setting up web analytics for a podcasting platform, and you want to establish a common structure and naming convention for the two most basic interactions with the podcast player: plays and pauses.

Using the Event Name as a Broad Category

On the one hand, you can use the event name to create a category of events called podcast, then use the event parameters to distinguish one event type from the other.

Here’s what this approach would look like:

Event Name Event Parameters
podcast podcast_action = play
podcast_progress = 0
podcast podcast_action = pause
podcast_progress = 50
The GA4 event name as a category

This approach will be very familiar to anyone who’s tracked custom events in Universal Analytics because the Name will resemble the Event Category from the UA event structure.

Organizations that need to track many events across many categories will probably want to opt for this approach because of the structure that it creates and the taxonomies that such a structure allows them to introduce. This is a real boon for data engineering teams in large organizations who often need to tap into large datasets through Google BigQuery.

Using the Event Name as a Unique Key

On the other hand, you can use the event name as the primary key (in other words, the unique identifier) for each and every event, like so:

Event Name Event Parameters
podcast_play podcast_progress = 0
podcast_pause podcast_progress = 50
The GA4 event name as a primary key

Notice that this event has one parameter less because we no longer need to distinguish between one event and the other using the podcast_action parameter; we’re capturing the value of that parameter in the event’s name instead.

The biggest benefit to this approach is that it makes it somewhat easier for novice Google Analytics 4 users to slice and dice data in GA4’s default reports or create their own because they only need to filter for event names and not necessarily parameters. A small distinction, but one that can make a ton of difference in a large organization where users of all experience levels need to access and use Google Analytics.

Focusing on Actions vs. Objects in Event Names

The names of your GA4 events can also be action- or object-first, depending on whether they are descriptive of the action undertaken by the user or the object that they relate to.

For instance, an action-first naming convention would result in your GA events having names like:

Event Name Event Parameters
click ux_element = button
ux_element = button_251
play ux_element = media_player
media_type = podcast_episode
media_id = episode_137
media_progress = 0:00
pause ux_element = media_player
media_type = podcast_episode
media_id = episode_137
media_progress = 1:68
A list of action-first names

An object-first naming convention, on the other hand, would look like this:

Event Name Event Parameters
button action = click
ux_element = button_251
podcast action = play
ux_element = media_player
media_type = podcast_episode
media_id = episode_137
media_progress = 0:00
podcast action = pause
ux_element = media_player
media_type = podcast_episode
media_id = episode_137
media_progress = 1:68
A list of object-first names

The difference between an action-first and object-first GA4 event naming convention is subtle but important, because it can affect the usability of the data for all users, from ad buyers and digital marketers to analysts and AdTech/MarTech Ops.

To decide which one to use, try taking three or four events and writing out their names and parameters both ways, then seek out feedback from the end users who will need to work with them (whether in Google Analytics’ reporting interface, in Looker Studio, or through Google BigQuery queries).

Putting It All Together

When you put all of Google’s rules, limits, and best practices together, you get the following six “commandments” for naming GA4 events:

  1. Make your event names lowercase
  2. Always start your event names with a letter
  3. Use an underscore to separate words and abbreviations
  4. Ensure that all your event names are less than 40 characters long
  5. Don’t use GA4-reserved names and prefixes
  6. Use the event names either as broad categories or unique keys
  7. Decide whether to focus event names on actions or objects

Need help with naming your GA4 events and your web or mobile analytics approach as a whole? Scroll down for our contacts and don’t hesitate to get in touch!