How to Set Up Events and Custom Definitions in Google Analytics

Created by Natalie Nguyen, Modified on Thu, 20 Nov at 12:58 AM by Natalie Nguyen

Google Analytics 4 (GA4) uses a flexible, event-based tracking model that gives you deeper insight into how users interact with your app or website. Unlike Universal Analytics, which focused on sessions and pageviews, GA4 tracks all interactions as events.


This article walks you through:

  • Understanding events in GA4
  • Sending custom parameters with events
  • Creating custom dimensions and metrics (also called custom definitions)
  • Analyzing your event data using GA4 reports and explorations

What Are Events in GA4

Events are the core of GA4’s tracking model. They capture every user interaction such as pageviews, scrolls, clicks, downloads, and custom-defined actions.


There are four types of events:

  1. Automatically Collected Events
    These are tracked by default, such as first_visit, page_view, and session_start.
  2. Enhanced Measurement Events
    These can be toggled on or off in your settings. Examples include scroll, file_download, and outbound_click.
  3. Recommended Events
    These are events Google suggests based on your business type, such as purchase, sign_up, or login.
  4. Custom Events
    These are events you define yourself, such as item_name or media_title. You can send additional context by adding event parameters.

Why Use Custom Definitions

GA4 only displays a limited number of parameters in standard reports by default. If you want to analyze custom event parameters (like tour_name), you’ll need to register them as custom definitions.


In Google Analytics 4, Custom Definitions is the umbrella term for:

  • Custom Dimensions — non-numeric data (e.g., tour name, form ID)
  • Custom Metrics — numeric values that can be measured or aggregated (e.g., price, quantity)


This article focuses only on creating custom dimensions.

How to Create a Custom Dimensions

Follow these steps to register it in GA4:

  1. Log in to your Google Analytics account.
  2. From the main screen, click on the Settings cog icon, then select "Custom Definitions."Screenshot demonstrating the steps to configure custom definitions in GA4.
  3. Choose "Create Custom Dimensions."
  4. Create custom dimensions that match the following specifications:

    Scope
    Parameter name
    Dimension name
    Description
    eventcollectionCollectionThe Collection name
    eventitem_nameItem NameThe name of the lightboxed item
    eventlanguage_selectedLanguage selectedThe currently selected Language setting
    eventmedia_current_timeMedia Current TimeThe current index position in seconds of the playhead
    eventmedia_durationMedia_DurationTotal duration of the playback in seconds
    eventmedia_percentPlayback ThresholdThe playback threshold that has been reached
    eventmedia_titleMedia TitleThe name of the media
    eventmedia_typeMedia TypeThe type of media
    eventmethodMethodThe method used to select the stop ie "map", "keypad", "qr-code", "hamburger", "search"
    eventscreen_sectionScreen SectionThe section of the screen
    userdevice_idDevice IDFirebase's user_pseudo_id
    eventitem_idItem IDThe unique ID assigned to each item
  5. Click Save


GA4 will only start capturing this data from the moment the custom definition is created. Past data is not retroactively linked.


How to Analyze Custom Event Data

To view analytics for specific events:

  1. Log in to your Google Analytics account.
  2. Navigate to Reports
  3. Click on Engagement > Events
  4. Scroll down and select an event under Event name
  5. Once selected, scroll back up and use the filter to focus on the specific event you want to track (e.g., tour_download, tour_update). This will display a detailed breakdown of how often that event was triggered, by whom, and under what conditions — depending on the parameters you included.

Screenshot displaying the report view for the custom dimension item_name associated with the tour_download event.


Example Events You Can Track

tour_download

Triggered when a user downloads a tour to their device.

tour_update
Captures when a user updates previously downloaded content for a tour.
screen_download
Logged when a user downloads an individual screen, typically via a button in a link group.


If you need assistance with setting up GA4 tracking, events, or custom definitions for your STQRY project, feel free to reach out to our support team at support.stqry.com. Happy app building!

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article