The Complete Guide to Events in Google Analytics 4

The Complete Guide to Events in Google Analytics 4

Why use events in Google Analytics 4?

Events in Google Analytics 4 (GA4) play a crucial role in understanding how users interact with your website or app. They provide detailed information about user actions such as button clicks, form submissions, video plays, downloads, and much more. By tracking events in GA4, you can gain insights into user engagement, identify popular features or content, measure the effectiveness of marketing campaigns, and optimise your overall user experience (UX).

Unlike page views, which only provide information about the number of times a page was viewed, events in GA4 allow you to track specific user actions. This level of granularity helps you understand how users are engaging with your website or app beyond just browsing. By tracking events, you can uncover actionable data to make informed decisions and improve your digital presence.

What is an event in Google Analytics 4?

The short answer is everything. The long answer is absolutely everything.

In GA4, events serve as the foundation for all reports, dimensions, and metrics. By tracking the right events, you can gather high-quality data that empowers you to evaluate your marketing efforts effectively, boost your conversions, and improve user engagement. Understanding events is crucial for unlocking the full potential of GA4, to say the least.

Understanding events is crucial for unlocking the full potential of GA4.
Understanding events is crucial for unlocking the full potential of GA4.

Unlike previous versions of Google Analytics, where each event had to be set up individually using the site tag (gtag.js) or Google Tag Manager (GTM), GA4 introduces a new approach. In GA4, events are handled differently, as many of them come preconfigured. This means that setting up events in GA4 is easier and more streamlined, requiring less additional coding or tagging (and I have to admit I love it). GA4 has the capability to automatically capture numerous events without the need for manual configuration, simplifying the setup process and saving time for users.

There are two main ways to categorise events in GA4: by application or by readiness (I simply cannot come up with a better word to describe it). 

GA4 events by application:

  1. Web events: These events are recorded exclusively on a website and include actions like page_view, video_start, video_progress, video_complete, file_download, scroll, and view_search_results.
  2. App events: App events are specifically recorded on a mobile app and encompass actions such as first_open, notification_open, in_app_purchase, screen_view, and more.
  3. App+Web events: These events can be recorded on both the website and mobile app, and they cover actions like first_visit, user_engagement, session_start, and others.
  4. Android events: These events are specific to activities recorded on an Android device. Examples include app_clear_data, app_store_subscription_cancel, app_remove, app_store_refund, app_store_subscription_cancel, and more.

GA4 events by readiness. 

There are 4 types of events that can be tracked within GA4:

  • Automatically collected events 
  • Enhanced measurement events 
  • Recommended events 
  • Custom events 

Nevertheless, I must be candid and express that the aforementioned classifications hold relatively little significance. It may sound odd to say this in an article about GA4 events, but ultimately, it doesn’t matter from a reporting perspective. All events are reported in the same way. What truly matters is how we think about different events when implementing tracking in relation to our business goals.

Google Analytics 4 Event Types
When creating events in GA4, you should start at the top and work your way down.

Automatically collected events in GA4

Google Analytics 4 automatically tracks certain events without the need for manual setup. These events offer fundamental insights into user interactions with your website or app, including the pages they visit, actions they take, and the duration of their sessions.

Here are some examples of the automatically collected events in Google Analytics 4:

  • first_visit: This event is triggered when a user visits a website or launches an Android instant app with Analytics enabled for the first time.
  • session_start: This event is triggered when a user initiates a new session on your website or app.
  • user_engagement: This event is recorded when the app is active or when a webpage is in focus for at least one second.
  • file_download: When a user initiates a file download from the website, this event is activated. To gain more insights, consider utilising the following parameters: file_extension, file_name, link_classes, link_domain, link_id, link_text, and link_url

You can refer to the list of automatically collected events in GA 4 for more details.

Note: The session_start and first_visit events don’t technically exist as their own independent events. That is, you won’t see them being logged in the browser if you are looking for them when testing your implementation. They are calculated off of the back of the page_view event by the inclusion of the parameters _fv (first visit) and _ss (session start).

What is the difference between first_visit and session_start?

In GA4, the ‘session_start’ event is triggered when a user launches a session with a website or app for the first time. It signifies the beginning of a user’s engagement within a specific session.

On the other hand, the ‘first_visit’ event is fired to determine if it is the user’s initial visit to the website or app. It confirms whether the user is accessing the site or app for the first time, and the event is triggered accordingly.

Where to find automatically collected events in Google Analytics 4

To locate automatically collected events in Google Analytics 4, follow these steps:

  1. Access the GA4 reporting view.
  2. Click on ‘Engagement’ under the ‘Life cycle’ section.
  3. Next, click on ‘Events’ from the available options.
  4. The reporting view will display all logged events, including the automatically collected events.

