How to Set Up Google Analytics 4 in WordPress

Understanding your WordPress website's traffic is fundamental to making smart decisions about content, SEO, and growth. Without data, you're guessing. With Google Analytics 4, you get a complete picture of who visits your site, where they come from, what they read, and how they engage.

Google Analytics 4 (GA4) is Google's current analytics platform — replacing Universal Analytics, which was sunset in 2023. If you're not yet tracking with GA4, or if you're still on UA, this guide walks through everything: creating a GA4 property, installing it on WordPress, verifying it's working, and the key reports to understand.

What Is Google Analytics 4 and Why Does It Matter?

Google Analytics 4 is Google's free website analytics platform. It tracks:

  • Traffic sources — where your visitors come from (organic search, social media, direct, referral, email)
  • Page performance — which pages receive the most visits, how long people stay
  • User behaviour — what paths visitors take through your site
  • Conversions — form submissions, purchases, goal completions
  • Audience data — demographics, devices, locations, new vs. returning visitors
  • Engagement metrics — scroll depth, video views, clicks on outbound links

Why GA4 specifically (vs. older versions):

GA4 is event-based rather than session-based. Every interaction — page view, scroll, click, video play, file download — is tracked as an event with properties. This gives you far more granular data than Universal Analytics, particularly for understanding how users engage with your content.

GA4 also includes cross-device tracking, Google Signals integration, and predictive analytics — useful as your site grows.

Step 1: Create a Google Analytics 4 Property

If you don't have a GA4 property yet:

  1. Go to analytics.google.com
  2. Sign in with your Google account
  3. Click Admin (gear icon, bottom left)
  4. In the Account column, click Create Account (or select an existing account)
  5. Fill in your account name (your business or site name)
  6. In the Property column, click Create Property
  7. Enter your property name, select your timezone and currency
  8. Click Next → fill in business details → click Create
  9. Accept the terms of service

Set up a data stream:

After creating the property, you'll be prompted to create a data stream:

  1. Choose Web
  2. Enter your WordPress site URL
  3. Enter a stream name (e.g., "AceMindTech Website")
  4. Click Create stream
You'll receive a Measurement ID (format: G-XXXXXXXXXX) — save this, you'll need it for WordPress installation.
01
Install GA4 with Google Site Kit (Official — Free)

Google Site Kit is the official WordPress plugin from Google. It installs GA4, connects Google Search Console, and shows a combined performance dashboard inside your WordPress admin.

Best for: Site owners who want an official, Google-maintained solution with an integrated dashboard.

Step 1: Install Site Kit

  1. Go to Plugins → Add New
  2. Search "Site Kit by Google"
  3. Install and activate the official plugin

Step 2: Connect Your Google Account

  1. Go to Site Kit → Dashboard in WordPress
  2. Click Start Setup
  3. Click Sign in with Google
  4. Select your Google account
  5. Grant the requested permissions

Step 3: Connect Google Analytics

  1. After Search Console setup, Site Kit will prompt you to connect additional services
  2. Click Connect a service → Analytics
  3. Select your GA4 property from the dropdown
  4. Click Connect Analytics

Site Kit will insert the GA4 tracking code on every page of your WordPress site automatically.

Step 4: Verify Installation

  1. Go to Site Kit → Dashboard
  2. After 24–48 hours, GA4 data will appear in the Site Kit dashboard
  3. For immediate verification: go to your GA4 property → Realtime report and load your website in another tab — you should see 1 active user
02
Install GA4 with MonsterInsights (Free + Premium)

MonsterInsights is the most popular dedicated analytics plugin for WordPress with 3+ million active installs. It provides a WordPress-native analytics dashboard and simplifies GA4 configuration.

Best for: Site owners who want detailed analytics inside WordPress without navigating the GA4 interface.

Install and Connect:

  1. Install MonsterInsights – Google Analytics Dashboard from wordpress.org
  2. Activate and click Launch Setup Wizard
  3. Choose your site category
  4. Click Connect MonsterInsights
  5. Sign in to Google and select your GA4 property
  6. Grant permissions and complete setup

MonsterInsights inserts the GA4 tracking code automatically and creates a dashboard under Insights in your WordPress admin showing:

  • Top pages and posts
  • Traffic sources
  • Devices
  • Countries
  • Real-time stats

MonsterInsights Premium adds:

  • eCommerce tracking for WooCommerce
  • Form tracking (contact form conversions)
  • Custom dimensions
  • Advanced reports
03
Install GA4 with Rank Math SEO

If you use Rank Math, it includes Google Analytics integration:

  1. Go to Rank Math → General Settings → Analytics
  2. Click Connect with Google
  3. Sign in and select your GA4 property
  4. Save settings

Rank Math will insert the GA4 tracking code and show basic analytics in the Rank Math dashboard.

04
Install GA4 Manually (For Developers)

For developers who prefer minimal plugins:

Option A: Add to functions.php

