Analytics & Data

Google Analytics 4 Setup Guide for WordPress: Install & Configure in 15 Minutes (2025)

Kishan Yadav Kishan Yadav
Nov 29, 2024
15 Min Read
Google Analytics Dashboard
Figure 1: The new Google Analytics 4 interface offers deeper user insights.

"Setting up Google Analytics 4 on your WordPress site is essential for understanding your audience and making data-driven decisions. This comprehensive guide walks you through every step of the GA4 installation process, from creating your account to tracking custom events."

What is Google Analytics 4?
Google Analytics 4 (GA4) is the latest version of Google's web analytics platform. Unlike Universal Analytics, GA4 uses an event-based tracking model that provides deeper insights into user behavior across websites and apps. With enhanced privacy controls and machine learning capabilities, GA4 helps you understand your visitors while respecting their privacy.

Why You Need GA4 on WordPress

Google Analytics 4 provides critical insights that help you grow your WordPress site:

  • Understand Your Audience: Discover who visits your site, where they come from, and what content they engage with most.
  • Track User Behavior: Monitor how visitors navigate through your pages and identify drop-off points.
  • Measure Conversions: Track form submissions, purchases, downloads, and other important actions.
  • Make Data-Driven Decisions: Use real data to improve content strategy, user experience, and marketing campaigns.
  • Future-Proof Analytics: Universal Analytics stopped collecting data in July 2023, making GA4 the only option for Google Analytics tracking.

Prerequisites Before You Start

Before beginning the installation process, make sure you have:

  • A WordPress website with admin access
  • A Google account (Gmail or Google Workspace)
  • Access to edit your WordPress theme files or install plugins
  • Basic familiarity with WordPress dashboard navigation

Step 1: Create Your Google Analytics 4 Account

Creating a GA4 account is the first step in tracking your WordPress site. Follow these instructions to get started.

Setting Up Your GA4 Property

  1. Navigate to the Google Analytics website and sign in with your Google account. Click the "Start measuring" button to begin.
  2. Enter your account name (typically your business name). Configure data sharing settings according to your preferences.
  3. Click "Next" to proceed to property creation. Enter your property name, select your reporting time zone, and choose your currency.
  4. Click "Next" to provide business information like industry category and business size.
  5. Accept the Terms of Service agreement and click "Create" to finalize your GA4 property.

Step 2: Set Up Your Data Stream

After creating your property, you need to set up a data stream to collect information from your WordPress site.

Creating a Web Data Stream

  1. On the data stream setup page, select "Web" as your platform.
  2. Enter your website URL (include https://) and stream name.
  3. Enable Enhanced Measurement to automatically track page views, scrolls, and clicks.
  4. Click "Create stream" to generate your tracking code. Note your Measurement ID (starts with "G-").

Step 3: Install GA4 on WordPress (3 Methods)

Choose the method that best fits your technical comfort level.

Method 1: Using Site Kit by Google (Recommended for Beginners)

Site Kit is the official Google plugin and the easiest method.

  1. In WordPress, go to Plugins > Add New. Search for "Site Kit by Google" and install/activate it.
  2. Click "Start setup" and sign in with your Google account.
  3. Grant permissions and select your GA4 property from the dropdown.
  4. Complete the wizard. Site Kit will automatically insert the tracking code.

Method 2: Using MonsterInsights (Best for Advanced Tracking)

  1. Install and activate the MonsterInsights plugin.
  2. Launch the setup wizard and click "Connect with Google Analytics".
  3. Select your GA4 property. MonsterInsights will configure tracking automatically.

Method 3: Manual Installation (For Advanced Users)

This method gives you control but requires editing theme files.

  1. Copy your GA4 global site tag from the Data Stream details page.
  2. Go to Appearance > Theme File Editor in WordPress.
  3. Locate header.php and paste the code immediately after the opening <head> tag.
header.php HTML




                        

Replace "G-XXXXXXXXXX" with your actual Measurement ID.

Step 4: Verify Your GA4 Installation

Real-Time Tracking Test

  1. Open your GA4 property and go to Reports > Realtime.
  2. Open your website in a new incognito window.
  3. Check the Realtime report. You should see activity within seconds.

Using Google Tag Assistant

Install the Google Tag Assistant Chrome extension. Navigate to your site and click the icon to verify the GA4 tag is firing correctly.

Step 5: Configure Essential GA4 Settings

Enable Google Signals

Go to Admin > Data Settings > Data Collection and toggle on "Google signals data collection" to track users across devices.

Set Up Internal Traffic Filters

Exclude your own IP address to prevent skewing data. Go to Admin > Data Streams > Configure tag settings > Define internal traffic.

Need Help Configuring GA4?

Setting up custom events and conversions can be tricky. I can audit and configure your entire analytics stack.

Get an Analytics Audit

Conclusion

Setting up Google Analytics 4 on your WordPress site is a crucial step toward understanding your audience and growing your website. While the initial setup takes about 15 minutes, taking time to configure advanced features and create custom reports maximizes the value you get from your analytics data.

Start with the basic installation using one of the three methods outlined in this guide. Verify that tracking works correctly, configure essential settings like internal traffic filters, and gradually add custom events and conversions as you become comfortable with the platform.