πŸ“–Siyuan's Notes
δΈ­ζ–‡
Tools2026-05-29
#Google Analytics 4#GA4#Analytics#Web Analytics#Data Tracking

Google Analytics 4 Setup Guide for Beginners: Complete 2026 Tutorial

Google Analytics 4 (GA4) is the web analytics platform that replaced Universal Analytics in July 2023. GA4 uses an event-based data model, tracks both web and app data in a single property, and provides AI-powered insights through machine learning. For website owners, bloggers, and small businesses, GA4 is the free analytics tool that tells you who visits your site, what they do, and how they got there. This guide covers everything from creating your first GA4 property to setting up events, understanding key reports, and using the data to grow your traffic.

Why GA4 in 2026

GA4 is the only free analytics tool that provides comprehensive cross-platform tracking, AI-powered insights, and integration with Google Ads, Search Console, and BigQuery.

Analytics Tool Free Tier Key Features Best For
Google Analytics 4 Free (unlimited) Event tracking, cross-platform, AI insights Most websites
Universal Analytics Deprecated (shut down) Session-based, pageviews No longer available
Plausible Analytics Free (1 site) or $9/mo Privacy-focused, simple Privacy-conscious sites
Fathom Analytics $14/mo (100k pageviews) Simple, fast, no cookies Small business sites
Matomo Free (self-hosted) or $23/mo Full-featured, self-hosted Data ownership
Mixpanel Free (20M events) Product analytics SaaS and apps
Amplitude Free (10M events) Product analytics, cohorts Mobile apps

GA4 is the best choice for most website owners because it is free, powerful, and integrates with the entire Google ecosystem. The learning curve is steeper than alternatives like Plausible or Fathom, but the data depth is unmatched.

GA4 Key Concepts

Before setting up GA4, understand these key concepts that differ from the old Universal Analytics:

Concept Universal Analytics GA4 What It Means
Data model Session-based Event-based Every interaction is an event (page view, click, scroll)
Tracking Hits (pageviews, events, transactions) Events with parameters Everything is an event
Sessions Auto session timeout Auto session timeout Same concept but calculated differently
Users Client ID (cookie-based) Client ID + User ID Cross-device tracking possible
Conversions Goals Conversions (events marked as conversions) More flexible
Bounce rate Single-page sessions Engagement rate (inverse of bounce) More meaningful metric
Cross-platform Separate properties for web/app Unified property One view across web and app
Data freshness Real-time (limited) Real-time (improved) See current visitors
BigQuery export Premium only ($150k/year) Free Raw data in BigQuery

Step 1: Create a GA4 Property

Step 1.1: Sign In to Google Analytics

  1. Go to analytics.google.com
  2. Sign in with your Google account
  3. If you have an existing Universal Analytics property, it will be there but data collection has stopped

Step 1.2: Create a New Property

  1. Click the gear icon (Admin) in the bottom left
  2. Click "Create account" (if you do not have an account) or "Create property"
  3. Fill in property details:
Field Example Value Notes
Property name My Website Analytics Name it after your site
Time zone America/New_York Choose your primary timezone
Currency USD Choose your revenue currency
Business objectives Generate leads / Drive online sales Select relevant objectives
  1. Click "Next"
  2. Select your business size (Small, Medium, Large)
  3. Select how you intend to use GA4 (choose "Generate leads" and "Drive website traffic")
  4. Click "Create"

Step 1.3: Set Up Data Stream

A data stream is the source of data for your GA4 property. You can have web, iOS, and Android streams.

  1. Choose "Web" as your platform
  2. Enter your website URL (e.g., https://mydomain.com)
  3. Enter a stream name (e.g., "My Website")
  4. Configure stream settings:
Setting Recommended Value What It Does
Enhanced measurement ON (default) Auto-tracks page views, scrolls, clicks, video engagement
Page changes ON Tracks SPA (single-page application) navigation
Scroll tracking ON Auto-tracks 90% scroll depth
Outbound click tracking ON Auto-tracks clicks leaving your site
Site search tracking ON Tracks internal search queries
Video engagement ON Tracks YouTube video interactions
File downloads ON Auto-tracks file downloads (PDF, zip, etc.)
  1. Click "Create stream"
  2. You will see your Measurement ID (e.g., G-XXXXXXXXXX)
  3. Copy this ID β€” you will need it for installation

Step 2: Install GA4 on Your Website

Method 1: Google Tag (Recommended for Beginners)

The Google tag (gtag.js) is the simplest installation method.

For HTML websites, add the following code in the <head> section of every page:

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXXXXX');
</script>

Replace G-XXXXXXXXXX with your actual Measurement ID.

For Next.js websites, add the Google Analytics script using the Next.js Script component:

// app/layout.tsx
import Script from 'next/script';

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <head>
        <Script
          src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"
          strategy="afterInteractive"
        />
        <Script id="ga4" strategy="afterInteractive">
          {`
            window.dataLayer = window.dataLayer || [];
            function gtag(){dataLayer.push(arguments);}
            gtag('js', new Date());
            gtag('config', 'G-XXXXXXXXXX');
          `}
        </Script>
      </head>
      <body>{children}</body>
    </html>
  );
}

