skip to main content

GTM event tracking for GA4

A crash course in Google Analytics 4 events, what’s changed, transferring your old GA events and some of the exciting opportunities ahead.

Have you been manipulating events in UA (Universal Analytics) and struggling to fit all the data you need into “Event Category,” “Event Action,” and “Event Label”? Often, these attempts end in long strings of data parts which need to be pulled apart again and regrouped in reports. Custom dimensions have been one solution but setting them up can take up time better used elsewhere.

GA4 (Google Analytics 4) comes with some major changes to event tracking. This crash course through GA4 events will help explain what’s changed, how to transfer your old UA events, and some of the exciting opportunities that lie ahead.

You’ll learn about:

  • How to make the most of the new event capabilities in GA4
  • How to merge your old setup (events and goals) into the new system (events and conversions, custom definitions)
  • Best practice regarding tags and parameter naming conventions

You can find the link to the Migration Template and GTM container mentioned in this post, as well as the slides used to present this information at MeasureFest with visual guides, here.

GA4’s Data Model

The data model in GA4 means everything is now an event. Every event can have its own set of parameters, which is great for data analysis. GA4 will allow you to collect unlimited events (though that may change) each with up to 25 parameters.

For example, instead of having a video’s title, duration, percentage, and status all crammed awkwardly into Event Action and Event Label, we can have far neater individual parameters like these: 

  • Video_current_time: 
  • Video_duration: 
  • Video_percent: 
  • Video_provider: 
  • Video_title: 
  • Video_url: 

If you currently have some important custom dimensions, you could set these globally or for individual events as one of those parameters. With 25 possible parameters, there’s huge potential.

Migration

It will be necessary to move existing event setups over to GA4. If you haven’t already, establish a document that outlines the events you are currently sending to UA and how you have used Category, Action, and Label fields. Establish a map of what you have right now. It doesn’t have to be more complicated than a spreadsheet. Feel free to use our template here.

Next, you’ll need to know whether your existing event tags will need to be recreated. It may not be necessary to keep all your events. 

For the events we want to migrate we need to establish which of the following GA4 categories these fall under: 

  • Automatically collected
  • Enhanced measurement
  • Recommended
  • Custom

Figuring this out is easier than it may seem – these categories are clearly defined. 

There are only a handful of web-related events that are automatically collected. They are: 

  • session_start
  • first_visit
  • user_engagement

There is a longer list of events you can collect with enhanced measurement turned on: 

  • click
  • file_download
  • page_view
  • scroll
  • video_complete
  • video_progress
  • video_start
  • view_search_results

Finally, here is the list of recommend events: 

  • ad_impression
  • earn_virtual_currency
  •  join_group
  • login
  • purchase
  • refund
  • search
  • select_content
  • share
  • sign_up
  • spend_virtual_currency
  • tutorial_begin
  • tutorial_complete

The rest of your tags will be custom. For example, if you want to measure the number of times people clicked on a mailto link or phone number, or a number of form submissions, you’ll need your custom tags at the ready. 

Executing your migration plan

To get started migrating existing event setups to GA4, create a tab in your migration plan which allows you to specify which old events you want to carry forward and how you’re going to track them in GA4. 

  1. Start with the existing event name from your previous sheet, and what it will be called in GA4. 
  2. Then define the event type (custom, enhanced, etc.).
  3. Finally, list all the parameters you want to capture, including the values that will be defined. Use GTM variables if possible.

Here are a few ways you might migrate UA to GA4:

Scenario 1

Your event is one that’s collected automatically or via enhanced measurement. In this case, you might not need to do anything.

Scenario 2

You may want to separate them into more specific events. For example, you may want to use the click event (which tracks outbound clicks) and make a new one that just tracks clicks to social. All you need to do is create an event from your event.

Scenario 3

You may not be happy with the detail that’s being collected. Take scroll for example. This only gets triggered when a user has viewed 90% of the page. You might want to see when they have scrolled 25%, 50% and so on. In this case the enhanced measurement won’t work for you. To solve this, turn off enhanced measurement and make yourself a custom event. 

Be careful when using the enhanced measurement video events. These only work with standard YouTube setup so if you have anything non-standard, like videos loading after an interaction or other video players, you’ll need a custom event. 

Scenario 4

Your events are not collected yet, whether they are recommended or not. You’ll need a custom event. Gather your list of events that need to be custom and open GTM. You will need to create your GA4 config tag first, which you’ll need your measurement ID for. Then create a tag (and trigger) for each of your custom events.