PHP
function add_ga4_tracking_code() {
    ?>
    
    
    
    
}
add_action('wp_head', 'add_ga4_tracking_code');

Replace G-XXXXXXXXXX with your actual Measurement ID.

Option B: Add via Insert Headers and Footers Plugin

For non-developers who want manual code without editing theme files:

  1. Install Insert Headers and Footers plugin
  2. Go to Settings → Insert Headers and Footers
  3. Paste the GA4 tracking code (from your GA4 property → Data Streams → your stream → Installation instructions) into the Scripts in Header section
  4. Save

Step 2: Verify GA4 Is Tracking Correctly

Realtime Report

  1. Go to your GA4 property at analytics.google.com
  2. Click Reports → Realtime
  3. Open your WordPress site in a new browser tab
  4. You should see at least 1 active user in Realtime

If you see yourself in Realtime, tracking is working.

DebugView

For more detailed verification:

  1. Install the Google Analytics Debugger Chrome extension
  2. Enable it and visit your site
  3. In GA4, go to Configure → DebugView
  4. You'll see every event firing in real time as you browse your site
Check for Duplicate Tracking: If you're using both Site Kit AND another method (like MonsterInsights), you may be tracking twice — inflating your numbers. Check your page source for the GA4 tracking code appearing twice. Use only one installation method.

Step 3: Configure Key GA4 Settings

Enable Google Signals

Google Signals connects GA4 data with Google's advertising data for cross-device tracking:

  1. In GA4 → Admin → Data Settings → Data Collection
  2. Enable Google Signals Data Collection

Connect to Google Search Console

Connecting GA4 to Search Console enables the organic search performance report in GA4:

  1. In GA4 → Admin → Product Links → Search Console Links
  2. Click Link → Choose accounts
  3. Select your Search Console property
  4. Select your GA4 web data stream
  5. Submit

Set Up Conversion Events

If visitors completing specific actions is important (contact form submissions, WooCommerce purchases, newsletter signups), mark those events as conversions:

  1. In GA4 → Configure → Events
  2. Find the relevant event (e.g., form_submit, purchase)
  3. Toggle Mark as conversion

MonsterInsights and Site Kit can automatically track form submissions as conversion events — configure in their plugin settings.

Key GA4 Reports Every WordPress Site Owner Should Know

Acquisition → Traffic Acquisition

Shows where your visitors come from:

  • Organic Search — visitors from Google and other search engines
  • Direct — visitors who typed your URL directly
  • Organic Social — visitors from social media
  • Referral — visitors from links on other websites
  • Email — visitors from email campaigns

This is the most important report for understanding your traffic sources and the impact of your SEO efforts.

Engagement → Pages and Screens

Shows which pages and posts receive the most traffic. Sort by views to see your top content. Sort by engagement rate to see which content keeps people reading.

Acquisition → User Acquisition

Shows which channels are bringing new users vs. which bring returning visitors. Organic search should grow over time as your SEO improves.

Realtime

Shows active users, their current pages, and acquisition sources right now. Useful for monitoring during content launches or marketing campaigns.

Retention

Shows how many visitors return after their first visit — a measure of content quality and site stickiness.

Frequently Asked Questions

Q: Does installing Google Analytics slow my WordPress site?
A: The GA4 script adds a small amount of JavaScript to every page — typically 50–100ms of additional load time in the worst case. To minimise impact, use Site Kit or MonsterInsights (which load the script asynchronously), or self-host the GA4 script using the CAOS plugin.
Q: Will GA4 track my own visits to my site?
A: By default, yes — your admin visits are included in your data. To exclude yourself: install a GA opt-out browser extension, or use IP filtering (GA4 → Admin → Data Streams → your stream → Configure tag settings → Define internal traffic → create a rule for your IP address).
Q: Is Google Analytics GDPR compliant?
A: This is complex. GA4 provides features for GDPR compliance (data retention controls, user deletion, consent mode), but implementation requires a proper cookie consent mechanism. Use a consent plugin (Cookiebot, CookieYes) that integrates with GA4's Consent Mode v2.
Q: Can I use GA4 with WooCommerce?
A: Yes — GA4 has built-in eCommerce tracking. MonsterInsights Premium and YITH WooCommerce for Google Analytics are the easiest ways to enable WooCommerce-specific events (add to cart, purchase, checkout) in GA4.

Final Thoughts

Google Analytics 4 on WordPress is not optional for any site serious about growth. Without it, you're flying blind — publishing content and running campaigns with no way to measure what's working.

Install GA4 today using Site Kit (easiest, official) or MonsterInsights (best WordPress-native dashboard). Verify it's tracking. Connect to Search Console. Set up your conversion events. Then start reviewing your Acquisition and Pages reports weekly to understand what drives your traffic.

Data-driven decisions consistently outperform guesswork — and GA4 gives you the data.

Need help setting up GA4, connecting it to Search Console, or configuring conversion tracking on your WordPress site? Our team handles analytics implementation as part of our WordPress SEO service.

Contact us today and we'll sort it out.
Views: 150