For WordPress websites, use a plugin:

  1. Install "Google Analytics for WordPress" (Site Kit by Google) or "GA4 Google Analytics"
  2. Go to plugin settings
  3. Paste your Measurement ID (G-XXXXXXXXXX)
  4. Save and verify

Method 2: Google Tag Manager (Advanced)

If you use Google Tag Manager (GTM), you can deploy GA4 through GTM:

  1. Create a GTM account and container for your website
  2. Install the GTM container code on your website
  3. In GTM, add a new tag: "Google Analytics: GA4 Configuration"
  4. Enter your Measurement ID
  5. Set the trigger to "All Pages"
  6. Publish the container
  7. Verify data is flowing in GA4 DebugView

Method 3: Content Management Systems

Platform Installation Method Difficulty
WordPress Site Kit plugin or GA4 plugin Easy
Shopify Native integration in Shopify Admin > Analytics Easy
Wix Native integration in Wix dashboard Easy
Squarespace Native integration in Settings > Analytics Easy
Webflow Custom code in Project Settings > Custom Code Medium
Ghost Code injection in Settings > Code Injection Easy
Webflow Custom code embed Medium

Step 2.1: Verify Installation

  1. Open your website in a browser
  2. Go to GA4 > Reports > Realtime
  3. You should see at least 1 active user (yourself)
  4. If you do not see data, use GA4 DebugView:
    • Go to Admin > DebugView
    • Enable DebugView mode (add ?gtm_debug=x to your URL or use the GA Debug extension)
    • Visit your site and check for events in DebugView

Step 3: Understanding GA4 Events

GA4 uses an event-based data model. Everything that happens on your site is an event.

Automatically Collected Events

These events are collected automatically when you install the Google tag:

Event When It Fires Data Collected
first_visit First time a user visits Source, medium, page location
page_view Every page load Page path, page title, page location
session_start Start of a new session Source, medium
user_engagement When user engages for 10+ seconds Engagement time
scroll When user scrolls 90% of page Page path
click (outbound) Click on external link Link URL, link domain
file_download Download of PDF, ZIP, etc. File extension, file name, link
view_search_results Internal site search Search term

Enhanced Measurement Events

These are enabled by default and can be toggled in the data stream settings:

Event What It Tracks Default
page_view Page views ON
scroll 90% scroll depth ON
click Outbound clicks ON
view_search_results Internal search ON
video_progress YouTube video watching ON
video_complete YouTube video finished ON
file_download File downloads ON
form_start First field interaction OFF (enable manually)
form_submit Form submission OFF (enable manually)

Custom Events

For tracking interactions not covered by automatic or enhanced measurement:

Creating a Custom Event via gtag

// Track a custom event
gtag('event', 'signup_button_click', {
  button_name: 'header_signup',
  page_path: window.location.pathname,
});

// Track a video play (non-YouTube)
gtag('event', 'video_play', {
  video_title: 'product_demo',
  video_duration: 120,
});

// Track a custom conversion
gtag('event', 'generate_lead', {
  form_id: 'contact_form',
  value: 50,
  currency: 'USD',
});

Creating a Custom Event via GTM

  1. In GTM, create a new tag: "GA4 Event"
  2. Set the event name (e.g., button_click)
  3. Add event parameters (e.g., button_name: header_signup)
  4. Set the trigger (e.g., "Click - All Elements" for a specific button)
  5. Save and publish

Marking Events as Conversions

To track important actions (purchases, signups, form submissions), mark events as conversions:

  1. Go to Admin > Events
  2. Find the event you want to track as a conversion
  3. Toggle "Mark as conversion"
  4. The event now appears in Conversions reports

Key conversions to set up:

Event Conversion Name What It Means
form_submit lead_form_submit Contact form completed
purchase purchase Product purchased
signup newsletter_signup Email list signup
file_download resource_download Lead magnet downloaded
generate_lead lead_generated Qualified lead acquired

Step 4: Key GA4 Reports

GA4 organizes data into reports under the "Reports" tab. Here are the most important reports for beginners.

Report 1: Realtime

Where: Reports > Realtime

Shows what is happening on your site right now (last 30 minutes):

Metric What It Means
Users in last 30 minutes Current visitor count
Events per user Average events triggered per user
Top active pages Pages currently being viewed
Top sources Where current visitors came from
Top devices Device types of current visitors

Use case: Check real-time data after publishing a new blog post or launching a campaign to see immediate traffic response.

Report 2: Acquisition

Where: Reports > Acquisition > Traffic Acquisition

Shows where your visitors come from:

Source/Medium What It Means
google / organic Visitors from Google search (free SEO traffic)
google / cpc Visitors from Google Ads (paid)
(direct) / (none) Visitors who typed your URL directly or bookmarked
facebook / social Visitors from Facebook
bing / organic Visitors from Bing search
newsletter / email Visitors from email campaigns
reddit / social Visitors from Reddit

Key metrics:

Metric What It Means
Sessions Total visits
New users First-time visitors
Engagement rate Percentage of engaged sessions
Average engagement time Time users spend actively on your site
Conversions How many visitors completed a conversion

Report 3: Pages and Screens

Where: Reports > Engagement > Pages and Screens

Shows your most viewed pages:

Metric What It Means
Views Total page views
Users Unique users who viewed each page
Average engagement time Time spent on each page
Event count Total events on each page

Use case: Identify your top-performing content and optimize underperforming pages.

Report 4: Demographics

Where: Reports > User > Demographics

Shows age, gender, and interests (requires enabling Google signals):

  1. Go to Admin > Property settings > Data collection
  2. Enable "Google signals"
  3. Demographics data appears within 24-48 hours
Dimension What It Shows
Country Where visitors are located
Region State/province of visitors
City City of visitors
Age Age brackets (18-24, 25-34, etc.)
Gender Male/Female/Unknown
Interests Affinity and in-market categories

Report 5: Tech

Where: Reports > Tech > Tech Details

Shows what devices and browsers visitors use:

Dimension What It Shows
Browser Chrome, Safari, Firefox, Edge
Operating system Windows, macOS, iOS, Android
Device category Desktop, Mobile, Tablet
Screen resolution Common screen sizes

Use case: Ensure your site works well on the most common devices.

Step 5: Conversions and Goals

Setting Up Conversions

Conversions are the most important actions on your site. Here is how to set them up:

Method 1: Mark Existing Events as Conversions

  1. Go to Admin > Events
  2. Find the event (e.g., form_submit)
  3. Toggle "Mark as conversion"
  4. The event appears in Admin > Conversions

Method 2: Create a Custom Conversion

  1. Go to Admin > Conversions
  2. Click "New conversion event"
  3. Enter the event name (e.g., lead_form_submit)
  4. Click "Save"
  5. Send the event from your website code (as described in Step 3)

Method 3: Import Goals from Google Ads

If you use Google Ads:

  1. Go to Admin > Property settings > Google Ads linking
  2. Link your Google Ads account
  3. In Google Ads, go to Tools > Conversions
  4. Click "Import from Google Analytics 4"
  5. Select the GA4 events to import as conversions

Key Conversions for Different Website Types

Website Type Conversion Event How to Track
Blog / Content site Newsletter signup form_submit event with form_id parameter
E-commerce Purchase purchase event with value and currency
SaaS Trial signup signup event with plan parameter
Portfolio Contact form form_submit event
Lead generation Lead form submission generate_lead event

Step 6: GA4 Filters and Data Quality

Internal Traffic Filter

To exclude your own visits from analytics:

  1. Go to Admin > Data Streams > Web stream
  2. Click "Configure tag settings" > "Show all" > "Define internal traffic"
  3. Enter your IP address
  4. Go to Admin > Data Filters > Internal Traffic
  5. Ensure the filter is set to "Active" and "Exclude"

Bot Filtering

GA4 automatically filters known bot traffic. You can verify:

  1. Go to Admin > Property settings
  2. Scroll to "Bot filtering"
  3. Ensure "Exclude bot traffic" is checked

Data Retention