Enhanced measurement events in GA4

In Google Analytics 4 (GA4), Enhanced Measurement Events refer to a set of predefined events that provide additional insights and data about user interactions on your website. These events go beyond the basic page views and screen views and offer more detailed information. You can toggle them on and off inside the GA4 environment, except for the page_view event, which is compulsory (well, you can turn the page_view off if you really, really want to, but trust me don’t do it).

Here are some examples of the Enhanced measurement events in Google Analytics 4:

Page Views (page_view)

Each time a page is loaded, a page view event is triggered. Google Analytics 4 (GA4) automatically captures this event, and it cannot be disabled. However, users have control over tracking actions based on browser-history events. The parameters sent to Google Analytics 4 for this event include the page URL, page title, and the URL of the previous page.

Scroll (scroll)

The scroll event is activated when it is enabled in enhanced measurement and a visitor scrolls down to a minimum of 90% of the page. To trigger the scroll event for specific pixel values or other percentage thresholds of the viewed page you have to use Google Tag Manager. This event does not send any parameters to GA4. 

Outbound clicks (click)

By enabling this feature in enhanced measurement (more on that later), GA4 will automatically monitor and record clicks on links leading to external domains. However, it is important to note that this functionality does not extend to domains that have been configured for cross-domain tracking (!). 

The parameters associated with this event are link_classes, link_domain, link_id, link_url, and outbound (boolean). I’ve noticed that currently (July 2023) link_text is missing but hopefully, it will be implemented in the future.

Site search (view_search_results) in GA4

To uncover the information about what users are searching for on your website, you must first activate the “view_search_results” event in the enhanced measurement panel. 

In GA4 Admin click on Data collection and modification and then click on Data streams. Click on your data stream and under Enhanced measurement click on the slider to enable all options.

Site searches have historically been a source of confusion, even in the context of Universal Analytics. In GA4, the focus is on identifying a query string parameter within the URL when the page loads, which contains the search term used by the user. If this parameter exists in the URL, GA4’s logic assumes it is the search results page and acknowledges that a search has been conducted by the user.

This event is automatically triggered when one of the following five query parameters appears in the URL: 

  • search 
  • query 
  • keyword. 

Note: If you don’t use any of the parameters above, you have the ability to customise this event to search for additional URL query parameters.

Enabling this enhanced measurement option can yield significant rewards as it allows you to:

  • Identify content gaps that may be hindering user satisfaction and causing them to leave the site.
  • Gain insights into your site’s architecture and assess whether users can easily find the content they need. 
  • Explore opportunities to expand your business. It goes without saying that if your website visitors are actively searching for products or services on your site, they are likely interested in making a purchase.

I’m going to write an article about it (I promise), but for now, I want to tell you that the best way to analyse your On-Site search data (On-Site or simply Site search) is to create a report in Exploration, configured as follows: use ‘Search term’ and ‘Event name’ as dimensions. Use ‘Event count’ and ‘Event count per user’ as metrics. Apply a filter to only include events where the ‘Event name’ exactly matches ‘view_search_results’.

Video engagement

To automatically track embedded YouTube videos on a website, the JS API must be enabled for this event. The video engagement event captures various other events, such as video_start, video_progress, and video_complete. This event also includes parameters such as video_current_time, video_duration, video_percent, video_provider, video_url, and video_title.

File downloads

When a user clicks on a link that contains a file extension, the file download event is triggered. 

Enhanced Measurement automatically tracks various file extensions, such as .wmv, .mid, .midi, .mp3, .mov, .mp4, .mpe, .mpeg, .pkg, .rar, .gz, .zip, .avi, .ppt, .pptx, .7z, .csv, .exe, .key, .pps, .doc, .docx, .txt, .pdf, .xls, and .xlsx. 

This event captures several parameters, including file_extension, file_name, link_classes, link_domain, link_id, link_text, and link_url.

How to enable enhanced measurement in GA4?

To enable enhanced measurement events in Google Analytics 4 follow these steps:

Step One: Navigate to the ‘Admin’ section in the GA4 reporting view. 

Step Two: Choose ‘Data Streams’ in the ‘Property’ column. 

Step Three: Click on your web data stream. 

Step Four: Enable the ‘Enhanced measurement’ by toggling the switch button.

Note: If you wish to track specific enhanced measurement events only, simply click on the gear icon and disable the switch next to the events you do not want to track. When done click the ‘Save’ button. 

Recommended events in GA4

As the name suggests the recommended events require additional context to be meaningful so they are not sent automatically. 

