Google Analytics 4 (GA4) — website analytics
What is GA4?
Google Analytics 4 (GA4) is the fourth generation of Google Analytics — a tool for tracking traffic, conversions, and user behavior on websites and mobile apps. Standard in 2026 after Universal Analytics was retired (July 1, 2023).
GA4 is event-based (not session-based like UA3), which better matches modern multi-device customer journeys.
Key differences GA4 vs UA3
- Event-based — everything is an event (page_view, scroll, click, conversion)
- No session TTL — session can last longer than 30 min
- Cross-platform — combines web + iOS + Android in one view
- AI/ML insights — predictive metrics (predicted revenue, churn probability)
- Default data-driven attribution — instead of last-click
- BigQuery export in free version (UA3 required the 360 version)
- Privacy-first — Consent Mode, IP anonymization by default
Main features
- Real-time reports — who's on the site now
- User explorer — detailed single-user path
- Funnel exploration — step-by-step visualization
- Path exploration — tree of all paths
- Cohort analysis — retention/usage over time
- Audiences — segments for remarketing via Google Ads
- Custom events & parameters — your own metrics
Implementation
Standard (gtag.js)
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXX');
</script>
Google Tag Manager (recommended)
- GTM container in
<head> - In GTM add GA4 Configuration tag
- Events triggered by GTM trigger rules
- Server-side GTM (GTM SS) for privacy + performance
Custom events
gtag('event', 'lead_form_submit', {
form_id: 'contact-form',
value: 100,
currency: 'USD'
});
GA4 and privacy 2026
- Consent Mode v2 — for users in the EEA, Google requires you to collect consent for the use of their personal data and pass consent signals to Google if your tags are to keep supporting measurement, ad personalization and remarketing; Google added two parameters to the consent mode API:
ad_user_dataandad_personalization(Google Tag Manager Help, archived copy from July 2026) - Modeled conversions — GA4 estimates conversions from non-consent users
- No third-party cookies — natively GA4 uses first-party (
_ga) - Server-side tracking — events reach your own server first, which gives you more control over the data sent to Google
Related terms
- Attribution modeling — GA4 default = DDA
- Conversion rate — KPI tracked by GA4
- Meta Pixel — equivalent on Meta side
- Marketing funnel — visualized in GA4
- Google Search Console — complementary to GA4
- Marketing automation — integration with GA4