By default, GA4 only retains user-level data for 2 months. Change this:

  1. Go to Admin > Property settings > Data collection and modification
  2. Click "Data retention"
  3. Change from 2 months to 14 months
  4. Click "Save"

Step 7: GA4 Dashboards and Explorations

Standard Reports

GA4 provides several pre-built reports. The most useful for beginners:

Report Where What It Shows
Traffic acquisition Reports > Acquisition Where visitors come from
User acquisition Reports > Acquisition First-touch attribution
Pages and screens Reports > Engagement Most viewed pages
Events Reports > Engagement All events fired
Conversions Reports > Engagement Conversion events and rates
Demographics Reports > User Age, gender, location
Tech Reports > Tech Device and browser data
Realtime Reports > Realtime Current visitors

Explorations (Advanced Analysis)

The Explorations tab lets you build custom analyses:

  1. Go to "Explore" in the left sidebar
  2. Choose a template:
Template What It Does
Free form Create custom tables and charts
Funnel exploration Track user journeys through steps
Path exploration See how users navigate your site
Segment overlap Compare user segments
User explorer Individual user journeys
Cohort exploration Retention by cohort
Lifetime value Revenue over time

Creating a Funnel Exploration

A funnel exploration shows where users drop off in a multi-step process:

  1. Go to Explore > Funnel exploration
  2. Add steps:
Step Event Example
1 page_view (landing page) User visits homepage
2 view_item User views a product
3 begin_checkout User starts checkout
4 purchase User completes purchase
  1. Click "Apply"
  2. See the conversion rate at each step and where users drop off

Step 8: Linking GA4 with Other Google Tools

Link GA4 with Google Search Console

  1. Go to Admin > Property settings > Search Console links
  2. Click "Link"
  3. Select your Search Console property (website)
  4. Select the web stream
  5. Click "Confirm"
  6. Search Console data (queries, landing pages, clicks, impressions) appears in GA4 reports

Link GA4 with Google Ads

  1. Go to Admin > Property settings > Google Ads links
  2. Click "Link"
  3. Select your Google Ads account
  4. Configure settings:
Setting Value Why
Enable auto-tagging Yes Required for Google Ads data in GA4
Import conversions to Google Ads Yes Use GA4 conversions as Google Ads goals
  1. Click "Confirm"
  2. GA4 data appears in Google Ads within 24 hours

Link GA4 with BigQuery

  1. Go to Admin > Property settings > BigQuery links
  2. Click "Link"
  3. Select or create a BigQuery project
  4. Choose data export frequency (daily or streaming)
  5. Click "Confirm"

BigQuery export gives you raw, unsampled data for advanced analysis using SQL. The export is free (you pay only for BigQuery storage and queries, which has a generous free tier of 1 TB queries/month).

Step 9: Key Metrics to Track

Essential Metrics for Every Website

Metric Where to Find It What It Means Target
Users Reports > Acquisition Unique visitors Growth month-over-month
Sessions Reports > Acquisition Total visits Growth month-over-month
Engagement rate Reports > Engagement % of sessions with 10+ second engagement 50%+ for content sites
Average engagement time Reports > Engagement Active time on site 1-3 minutes
Page views Reports > Engagement Total pages viewed Growth
Conversions Reports > Engagement Conversion events Growth
Bounce rate (inverse of engagement) Reports > Engagement 100% - engagement rate Below 50%
Top traffic source Reports > Acquisition Main traffic driver Diversify sources

Content Site Metrics

Metric What It Tells You How to Improve
Average engagement time per page Content quality Write longer, more engaging content
Scroll depth Content engagement Use shorter paragraphs, visuals
Internal search terms User intent Create content for searched topics
Top exit pages Where users leave Improve page content or CTAs
New vs returning visitors Audience loyalty Add newsletter signup for retention

E-commerce Metrics

Metric What It Tells You How to Improve
Revenue Total sales Drive more traffic, increase AOV
E-commerce conversion rate % of visitors who buy Improve product pages, checkout
Average order value (AOV) Average purchase amount Upsell, cross-sell, free shipping
Cart abandonment rate % who start but do not finish checkout Simplify checkout, send reminders
Purchase journey Path from landing to purchase Optimize funnel steps

Step 10: GA4 Privacy and Compliance

Data Privacy Settings

Setting Where What It Does
IP anonymization Enabled by default IP addresses are not stored
Google signals Admin > Property settings Enables demographics and cross-device tracking (requires consent)
User data acknowledgment Admin > Property settings Required for collecting user-provided data
Data retention Admin > Property settings > Data retention How long user data is stored (2 or 14 months)
Data deletion Admin > Data deletion requests Request deletion of specific user data

