Anatomy of a Event in Google Analytics 4 (GA4)


In this guide, we’ll explore what’s inside an event-based hit, how it’s structured and processed, and its full lifecycle within Google Analytics 4 (GA4).

With its event-driven data model, GA4 offers a flexible and granular understanding of user interactions.

At the heart of this system lies the concept of a “hit”.

What Is a Hit in GA4? #

In Google Analytics 4 (GA4):

  • Every user interaction is captured as an event
  • Each event generates a hit sent to Google’s servers

A hit is a single data packet that contains:

  • A required event name (Defines the type of user interaction)
    Describes what happened
    e.g., page_view, click, purchase, etc.

  • Optional parameters (Provides additional context for the event)
    Describe where, how, or why it happened
    e.g., page_location, transaction_id, etc.

  • Automatically collected metadata
    Describes when, who, and on what device the event occurred
    e.g., timestamp, device, user_identifiers

example of event hit in ga4

Note: These events can be enriched with custom parameters or user-defined properties to track virtually anything.

How Hits Are Grouped: Sessions #

While hits represent individual user interactions (events) — such as viewing a page, clicking a link, or making a purchase — sessions group those hits together within a defined time frame.

A session essentially represents a single user’s visit to a website or application. It encompasses all the interactions (hits) that user has within a defined period of time.
session in google analytics

Think of a session as a container that groups user’s hits (events) together based on user activity over time.

E.g. session,

  • 00:00 — User lands on site → session_start, page_view
  • 00:10 — Clicks on a product → click, page_view
  • 00:50 — Purchase the product → purchase, page_view

Note: These interactions are grouped within the same session because they occur within the default 30-minute inactivity window. GA4 treats this as part of the same user journey, maintaining the same session ID across all the interactions.

By grouping hits into sessions, GA4 creates a coherent timeline of user activity — revealing the sequence and context behind each action instead of treating them as isolated events.

How Hits Are Processed #

Let’s break down the journey of a hit, from user action to a GA4 Report:

1. Generating the Hit #

When a user interacts with your website or app, an event-based hit is instantly generated.
This event is packaged as a data payload and sent to GA4 in near real-time.

2. Sending the Hit #

Hits (events) can be sent via:

  • GTag.js or Google Tag Manager: For web-based tracking
  • Firebase SDK: For mobile application tracking
  • Measurement Protocol: For server-side tracking

Hits are sent via HTTP requests to:
https://www.google-analytics.com/g/collect

All the event parameters are appended as key-value pairs to the URL.
The first parameter is added with a ?, and subsequent parameters are appended with &.

  • First parameter: ?key=value
  • Other parameters: &key2=value2&key3=value3…

Example URL (simplified):

https://www.google-analytics.com/g/collect?v=2&tid=GA_MEASUREMENT_ID&cid=CLIENT_ID&en=page_view&sid=SESSION_ID
GA4 Sending Event

Note: GA4 batches events, so if you fire more than one event in a very short time window, the events will be sent together in a single hit.

GA4 batches hits

3. Processing the Hit #

Upon reaching Google’s servers, GA4 begins organizing and categorizing the raw data:

  • Determines if a new session has started
  • Groups hits under the correct session ID (sid)
  • Associates hits with user identifiers (cid, uid)
  • Evaluates engagement and potential conversions

4. Analyzing the Hit #

GA4 then aggregates and transforms the data to build metrics like: “Engaged Sessions,” “Conversions,” and “New Users”.

The processed data feeds into GA4 dashboards, Explorations, and BigQuery exports.

Where to See GA4 Hits #

… But what exactly does this hit contain?

For developers or analysts curious about the technical side, you can view the actual data (hits) being sent to GA4 in:

  • Browser’s DevTools
  • GA4 DebugView
  • BigQuery Export
Tool Use Case Pros Limitations
DevTools (Network Tab) View raw GA4 requests in browser Real-time, full URL Manual, no history
GA4 DebugView Test GA4 tags and event firing Visual, easy to use Limited to debug mode
BigQuery Export Full access to raw hit-level data Powerful, customizable Requires SQL + setup

Viewing Hits in Chrome DevTools #

  • Open Chrome DevTools (F12).
  • Go to the Network tab.
  • Filter by “collect?”
  • Click a request and review the Query String Parameters
Viewing Hits Chrome DevTools

Key Components #