In Google Analytics 4 (GA4), Recommended Events are pre-defined event names and event parameters recommended by Google to track common user interactions and actions on websites or apps. These events are designed to provide valuable insights into user behaviour and engagement. Google offers a reference list of recommended events for various industries and use cases, such as e-commerce, content publishing, and lead generation. 

To view the data in GA4, it is necessary to send the data aligned with the predefined event name and event parameters. 

To give you an example let’s use the ‘sign_up’ event. To ensure the number of signups and related metrics appears correctly in all standard reports, it is crucial to adhere to the specific naming convention. If you were to name the signup event something like “register_user,” you would still be able to report on the number of events as expected. 

However, certain metrics like conversion rate or user engagement may not be accurately calculated, and you may not be able to leverage modelled predictive metrics that are designed specifically for the “sign_up” event. 

Following the recommended event naming convention ensures consistent and comprehensive data analysis within GA4.

Here are some examples of the Recommended events in Google Analytics 4:

Sign up ( sign_up)

This event signifies that a user has successfully signed up for an account. It is valuable for analysing the distinct behaviours between logged-in and logged-out users.

To implement this event use the following code (for gtag.js implementations)

gtag("event", "sign_up", {
  method: "Google"
});

View cart (view_cart)

In Google Analytics 4 (GA4), the “view_cart” event is triggered when a user interacts with their shopping cart or basket on an e-commerce website or app. This event captures valuable information about the user’s cart activity.

Here’s an example implementation using gtag.js:

gtag("event", "view_cart", {
  currency: "GBP",
  value: 12.99,
  items: [
    {
      item_id: "SKU_67890",
      item_name: "Classic Oxford Shirt",
      affiliation: "Fashion Emporium",
      coupon: "SUMMER_SALE",
      discount: 3.00,
      index: 0,
      item_brand: "FashionCo",
      item_category: "Apparel",
      item_category2: "Men",
      item_category3: "Shirts",
      item_category4: "Long sleeve",
      item_list_id: "recommended_products",
      item_list_name: "Recommended Products",
      item_variant: "blue",
      location_id: "ChIJR0MF2i3ahYARmU6M3M6hTHI",
      price: 15.99,
      quantity: 2
    }
  ]
});

This example sends the “view_cart” event with the following details:

  • Currency: The currency of the cart items (GBP).
  • Value: The total value of the cart (£12.99).
  • Items: An array containing information about the items in the cart. This example includes two items with their respective details such as item ID, name, brand, category, variant, price, quantity, and additional attributes like affiliation, coupon, discount, index, item list ID and name, and location ID.

By implementing this event and providing relevant cart information, you can gain insights into user behaviour and optimise your e-commerce platform accordingly.

Custom events in GA4

A custom event in Google Analytics 4 refers to an event that you define by specifying its name and parameters. It provides you with the ability to gather data that is not automatically collected or suggested by Analytics. By creating custom events, you can track and analyse specific actions or interactions that are important to your business goals and gain insights beyond the default tracking capabilities of GA4.

Custom events in GA4 are typically used to track user interactions such as button clicks, form submissions, video plays, file downloads, or any other action that is important for your analytics goals. By defining custom events, you can gain deeper insights into user behaviour and measure specific actions that are unique to your website or app.

To implement custom events in GA4, you need to add code to your website or app that sends event data to the GA4 tracking system. The code typically consists of an event name and optional parameters that provide additional context or details about the event.

Here’s an example of how a custom event might be implemented using the gtag.js library:

gtag('event', 'button_click', {
  'event_category': 'Engagement',
  'event_label': 'Subscribe Button'
});

In this example, the custom event is named “button_click” and includes two optional parameters: “event_category” and “event_label”. These parameters provide additional information about the event, such as the category of the event (“Engagement”) and the label associated with the event (“Subscribe Button”).

Once the custom event data is sent to GA4, you can use the GA4 interface to analyse and visualise the data. Custom events can be used to create audiences, set up conversion tracking, build funnels (Funnel exploration in Google Analytics 4), and gain insights into user behaviour that is specific to your business objectives.

Prior to creating a custom event, it’s important to go through the following steps:

  1. Verify that the event you intend to create is not already collected automatically, categorised as an enhanced measurement event, or recommended by Google Analytics. Utilising events that are already recognised by Google Analytics is preferable as they automatically populate default dimensions and metrics, and seamlessly update standard reports.
  2. Ensure that the name you choose for the custom event is not a reserved name. It is super important to avoid conflicting with any predefined event names or reserved terms within Google Analytics 4. For example, the event name ‘click’ refers to clicks on links leading to external domains and not tracking clicks on buttons on your site. 
  3. Familiarise yourself with the event collection limits and guidelines. Be aware of any restrictions or limitations imposed on event tracking, such as the maximum number of events allowed within a certain time frame or any other specific guidelines related to event collection.