GDPR and CCPA Compliance

If you serve users in the EU (GDPR) or California (CCPA):

  1. Use Google Consent Mode v2
  2. Implement a cookie consent banner (e.g., OneTrust, Cookiebot)
  3. Configure GA4 to respect consent signals:
// Google Consent Mode v2
gtag('consent', 'default', {
  'ad_storage': 'denied',
  'ad_user_data': 'denied',
  'ad_personalization': 'denied',
  'analytics_storage': 'denied',
  'functionality_storage': 'denied',
  'security_storage': 'granted',
});

// Update consent when user accepts
gtag('consent', 'update', {
  'ad_storage': 'granted',
  'analytics_storage': 'granted',
  // ... other consent types
});

With Consent Mode v2, GA4 models data for users who do not consent, providing estimated traffic data while respecting privacy choices.

GA4 vs Universal Analytics: Key Differences

Feature Universal Analytics GA4
Data model Session-based Event-based
Bounce rate Percentage of single-page sessions Replaced by engagement rate
Conversions Goals (4 types) Marked events
Cross-platform Separate properties Unified property
Free BigQuery No (Premium only) Yes
Data sampling Sampled in standard reports Unsampled in standard reports
Attribution model Last non-direct click Data-driven attribution
User tracking Client ID only Client ID + User ID + Google signals
Privacy Cookie-based Consent Mode, privacy-first
Free limits 10 million hits/month No data volume limits

Common GA4 Issues and Solutions

Problem Cause Solution
No data in reports Tag not installed correctly Verify in DebugView; check tag placement
Real-time shows data but not reports Data processing delay Wait 24-48 hours for data to appear in standard reports
Missing pageview data SPA not tracking page changes Enable "page changes" in stream settings or add manual page_view events
Low engagement rate Content or UX issues Improve page load speed, content quality, internal linking
No demographic data Google signals not enabled Enable in Admin > Property settings > Data collection
Conversion not showing Event not marked as conversion Go to Admin > Events and toggle the event as conversion
Data differs from Search Console Different tracking methods GA4 tracks all visitors; Search Console tracks Google search clicks only
High bot traffic Bot filter not working Enable bot filtering in property settings

GA4 Setup Checklist

  • Create a GA4 property at analytics.google.com
  • Set up a web data stream with enhanced measurement enabled
  • Install the Google tag on your website (gtag.js, GTM, or CMS plugin)
  • Verify data is flowing in Realtime report
  • Enable data retention to 14 months
  • Set up internal traffic filter (exclude your own IP)
  • Verify bot filtering is enabled
  • Mark key events as conversions (form_submit, purchase, signup)
  • Link GA4 with Google Search Console
  • Link GA4 with Google Ads (if applicable)
  • Link GA4 with BigQuery (if you need raw data)
  • Set up custom events for important interactions
  • Create funnel exploration for key user journeys
  • Enable Google signals for demographics data
  • Implement Google Consent Mode v2 (for GDPR/CCPA compliance)
  • Set up a cookie consent banner (if serving EU/California users)
  • Create a weekly review habit: check key metrics and reports
  • Set up scheduled email reports for stakeholders
  • Compare month-over-month metrics to track growth
  • Document your GA4 setup for future reference

Final Verdict

Google Analytics 4 is the standard web analytics platform in 2026. While the interface is more complex than alternatives like Plausible or Fathom, the depth of data, free BigQuery export, and integration with Google's ecosystem make it the best choice for any serious website owner. The initial setup takes 1-2 hours, and learning to navigate the reports takes 3-5 hours of practice. Once set up, GA4 provides the data you need to make informed decisions about content, marketing, and user experience.

Action Checklist

  • Create your GA4 property and web data stream
  • Install the Google tag on your website
  • Verify data is appearing in Realtime
  • Configure data retention to 14 months
  • Set up internal traffic filter
  • Mark at least 3 events as conversions
  • Link GA4 with Search Console
  • Explore the Acquisition report to see traffic sources
  • Explore the Pages report to see top content
  • Set up a funnel exploration
  • Review data weekly for the first month
  • Implement Consent Mode v2 if needed
  • Create a monthly analytics review checklist

More guides: bsynet.cc

Tags

#Google Analytics 4#GA4#Analytics#Web Analytics#Data Tracking

πŸ“– Related Posts