Guide to GA4 Event Tracking Set Up

How to Set Up Event Tracking in Google Analytics 4

How to Set Up Event Tracking in Google Analytics 4

Event tracking is one of the most important elements of any analytics software. By building an understanding of how customers interact with your website, you can facilitate superior user journeys and improve conversion rates.

With the arrival of Google Analytics 4, companies will have to adjust to new systems for event tracking to wrap their heads around. Our step-by-step guide will take you through everything you need to know about event tracking GA4, including the setup process.

Read on to improve your understanding of this all-important process.

How does event tracking work in GA4?

Event tracking in Google Analytics 4 works by adding tags to your website which track user interactions on each page. The level of data customisation and detail will usually depend on how the data layer and individual tags are set up.

Tracking events via GA4 requires a tag manager. If you are using Google Analytics 4 in your setup, you will find Google Tag Manager is by far the most convenient option available.

Prior to setting up event tracking in GA4, you will need to take all the necessary steps to complete the initial integration with GA4 and your tag manager.

Another important element of GA4 event tracking is your data layer. A data layer allows you to create a single source of data to be used throughout your tech stack, increasing accuracy and flexibility between your applications.

For more information, check out our complete guide to configuring your data layer.

 

Types of events in GA4

There are 4 different categories of events in GA4. 2 of these event types are automatically collected.

The other 2 events require setting up to take place for event tracking to begin. Find out more about each event category below.

Automatically collected events

Automatically collected events will be automatically tracked once the initial GA4 setup has taken place. You will be able to see data about these events without needing to take any additional steps.

There are many automatically collected events in GA4, allowing many users to have their analytics needs met without setting up many custom events.

Examples of automatically collected events include:

  • ad_click
  • ad_impression
  • click
  • form_submit
  • page_view
  • view_search_results

Enhanced measurement events

Enabling enhanced measurement events requires slightly more work than automatically collected events.

Examples of events that can have enhanced measurements include:

  • scroll
  • click
  • page_view
  • file_download

How to enable enhanced measure events

To enable enhanced measurement events, take the following steps:

  1. In the sidebar, press Admin
  2. Under “Data collection and modification”, click Data streams
  3. Click the name of the desired data stream
  4. Under enhanced management, you can slide the switch to On to enable all options
  5. You can also click the Settings symbol to select individual options

Recommended events

Recommended events are events that must be specifically implemented. However, because they are commonplace, they have predefined names and parameters within GA4.

They can therefore be easily implemented with the additional necessary context. You can see a full list of recommended events and implementation information on Google’s website.

Some examples of recommended events include:

  • generate_lead
  • login
  • purchase
  • add_payment_info
  • add_shipping_info

Custom events

Finally, there are totally custom events. You must create and implement these events yourself.

You should only create custom events where no other type of event will suit your purpose. Custom events take much more effort to implement than other kinds of events, with more room for error if you implement them imperfectly.

Additionally, custom events do not appear in most standard GA4 reports. You’ll have to set up custom reports to analyse your custom events.

 

How to set up events in Google Analytics 4: Step-by-step guide

Use the following steps to set up tracking for recommended and custom events in GA4. With an understanding of this process, you’ll find it simple to track the events you need to and reap all the benefits.

How to set up GA4 event tracking with a data layer

Firstly, let’s go over the process of GA4 event tracking where a data layer is in use on the website. This enables you to create events and triggers that rely on variables within the data layer.

This helps to simplify the event tracking process and ensures all your tags are drawing on a single source of data.

Note that these steps also cover this process using Google Tag Manager.

1. Create a GA4 event tag

  1. Go into Google Tag Manager.
  2. Click Tags, then New.
  3. Create and enter the name of your event.

2. Configure your GA4 event tag

  1. Select Google Analytics: GA4 event.
  2. Enter your GA4 Measurement ID in the relevant field.
  3. Enter the event name in the relevant field. If you want to use a recommended event, enter the name of the desired recommended event. These events come with predefined parameters. For custom events, simply enter the best, most descriptive name for the event.
  4. Enter the Event Parameters section.
  5. Add your desired parameters, beginning with an appropriate name in the left field, such as “user_email” or “product_id”.
  6. In the right field, select the data layer variable with the relevant information.

3. Create your trigger

  1. In your GA4 event tag, click the Triggering box.
  2. Click the + symbol to add a new trigger.
  3. Enter an appropriate name for the trigger.
  4. In the event name field, enter the name of the data layer event you want to trigger the tag.
  5. Save your changes.

4. Preview and debug

  1. Click Preview.
  2. Go to a page on your website where you can trigger relevant events.
  3. Trigger the relevant events. In the GTM preview pane, check that the correct event data is being captured and sent to GA4 at the right time.