By adhering to these steps, you can effectively create custom events that complement the existing functionality of Google Analytics 4 while obtaining the desired insights specific to your analytics goals. GA4 is not a finished product, not by far, but by introducing your custom events you can take it to another level. 

GA4 custom events naming conventions 

In Google Analytics 4 (GA4), there are certain limitations to consider regarding event collection. These limitations are designed to ensure efficient data processing and maintain optimal performance within the GA4 tracking system. 

Here are the key points regarding event collection limits:

  1. Maximum number of unique event names: GA4 allows up to 500 unique event names per property. It’s essential to plan your event naming strategy carefully to stay within this limit and avoid data loss or inconsistencies.
  2. Maximum parameters per event: Each event in GA4 can include up to 25 parameters. Parameters provide additional context and details about the event. It’s important to consider the relevance and usefulness of each parameter to capture meaningful data effectively.
  3. Maximum string length for event parameters: String values assigned to event parameters should not exceed 100 characters. If a value exceeds this limit, it will be truncated in the reporting and analysis.
  4. Maximum event rate: GA4 sets a limit on the number of events that can be sent per second for a single property. This limit is dynamic and may vary based on factors like traffic volume and account history. Exceeding the event rate limit may result in data loss, so it’s important to monitor your event volume and make adjustments as needed.
  5. Data freshness: Data processing and availability in GA4 might experience a delay of up to 24-48 hours. This delay should be considered when analysing and interpreting real-time or recent data.

By understanding and adhering to these event collection limits, you can ensure accurate and reliable data tracking, maximise the effectiveness of your analytics implementation, and make informed decisions based on the insights provided by Google Analytics 4.

How to set up a custom event directly in the GA4 User Interface?

Let’s say I want to set up a custom event called “omi_sido-bio” so I can track how many people visit my bio page https://omisido.com/omi-sido/

To set up a custom event in GA4, follow these steps:

Step one. Access the admin panel of your Google Analytics 4 account and click ‘Events’.

Step two. Within the ‘Events’ area select ‘Create Event’.

Step three. Within the ‘Create Event’ section, select the ‘Create’ button to proceed.

Step four. First, give your custom event a unique name before configuring the parameters you want to have in order for the event to fire. In my case, I am going to call my custom event ‘omi_sido_bio’.

Step five. Next, configure the first event parameter – in my case, this is the event I want to create my event from – the page_view event. 

Step six. Then if you have to add a second parameter click on the ‘Add condition button. In my case, I’ll have to specifically distinguish the Omi Sido page page_view from the rest as its own event. I’ll use page_location contains /omi-sido/ for this condition.

Note: To target complex URLs build custom events in GA4 using RegEx.

Step seven. Finally, you have to configure your parameters. If you wish to utilise the parameters already available in the original “page_view” event, you can keep the box checked for “Copy parameters from source event.” When you are satisfied with everything hit ‘Create’. 

DebugView in Google Analytics 4

To validate that your custom event implementation is working correctly use the DebugView in Google Analytics 4. DebugView in GA4 is a feature designed to assist developers and digital marketers in validating the implementation of custom events on their websites or apps. It provides real-time insight into the events and parameters being sent to Google Analytics from your digital property.

By accessing DebugView, you can see event hits as they occur, including the event name, associated parameters, and other relevant information. This way, you can ensure that your custom events are set up properly and are functioning as intended before relying on the data for analysis and reporting in Google Analytics 4. It’s a valuable tool that streamlines the debugging process and helps ensure the accuracy and effectiveness of event tracking within the platform.

To enable the DebugView in GA4 I am using the GA debugger Chrome extension. As you can see from the picture below the custom event I created earlier ‘ga4_categry_page_visits’ is working as expected and when I click on it I can see all its parameters. 

Track Events with Google Analytics 4: Final Words

There you have it, our guide for beginners on setting up and tracking events in Google Analytics 4. Probably the main takeaways from this article are: Everything is now an event in Google Analytics 4, events can be created in the GA4 interface based on incoming events and you can use Use Google Analytics 4 DebugView to test and analyse your event implementation. 

If you have more questions about how to track events with Google Analytics 4 please post them in the comments below! And if you have any ideas on how to improve event tracking in GA4 post them in the comments below too. 

Events in Google Analytics 4

Comments

One response to “The Complete Guide to Events in Google Analytics 4”

  1. […] very good way to utilise regular expressions in Google Analytics 4 is to create new, custom events based on the data you send, which can then be used for […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.