Core Information: #

  • v2: Google Analytics 4 (v1 was Universal Analytics)
  • tid: Measurement ID (your GA4 property)
  • cid: Client ID (unique browser or device)
  • en: Event name (like page_view)
  • _et: Engagement Time (milliseconds user spent engaged with the page)
  • dl: Document Location (full URL of the page)
  • dr: Document Referrer (URL of the referring page)
  • ul: User Language (e.g., “en-us” for English-US)

Session-specific Parameters: #

  • sid (Session ID): Reflects the exact start time of the session in Unix time format
  • sct (Session Count): Indicates the number of sessions for this user/browser instance
  • seg (Session Engaged): A boolean value (1 for engaged, 0 for not engaged)
  • _s: Session Hit Counter (indicates the sequence number of this hit within the session)
  • _nsi: New Session ID (appears when a session timeout occurs and a new session starts)

One-time Parameters: #

  • _ss (Session Start): Marks the beginning of a new session.
  • _fv (First Visit): Indicates the user’s first-ever visit to the site.

These last two parameters are particularly valuable, allowing GA4 to easily distinguish between new and returning users.

Example:

A user’s first-ever visit to your site generates a page_view hit with:

  • _fv=1 → First Visit
  • _ss=1 → Session Start
  • seg=0 → Not yet engaged

Later, if they visit another page before the session timeout:

  • _fv and _ss disappear
  • _s=2 → Second hit in the session
  • seg=1 → Now considered an engaged session*

* In ga4 a session is codesidered engaged if the user stay for >10s, view multiple pages, or convert

User Parameters (up.*): #

  • up.user_id: User ID (custom identifier for logged-in users)
  • up.user_type: User Type (e.g., “member”, “guest”, “admin”)
  • up.user_role: User Role (account level or permission set)
  • up.lifetime_value: Customer Lifetime Value (monetary value of the user)
  • up.account_type: Account Type (e.g., “free”, “premium”, “enterprise”)

Event Parameters (ep.*): #

  • ep.page_title: Page Title (title of the current page)
  • ep.page_location: Page URL (current page URL)
  • ep.page_referrer: Referrer URL (source of the traffic)
  • ep.screen_resolution: Screen Resolution (user’s device display dimensions)
  • ep.engagement_time_msec: Engagement Time (time in milliseconds)

Example: ep.engagement_time_msec=15000 → User spent 15 seconds engaged

Device and Technical Parameters: #

  • sr: Screen Resolution (e.g., “1920×1080”)
  • vp: Viewport Size (visible area of the web page)
  • de: Document Encoding (usually “UTF-8”)
  • sd: Screen Color Depth (e.g., “24-bit”)
  • ua*: User Agent (browser and device information)

Campaign Parameters: #

  • gclid: Google Click ID (for tracking Google Ads clicks)
  • utm_source: Campaign Source (referrer: google, newsletter, etc.)
  • utm_medium: Campaign Medium (marketing medium: cpc, email, social)
  • utm_campaign: Campaign Name (specific campaign identifier)
  • utm_content: Campaign Content (what specifically was clicked)

E-commerce Parameters: #

  • ep.currency: Currency Code (e.g., “USD”, “EUR”)
  • ep.value: Transaction Value (monetary amount)
  • ep.transaction_id: Transaction ID (unique identifier for purchase)
  • ep.coupon: Coupon Code (if used during purchase)
  • ep.payment_type: Payment Method (credit card, PayPal, etc.)

Viewing Hits in the GA4 DebugView Report #

When the request includes the debug mode parameter (_dbg), you’ll find a real-time data stream of similar hits in the DebugView report in GA4.

If you’re using Google Tag Manager’s Preview mode to test your tag with (as you should), the hit will automatically have the _dbg parameter set, and you’ll see it in DebugView.

GA4 DebugView

Viewing Hits in BigQuery #

If you’ve connected GA4 to BigQuery, every hit becomes a row in the export dataset.

  • Each row = one event
  • Nested fields like event_params contain all parameters
  • Use UNNEST() to extract values from arrays
  • Combine user_pseudo_id + ga_session_id to reconstruct sessions

Example:

(select value.string_value from unnest(event_params) where key = 'page_location') as page_url

When exporting your data to BigQuery, every single row represents a single event — whether it’s a page_view, purchase, or view_item.

Leave a Reply

Your email address will not be published.

Thanks for commenting