5. Publish

  1. Once you have thoroughly previewed and debugged, exit the preview mode.
  2. Click Submit in Google Tag Manager to publish the setup.
  3. Create a version name and description for documentation.
  4. Click Publish.

How to set up GA4 event tracking without a data layer

There are several key differences for setting up GA4 events without the use of a data layer. Most significantly, you must manually enter the parameters you want to track, and go through a longer process to configure your triggers.

Nonetheless, it is perfectly possible to conduct GA4 event tracking setup without a data layer.

1. Create a GA4 event tag

  1. Go into Google Tag Manager.
  2. Click Tags, then New.
  3. Create and enter the name of your event.

2. Configure your GA4 event tag

  1. Select Google Analytics: GA4 event.
  2. Enter your GA4 Measurement ID in the relevant field.
  3. Enter the event name in the relevant field. If you want to use a recommended event, enter the name of the desired recommended event. For custom events, simply enter the best, most descriptive name for the event.
  4. Enter the Event Parameters section.
  5. Manually enter the parameters you want to track. You can use Google’s pre-defined parameters, including currency, country, discount and more.
  6. Alternatively, you can create your own custom parameters. To do this, type a name for the event in the Name field.
  7. Then, input static or dynamic values in the right field. For instance, if you want to track the “user_type”, you could enter “new_customer” as the static value.
  8. Without the use of a data layer, you can input dynamic variables with JavaScript variables. You can also make use of built-in GTM variables, such as Page URL and Click Text.

3. Create your trigger

  1. In your GA4 event tag, click the Triggering box.
  2. Click the + symbol to add a new trigger.
  3. Enter an appropriate name for the trigger.
  4. Click the Trigger Configuration box.
  5. Set up the trigger type with the user interactions you want to track. For instance, for Page View triggers, you can choose for the trigger to fire on All Page Views or Some Page Views.
  6. If you want the trigger to fire every time a page is viewed, simply select All Page Views.
  7. If you want the trigger to fire on select page views, select Some Page Views and set the conditions such as Page URL, Page Path and Page Title. This is done with matching rules like “contains”, “equals” and “starts with”.
  8. For example, if you only want your trigger to fire on the homepage, your condition could be “Page URL equals https://www.website.com”.

4. Preview and debug

  1. Click Preview.
  2. Go to a page on your website where you can trigger relevant events.
  3. Trigger the relevant events. In the GTM preview pane, check that the correct event data is being captured and sent to GA4 at the right time.

5. Publish

  1. Once you have thoroughly previewed and debugged, exit the preview mode.
  2. Click Submit in Google Tag Manager to publish the setup.
  3. Create a version name and description for documentation.
  4. Click Publish.

How to see your events in GA4

Now that you’ve completed the task of setting up your Google Analytics event tracking, how can you see the fruits of your labour?

Your events and their parameters can be seen in the Realtime and DebugView reports. These reports offer real-time data as events are triggered on your website.

You can also access the Events tab to see data about all tracked events on your site. Of course, you add data acquired from your event tracking to your own custom reports to build your understanding of how customers are using your website.

Complying with the GDPR and CCPA while tracking events in GA4

When tracking events in GA4, it is crucially important that you take the necessary steps to comply with data privacy regulations around the globe.

Remember that you must comply with any regulations in place in any jurisdiction from which your website can be considered to operate. That means that you should comply with regulations from anywhere someone can access your site.

The European Union’s General Data Protection Regulation and the California Consumer Privacy Act are typically regarded as the most significant in the world. This is because they are 2 of the strictest data privacy regulations in the world, and they both apply to large jurisdictions.

Tracking events with GA4 and GTM can result in the collection of personally identifiable information (PII). Examples of PII you may potentially collect while tracking events include:

  • Name
  • Email address
  • Location information
  • Address

Some of the key principles of data privacy regulation around the world are:

  • PII must be stored securely and be protected from internal and external threats.
  • The minimum amount of data for business operations should be collected.
  • Customers have the right to know what data of theirs is being collected and retained by a business.

You can use DataTrue to help fulfil these obligations while tracking events in GA4. DataTrue’s privacy and compliance toolset includes sensitive data leak alerts to let you know if you’re at risk of sharing PII. It also includes cookie policy audits for a holistic approach to data privacy regulation compliance.

Use DataTrue to manage your tags and data layer

Setting up GA4 and GTM to track events might seem relatively straightforward, but there’s plenty that can go wrong. DataTrue is the perfect tool to ensure the data you collect is accurate and secure.

DataTrue includes automated data layer testing for ongoing quality control. This ensures that the variables your tags rely on are accurate and reliable.

DataTrue also offers an extensive tag audit toolset to ensure the overall health of your tags. Features of DataTrue’s comprehensive web analytics testing include simulation tests, coverage tests and validation maps.

Book a demo with DataTrue today and discover the ways it can take your web analytics to the next level.