Here’s an example – making a tag for tracking mailto clicks.

The event is called email_clicks.

Add a parameter for click_type, and manually set it as “contact” because you’ll do the same with phone clicks later. You can look at them together if you want to.

Next, add a parameter called email_address with the value of {{Click URL}} variable. For some websites there might also be something like customer_type or department. These dimensions give you the freedom to add things that are specifically relevant to your business. 

Here is another example for scroll tracking, where you use percent_scrolled and direction using your built-in variables in GTM.

If you don’t want to set all this up from scratch there is a standard container that includes email, phone, form, scroll events, which you can find here. All you need to do is swap out your measurement ID. 

Parameter naming conventions

Messy naming conventions make your data awkward to work with. There are already some standard events and parameters in existence, so stick to the conventions they use. 

  • Use lower case.
  • Use underscores to separate words. 
  • If a parameter exists already, use that.

Here is a list of standard parameters that come with all events: 

  • language
  • page_location
  • page_title
  • page_referrer
  • screen_resolution

Be strategic. Before you start, ask yourself which events are related to one another, and whether there’s anything that these events have in common that would lend itself to comparison later.

Next, ask yourself if there are any global parameters to set. You can set your global parameters in your GA4 config tag, under fields to set. If there are any parameters that will be needed for all events, set them there. 

For the values, use existing built-in variables if you can. If you need to create a new custom variable, make sure you follow the same style as the built-in ones. If you’re unsure, use preview mode to see what your current variable values are returned as.

Once you have created your tags and triggers, tested them in preview mode, are happy that they are all working, and you’ve published your container, events will start to collect in GA4. 

These events won’t appear in your config view for 24 hours, although you will be able to see them in real time. Test each event to make sure that you can see them in the real-time report. 

Fortunately, you don’t have to wait to do the next two steps.

1. Set up your custom definitions. Your new custom events’ parameters won’t appear in any of the standard reports unless you define them as a definition. Decide on which parameters from your sheet you want to use in your reports. Whether these are dimensions or metrics, you’ll need to define them. 

2. Decide on which events will be conversions. 

The system for setting up goals in UA was clunky. This is far easier in GA4. Toggle your event to be counted as a conversion. If you only want to count a very specific scenario as a conversion, simply setup an event from your event, add the required conditions and then toggle to mark as conversion. You also have more slots to play with. UA had 20 slots, GA4 has 30. You can switch these back off without losing the historical data. 

What’s next?

You can use your events and other conditions to create super-smart audiences that you can then use in your Google Ads campaigns or, like segments, to gain more insights from your data. 

You can go wild creating exploration reports in GA4, or use the Data studio to create dashboards for your new events and conversions. You may already have a Data Studio dashboard for your site that you can just adapt.

GA4 works differently to UA, so think about how that will affect your report before you start afresh. You might be able to use most of your existing tables or graphs, but remember that the underlying data model is completely different, so you will need to manage expectations for people viewing this new data.


Learn more about GA4


More help

For more help making sense of Google Analytics 4 and your website data, read about our Analytics & dashboards services or email me at [email protected].

I’ve got plenty to say

View my other articles and opinion pieces below

Collecting the site data you need – not the site data you want

Collecting data is exciting. There’s a big buffet of data out there to choose from, with companies analysing everything from scroll speed to mouse movement. Finding new ways to learn about your site visitors is a great technical challenge. Okay, maybe that’s just me.  But whether you find it exciting or excruciating, collecting data on […]

GA4 migration: Everything you need to make the switch

On July 1, Universal Analytics will stop processing data. UA will be permanently replaced by Google’s new reporting platform, Google Analytics 4.  To help you prepare for this transition, we have compiled all of our GA4 information into one place, ranging from guides to FAQs and deep-dives into specific features including cookie-less tracking, API quotas […]

GA4’s AI: Everything you need to know about artificial intelligence in Google Analytics 4

Stop someone on the street and ask them what they think when they hear “AI.” You’ll likely hear a few answers. ChatGPT. Automation. Computers taking over the human race.  Many conversations about AI are warped by preconceptions. These range from sci-fi ideas about AI capabilities, to limited understandings of AI’s use based on specific services.  […]

The small business guide to GA4’s new API quotas

On 10th November 2022, Google Analytics 4 (GA4) introduced some major changes with massive implications for other Google properties, particularly Looker Studio (formerly Google Data Studio). The GA4 team implemented API “quotas” – a PR friendly way of saying “limits” – on requests for Management and Reporting APIs.  API stands for “Application Programming Interface” and […]