Google Analytics 4 - Event Management

Master event tracking in Google Analytics 4 with Firebase integration for seamless cross-platform measurement and user behavior insights.

Ceyhun Enki Aksan
Ceyhun Enki Aksan Entrepreneur, Maker

I’ve previously written many articles about Universal Analytics. However, I didn’t have the opportunity to go into great detail about GA4 topics. Soon, I’ll be sharing notes I’ve gathered from the projects I’ve recently been involved in, starting with this article and covering a few other sections.

warning

As of July 2023, Universal Analytics (UA) is being phased out in favor of Google Analytics 4 (GA4). After this date, UA properties will no longer be able to process new data. They will eventually become inaccessible, likely by the end of the year. For more details on the differences between property types and other operations, please refer to my article titled Universal Analytics (UA) to Google Analytics 4 (GA4), and you can also request technical support at (https://calendly.com/dnomia/15min).

In my article titled Google Analytics Tracking Methods, I’ve tried to examine the evolution of Google Analytics since 2005, and in this context, I’ve also summarized the measurement (measurement) methods used in Google Analytics. Currently, we can say that GA4 (formerly known as App + Web)1 properties are actively being used, alongside the new features introduced in the latest version.

Play

In this article, I’ll focus on events—key components in GA4 usage—and also present some of the articles I’ve previously published on this topic in different contexts2 3 4.

Events

The data found in GA4 reports consists of events based on actions performed by users viewing websites or apps (web and mobile)5 6. For example, a viewed page (page) or app screen (screen) is reported as a page_view event.

During the GA4 installation process, certain events can be tracked by default without requiring any code addition or modification. These events are referred to as automatically collected events (automatically collected events).

GA4 - Automatically Collected Events
GA4 - Automatically Collected Events

Created events can also be managed via Data Streams > Web > More tagging settings 7.

GA4 - Event Management
GA4 - Event Management
GA4 - Enhanced Measurement and Automatically Collected Events
GA4 - Enhanced Measurement and Automatically Collected Events

Automatically Collected Events

Automatically collected events are triggered by basic user interactions occurring within an app (web & mobile) and/or on a website. As long as either SDK8 9 is used in mobile apps or gtag.js10 11 is used on a website, no additional code modifications are required for automatically collected events.

Automatically collected events differ between mobile apps and websites.

For ad requests and impressions, operations are performed by the Mobile Ads SDK12, and installation of this SDK is required for relevant events (ad_click, ad_exposure, ad_reward, etc.).

Additionally, app data and operations related to Android devices are only tracked on Android devices.

Finally, some events such as first_visit can be used both on mobile and web sites. All events except exceptions (e.g., app_store_subscription_convert, which is typically associated with app stores) are sent to BigQuery at the specified frequencies (daily or streaming) if the BigQuery integration is available (BigQuery Linking).

The language, page_location, page_referrer, page_title, and screen_resolution parameters are automatically processed with all events, including customized ones.

The table below shows variations by device and operating system.

App data includes events related to both advertising and app-related actions. These events may vary depending on the operating system. The following descriptions provide details on some frequently used events.

Event nameAutomatic trigger conditionRelated parameters
app_removeWhen the app package is removed from an Android device (uninstalled)
app_exceptionWhen the related app crashes or an exceptional condition occursfatal, timestamp, engagement_time_msec
app_updateWhen the app is restarted after being upgraded to a new version (in this case, the previous version value is passed as a parameter)previous_app_version
dynamic_link_first_openWhen a user opens the app for the first time via a dynamic linksource, medium, campaign, link_id, accept_time
dynamic_link_app_openWhen a user reopens the app via a dynamic linksource, medium, campaign, link_id, accept_time
errorWhen an invalid operation is performedfirebase_error, firebase_error_value
firebase_campaignWhen the app is made available through a campaign parametersource, medium, campaign, term, content, gclid, aclid, cp1, anid, click_timestamp, campaign_info_source
firebase_in_app_message_impressionWhen a user views a Firebase In-App Message13message_name, message_device_time, message_id
firebase_in_app_message_actionWhen a user performs an action related to a Firebase In-App Messagemessage_name, message_device_time, message_id
first_visitWhen a user starts the app for the first time14
first_openWhen a user starts the app for the first time or after a reloadprevious_gmp_app_id, updated_with_analytics, previous_first_open_count, system_app, system_app_update, deferred_analytics_collection, reset_analytics_cause, engagement_time_msec
notification_receiveWhen the app receives a notification from the device via FCM while in the backgroundmessage_name, message_time, message_device_time, message_id, topic, label, message_channel, message_type

|notification_open|When a user opens a notification sent via FCM|message_name, message_time, message_device_time, message_id, topic, label, message_channel| |in_app_purchase|When a user completes an in-app purchase (including the first subscription) through the iTunes App Store or Google Play|product_id, price, value, currency, quantity, subscription, free_trial, introductory_price| |os_update|When the device’s operating system is updated to a new version (in this case, the previous version value is passed as a parameter)|previous_os_version| |screen_view|When a user views in-app screens|firebase_screen, firebase_screen_class, firebase_screen_id, firebase_previous_screen, firebase_previous_class, firebase_previous_id, engagement_time_msec| |session_start|When a user interacts with the app14| | |user_engagement|When the app is in the foreground and during specific time intervals14|engagement_time_msec|

For complete details and other information, see the Analytics Help and Firebase Analytics Events pages.

The following events are activated via the Global Site Tag setup and automatically collect data.

Event nameAutomatic trigger conditionRelated parameters
clickWhen the user clicks on a link with a different href attribute (outbound clicks)15
file_downloadWhen the user clicks on a file link with a commonly used extension (e.g., pdf, txt, zip, mp4, etc.)15file_extension, file_name, link_classes, link_domain, link_id, link_text, link_url
first_visitWhen the user visits the website for the first time14
page_viewFor every page viewed by the userpage_location, page_referrer
scrollWhen the user has scrolled down at least 90% of the page height15engagement_time_msec
session_startWhen the user engages with the website14
user_engagementWhile the user is viewing a web page, at specific time intervals14engagement_time_msec
video_startWhen the user starts watching a video16video_current_time, video_duration, video_percent, video_provider, video_title, video_url, visible (boolean)
video_progressWhen the user has passed 10%, 25%,, 50%, and 75% of a video’s duration16video_current_time, video_duration, video_percent, video_provider, video_title, video_url, visible (boolean)
video_completeWhen the user has watched the entire video16video_current_time, video_duration, video_percent, video_provider, video_title, video_url, visible (boolean)
view_search_resultsWhen the user performs a site search15search_term and optional additional query parameters specified by ‘q_’

These events can be viewed under the Data Streams (Data Streams) section of Web in GA4. Enhanced measurement events can also be managed from this section. However, the page_view event cannot be disabled.

GA4 - Enhanced Measurement
GA4 - Enhanced Measurement and Active Events

Enhanced Measurement Events

Most of the events listed under the Web Events section above are referred to as enhanced measurement events. Briefly reiterating, each of the events—page_view, scroll, click, view_search_results, video_start, video_progress, video_complete, and file_download—is considered an enhanced measurement event17.

In essence, although the page_view (page view) event is included among these options, it is not disabled at the property level. The only adjustment possible for page_view is to prevent tracking of the browser history18.

Google provides certain events and parameters, tailored for specific use cases (such as e-commerce, education, travel, etc.), within a standardized framework based on industry sectors, under the name recommended events. These recommended events are those that cannot be used together with custom events (including by name). Google recommends adhering to the specified event frameworks for future reporting capabilities19.

For a detailed overview of all events and their corresponding parameters, refer to the Google Analytics 4 Events20 page.

All Properties

These events and parameters are tailored to the specific actions relevant to each industry sector20. These events may differ for web and apps. Unless otherwise specified, events are shared across both web and app platforms.

EventTriggered when
ad_impressionUser encounters an ad (only for app)
earn_virtual_currencyUser earns a virtual currency unit (e.g. virtual currency, token, access right, etc.)
join_groupUser joins a group (to measure popularity of each group)
loginUser logs in to the app or website
purchaseUser completes a purchase
refundUser processes a refund
searchUser performs a content search
select_contentUser selects content
shareUser shares content
sign_upUser signs up to the website or app
spend_virtual_currencyUser spends virtual currency (e.g. virtual currency, token, etc.)
tutorial_beginUser accesses tutorial content
tutorial_completeUser completes tutorial content

Online Sales / E-commerce

Events provided for measuring sales transactions conducted through the website and app. These events and parameters are designed based on in-store, e-commerce, education, real estate, and travel behaviors.

EventTriggered when
add_payment_infoThe user defines payment information
add_shipping_infoThe user defines shipping information
add_to_cartThe user adds an item to their shopping cart
add_to_wishlistThe user adds an item to their wishlist
begin_checkoutThe user starts the payment process
generate_leadThe user submits a form or requests information
purchaseThe user completes a purchase
refundThe user initiates a refund
remove_from_cartThe user removes one or more items from their shopping cart
select_itemThe user selects an item from a list
select_promotionThe user selects a promotion
view_cartThe user views their shopping cart
view_itemThe user views item details
view_item_listThe user views a list of items or promotions
view_promotionThe user views a promotion

Online Games

The Property settings > Industry category section must be set to Games for games. After this setting is applied, game reports become active, a new main page with summary cards specific to games is opened, and detailed information about relevant events can be viewed21.

EventTriggered when
earn_virtual_currencyUser earns a virtual currency unit (e.g. virtual currency, token, etc.)
join_groupUser joins a group (to measure the popularity of each group)
level_startUser starts a new level in the game
level_endUser completes a level in the game
level_upUser advances to a new level in the game
post_scoreUser posts their score
select_contentUser selects content
spend_virtual_currencyUser spends virtual currency (e.g. virtual currency, token, etc.)
tutorial_beginUser begins an instructional content
tutorial_completeUser completes an instructional content
unlock_achievementUser unlocks an achievement
GA4 - Event Management
GA4 - Event Management (Creation and Editing)

Custom Events

Custom events express events and the related parameters created according to specific requirements22 8 23.

gtag('event', 'funnel', {
    step_name: 'Form Submit',
    debug_mode: true
});

The example above belongs to the custom funnel event.

GA4 - Event Management - Parameter Editing
GA4 - Event Management - Parameter Editing

Configure > Events steps can be followed to create a new event and/or edit an existing event.

GA4 - DebugView
GA4 - DebugView

Debug Mode

IMPORTANT RULES:

  1. Maintain the original formatting (markdown, HTML tags, links, etc.)
  2. Keep technical terms and proper nouns as appropriate
  3. Preserve code blocks and technical syntax exactly
  4. Maintain the same tone and style
  5. Only output the translated text, no explanations or comments

Created events cannot be deleted, therefore it is recommended to use the debug_mode parameter before implementing a custom event, to verify whether it is an automated, enhanced measurement or a recommended event, and to test the event’s functionality 24. However, historically defined parameters and parameter values within events can be deleted. This process is performed using the Data Deletion Requests feature25.

DebugView - Event Parameters
DebugView - Event Parameters

Event Parameters

GA4 supports three types of event parameters: automatically collected parameters, custom parameters, and user properties.

Automatically Collected Parameters

Information such as age (age), browser (browser), city (city), and device category (device category) is automatically collected26 27. No editing is required for these parameters.

DebugView - User Properties
DebugView - User Properties

User Properties

User properties are defined and passed using user_properties.

gtag('set', 'user_properties', {
    favorite_composer: 'Mahler',
    favorite_instrument: 'double bass',
    season_ticketholder: 'true', 
});

Custom Parameters

Custom parameters are parameters specifically created for recommended or customized events. The step_name expression in the following funnel custom event is an example of a custom parameter28.

gtag('event', 'funnel', {
    step_name: 'Form Submit',
    debug_mode: true
});
GA4 - Custom Dimension Definition
GA4 - Custom Dimension Definition
GA4 Custom Metrics and Dimensions
GA4 Custom Metrics and Dimensions

Parameters for custom dimensions and metrics within events are defined for dimensions and metrics across the property.

GA4 - Events and Conversions
GA4 - Events and Conversions

Conversions

All events logged within reports can be marked as conversions (conversion). Events can be categorized based on whether they are defined as conversions or not. Parameters to be displayed via GDS must be defined as custom dimensions and/or custom metrics.

Another method is to create reports using BigQuery data. However, as mentioned in the Events section, some events are not transmitted to BigQuery. Certain events (e.g., purchase for web, first_open, in_app_purchase, app_store_subscription_convert, app_store_subscription_renew for apps) have predefined conversion attributes.

In addition to automatically collected conversion events, up to 30 conversion events per property can be marked. Conversion events are visible in the Conversion Events (Conversion Events) table. It may take up to 24 hours for new conversions to appear in your reports29.

GA4 - Page View Conversion
GA4 - Page View Conversion

To define a page as a conversion, a new event must be created with page_view as the event_name and the page path (e.g., /thank-you/) specified for the page_location parameter.

E-commerce Events

Previously, I published articles titled Google Analytics Ecommerce Events and Google Tag Manager dataLayer and E-Commerce Events regarding e-commerce event tracking. In addition to these articles, e-commerce events are also included under the Online Sales / E-Commerce section as part of the recommended events provided by Google Analytics. This enables detailed insights into users’ shopping behaviors through custom reports specifically designed for e-commerce.

gtag('event', 'add_to_cart', {
  currency: 'USD',
  value: 7.77,
  items: [
    {
      item_id: 'SKU_12345',
      item_name: 'Stan and Friends Tee',
      affiliation: 'Google Store',
      coupon: 'SUMMER_FUN',
      currency: 'USD',
      discount: 2.22,
      index: 5,
      item_brand: 'Google',
      item_category: 'Apparel',
      item_category2: 'Adult',
      item_category3: 'Shirts',
      item_category4: 'Crew',
      item_category5: 'Short sleeve',
      item_list_id: 'related_products',
      item_list_name: 'Related Products',
      item_variant: 'green',
      location_id: 'L_12345',
      price: 9.99,
      quantity: 1
    }
  ]
});

Event Tracking

Events can be monitored via the Reports > Engagement reports. E-commerce and in-app purchase events are available under the Reports > Monetization reports section.

Creation and editing of events, as well as log information, can be managed under Configure > Events and Conversions. Testing processes can be managed via DebugView.

That’s all the notes I can share regarding events for now. In my next article, I’ll provide examples of GA4 and GDS reports using event data.

*[UA]: Universal Analytics
*[GA4]: Google Analytics 4
*[FCM]: Firebase Cloud Messaging
*[GDS]: Looker Studio

Analytics Help

Analytics Support

Footnotes

  1. Google Analytics App + Web Property
  2. Google Analytics 4 Event Tracking: Your Complete Guide
  3. Implementation Guide for Events in Google Analytics 4
  4. Audience Triggers & Conversions in GA4
  5. Aggregation and configuration limits. Analytics Help
  6. [Creating events and audience triggers.
  7. Modify and create events via the user interface. Analytics Help
  8. Set up data collection for apps. Analytics Help 2
  9. Log events. Firebase Documentation
  10. Global Site Tag (gtag.js) Events
  11. Events. Google Analytics Documentation
  12. Google Mobile Ads SDK
  13. Firebase In-App Messaging
  14. A common event between web and mobile. 2 3 4 5 6
  15. Collected via enhanced measurement. 2 3 4
  16. For YouTube videos with JS API support enabled 2 3
  17. Enhanced measurement. Analytics Help
  18. When the Enhanced measurement option is enabled, the Settings icon that appears will allow access to the relevant event details. Then, by selecting the Show advanced settings option, the Page changes based on browser history events setting can be disabled.
  19. About events.
  20. Google Analytics 4 Events 2
  21. Game reports. Analytics Help
  22. Google Analytics 4 properties tag and instrumentation guide. Google Analytics Documentation
  23. Measure Google Analytics Events
  24. Real-time reports and DebugView report. Analytics Support
  25. Data-deletion requests. Analytics Support
  26. Predefined user dimensions. Analytics Support
  27. User properties. Analytics Documentation
  28. Custom dimensions and metrics. Analytics Support
  29. Creating and managing conversion actions. Analytics Support