GA4 Event Implementation Reference
Complete reference for implementing Google Analytics 4 events: automatically collected, enhanced measurement, recommended, and custom events with exact parameter lists, code examples, and validation techniques.
Full docs: https://cogny.com/docs/ga4-event-implementation
Usage
/ga4-events # Show event model overview
/ga4-events purchase # Show purchase event parameters and code
/ga4-events ecommerce # Full e-commerce event funnel reference
/ga4-events enhanced measurement # Enhanced measurement events list
/ga4-events custom events # Custom event naming rules and limits
/ga4-events validation # DebugView, Realtime, and BigQuery checks
/ga4-events gtm # GTM dataLayer implementation patterns
/ga4-events measurement protocol # Server-side Measurement Protocol examples
Instructions
You are a GA4 event implementation expert. Use this reference to help users implement, audit, and validate GA4 events correctly. Provide precise, copy-paste-ready code examples.
When the user asks a question, find the relevant section below and provide actionable answers with ready-to-use code. If GA4 MCP tools are available, use them to inspect the user's actual property configuration (custom dimensions, data streams, conversion events) for context-aware advice.
If the user provides a specific event name or topic as an argument, focus on that area. Otherwise, provide an overview of the event model.
Event Model Overview
GA4 uses an event-based data model where everything is an event. Unlike Universal Analytics hit types (pageview, event, transaction), GA4 has a single concept: events with parameters.
| Concept | Universal Analytics | GA4 |
|---|---|---|
| Data model | Hit-based (pageview, event, transaction) | Event-based (everything is an event) |
| Event structure | Category / Action / Label / Value | Event name + parameters (key-value pairs) |
| Sessions | Server-defined, 30-min timeout | Derived from session_start event |
| Pageviews | Dedicated hit type | page_view event with page_location parameter |
| E-commerce | Enhanced Ecommerce plugin | Built-in recommended events with items array |
| Custom data | Custom dimensions/metrics (index-based) | Event parameters + custom dimensions/metrics (name-based) |
Every GA4 event has:
- Event name: String identifier (e.g.,
page_view,purchase) - Event parameters: Key-value pairs (e.g.,
page_location,transaction_id) - User properties: Persistent user attributes (e.g.,
membership_tier)
Automatically Collected Events
Collected automatically with no configuration. Cannot be disabled.
Web
| Event | Trigger | Key Parameters |
|---|---|---|
first_visit | First time user visits (new cookie) | None |
session_start | New session begins (30-min timeout) | ga_session_id, ga_session_number |
page_view | Every page load (or history.pushState in SPAs) | page_location, page_title, page_referrer |
user_engagement | Page in focus for 1+ second with interaction | engagement_time_msec |
Mobile (Firebase SDK)
| Event | Trigger | Key Parameters |
|---|---|---|
first_open | First app open after install | previous_gmp_app_id, updated_with_analytics |
session_start | New session begins | ga_session_id, ga_session_number |
screen_view | Screen transition | firebase_screen, firebase_screen_class, firebase_screen_id |
user_engagement | App in foreground 1+ second | engagement_time_msec |
app_update | App updated and launched | previous_app_version |
app_remove | App removed (Android only) | None |
os_update | OS updated | previous_os_version |
Auto-attached Parameters (every event)
language, page_location, page_referrer, page_title, screen_resolution, ga_session_id, ga_session_number, engagement_time_msec
Enhanced Measurement Events
Collected automatically when enabled in Admin > Data Streams > Enhanced Measurement. Each can be toggled individually.
| Event | Trigger | Key Parameters |
|---|---|---|
scroll | User scrolls past 90% of page | percent_scrolled (always 90) |
click | Outbound link click | link_url, link_domain, link_classes, link_id, outbound |
view_search_results | URL contains search query parameter | search_term |
video_start | YouTube embed starts playing | video_url, video_title, video_provider, video_current_time, visible |
video_progress | YouTube video reaches 10/25/50/75% | Same as video_start plus video_percent |
video_complete | YouTube video reaches end | Same as video_start |
file_download | Click on file link (pdf, xls, doc, zip, etc.) | file_name, file_extension, link_url, link_text, link_domain |
form_start | First interaction with a form | form_id, form_name, form_destination |
form_submit | Form submitted | form_id, form_name, form_destination, form_submit_text |
Note: Video tracking only works with YouTube embeds using enablejsapi=1.
Recommended Events — All Properties
| Event | Parameters |
|---|---|
login | method (STRING) |
sign_up | method (STRING) |
share | method (STRING), content_type (STRING), item_id (STRING) |
search | search_term (STRING) |
select_content | content_type (STRING), content_id (STRING) |
gtag('event', 'login', { method: 'Google' });
gtag('event', 'sign_up', { method: 'Email' });
gtag('event', 'search', { search_term: 'running shoes' });
Recommended Events — E-commerce
Implement in order for full funnel reporting.
view_item_list
gtag('event', 'view_item_list', {
item_list_id: 'category_123',
item_list_name: 'Running Shoes',
items: [{
item_id: 'SKU_123', item_name: 'Trail Runner Pro', item_brand: 'RunCo',
item_category: 'Shoes', item_category2: 'Running', item_variant: 'Blue',
price: 129.99, currency: 'USD', index: 0,
item_list_id: 'category_123', item_list_name: 'Running Shoes'
}]
});
select_item
gtag('event', 'select_item', {
item_list_id: 'category_123', item_list_name: 'Running Shoes',
items: [{ item_id: 'SKU_123', item_name: 'Trail Runner Pro', price: 129.99, currency: 'USD', index: 0 }]
});
view_item
gtag('event', 'view_item', {
currency: 'USD', value: 129.99,
items: [{ item_id: 'SKU_123', item_name: 'Trail Runner Pro', item_brand: 'RunCo',
item_category: 'Shoes', item_variant: 'Blue', price: 129.99, currency: 'USD', quantity: 1 }]
});
add_to_cart
gtag('event', 'add_to_cart', {
currency: 'USD', value: 129.99,
items: [{ item_id: 'SKU_123', item_name: 'Trail Runner Pro', price: 129.99, currency: 'USD', quantity: 1 }]
});
remove_from_cart
gtag('event', 'remove_from_cart', {
currency: 'USD', value: 129.99,
items: [{ item_id: 'SKU_123', item_name: 'Trail Runner Pro', price: 129.99, currency: 'USD', quantity: 1 }]
});
view_cart
gtag('event', 'view_cart', {
currency: 'USD', value: 259.98,
items: [
{ item_id: 'SKU_123', item_name: 'Trail Runner Pro', price: 129.99, currency: 'USD', quantity: 1 },
{ item_id: 'SKU_456', item_name: 'Road Runner Elite', price: 149.99, currency: 'USD', quantity: 1 }
]
});
begin_checkout
gtag('event', 'begin_checkout', {
currency: 'USD', value: 259.98, coupon: 'SUMMER20',
items: [
{ item_id: 'SKU_123', item_name: 'Trail Runner Pro', price: 129.99, currency: 'USD', quantity: 1 },
{ item_id: 'SKU_456', item_name: 'Road Runner Elite', price: 149.99, currency: 'USD', quantity: 1 }
]
});
add_shipping_info
gtag('event', 'add_shipping_info', {