How to Set Up Google Analytics 4 on WordPress (Step-by-Step 2026)

Introduction: Why GA4 Matters for Bloggers

Universal Analytics is gone — Google switched off the legacy platform in mid-2024, and GA4 is now the only analytics product Google supports. If you have been avoiding the migration or starting a new blog from scratch, this guide will get you from zero to a fully configured, data-collecting GA4 setup in under 30 minutes.

What GA4 tells you that actually matters for bloggers: which posts drive the most traffic and from where, how long readers genuinely engage with your content (engagement rate, not just bounce rate), which geographic markets read your blog, how readers navigate between posts, and — if you run AdSense — how that traffic converts to revenue.

What’s New in GA4 in 2026

  • Gemini AI integration: GA4 now surfaces AI-generated insights directly in the reporting interface — flagging unusual traffic spikes, audience shifts, and content performance anomalies without you having to dig for them. Available in all property types.
  • Improved eCommerce reporting: More granular purchase funnel data and cross-channel attribution modelling.
  • Consent Mode v2: Required for accurate data collection in European markets — covered in the troubleshooting section.
  • Enhanced engagement metrics: Scroll depth and active engagement time are now core metrics, not just events.

laptop computer on glass-top table

Two setup methods: Plugin method (Google Site Kit or MonsterInsights) — easier, takes 5 minutes, adds a small page load overhead. Manual method (code injection) — slightly faster page load, requires one extra step, no plugin dependency. Both work identically from GA4’s perspective.

 

Step 1: Create a Google Analytics 4 Property

Before installing anything on WordPress, you need a GA4 property to connect to. This is where your data will be collected and stored.

  1. Go to analytics.google.com and sign in with your Google account (the same account that owns your Search Console and AdSense, if applicable).
  2. Click the gear icon (Admin) at the bottom left of the left sidebar.
  3. Under the ‘Property’ column, click ‘Create Property.’
  4. Enter your Property Name (e.g., ‘My Tech Blog’), set your Reporting Time Zone to India Standard Time (IST, UTC+5:30), and set Currency to Indian Rupee (INR).
  5. Click Next. Fill in your business category and size, then click Next again.
  6. On the ‘Choose a platform’ screen, select ‘Web.’
  7. Enter your website URL (e.g., myblog.com — no https:// prefix) and a Stream Name (e.g., ‘My Tech Blog – Web’). Click ‘Create Stream.’

 

Finding Your Measurement ID

After creating the stream, GA4 displays your Measurement ID in the format G-XXXXXXXXXX. This is the key piece of information you need for all three setup methods below. Copy it and keep it accessible — you will need it in the next step.

Screenshot tip: Take a screenshot of your Measurement ID screen before proceeding. The ID is also always accessible later via Admin > Data Streams > your stream > Measurement ID.

 

Step 2A: Plugin Method — Google Site Kit (Recommended for Beginners)

Google Site Kit is the official Google plugin for WordPress. It connects GA4, Google Search Console, PageSpeed Insights, and AdSense through a single authenticated integration — no code required.

  1. In your WordPress admin, go to Plugins > Add New Plugin.
  2. Search for ‘Site Kit by Google.’ Install and activate the official plugin (5+ million active installs).
  3. Click ‘Start Setup’ in the Site Kit dashboard prompt.
  4. Sign in with the Google account that owns your GA4 property. Grant the requested permissions.
  5. Site Kit will verify site ownership (it adds a meta tag to your homepage automatically). Click ‘Verify.’
  6. On the ‘Connect a Service’ screen, select Google Analytics. Choose your GA4 property from the dropdown (the one you created in Step 1).
  7. Click ‘Complete Setup.’ Site Kit confirms the connection and begins collecting data.

 

What Site Kit Shows in Your WordPress Dashboard

  • Traffic overview: sessions, users, and pageviews for the past 28 days
  • Top content: your best-performing posts by traffic
  • Search Console queries: which keywords bring traffic (after Search Console is also connected)
  • Real-time active users on your site

Performance consideration: Site Kit adds approximately 50-100ms to page load time on the first connection due to its authentication scripts. Once connected and cached, the impact is negligible. For most bloggers, this is an acceptable trade-off for the setup simplicity. If you are highly performance-sensitive, use the manual method in Step 2C.

 

Step 2B: Plugin Method — MonsterInsights

MonsterInsights is the most popular third-party GA4 plugin for WordPress, and many experienced bloggers prefer it over Site Kit because it surfaces more granular reporting inside WordPress without requiring you to leave the admin dashboard.

  1. Install MonsterInsights Lite (free) from Plugins > Add New.
  2. After activation, click ‘Launch Setup Wizard’ in the MonsterInsights prompt.
  3. Select your site category (blog, publisher, eCommerce). Click ‘Connect MonsterInsights.’
  4. Authenticate with your Google account and select your GA4 property.
  5. Complete the wizard — it configures recommended event tracking settings automatically.

 

Key MonsterInsights Reports Inside WordPress

  • Overview report: Traffic trends, top sources, top posts/pages — the executive summary of your blog’s performance.
  • Publisher report (Lite): Top landing pages, exit pages, and outbound link click tracking — highly relevant for content bloggers.
  • Search Console report (Pro): Keyword rankings and click data mapped to specific posts.
Feature MonsterInsights Lite (Free) MonsterInsights Pro ($99.50/yr)
GA4 connection Yes Yes
Overview dashboard in WP Yes Yes
Publisher report Yes Yes (enhanced)
eCommerce tracking No Yes
Search Console report No Yes
Form conversion tracking No Yes
Scroll depth tracking No Yes
Custom dimensions No Yes

 

Affiliate link:

 

Step 2C: Manual Method — No Plugin Required

The manual method places GA4’s tracking code directly in your WordPress theme, eliminating the plugin overhead entirely. Use this if you are comfortable with WordPress theme files and want the cleanest possible setup.

Method 1: Insert Headers and Footers Plugin (Safer)

‘Insert Headers and Footers’ by WPCode is a free plugin that lets you inject code into your site’s head section without touching theme files — and it survives theme updates, unlike direct theme edits.

  1. Install ‘WPCode — Insert Headers and Footers + Custom Code Snippets’ from the plugin directory.
  2. Navigate to Code Snippets > Header & Footer.
  3. In the ‘Header’ section, paste your GA4 tracking snippet (available in GA4 via Admin > Data Streams > your stream > View tag instructions).
  4. Click Save Changes.

 

Method 2: Child Theme functions.php

Open your child theme’s functions.php file via Appearance > Theme File Editor > child-theme/functions.php and add the following, replacing G-XXXXXXXXXX with your actual Measurement ID:

function add_ga4_tracking() { echo “<script async src=’https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX’></script>”; } add_action(‘wp_head’, ‘add_ga4_tracking’);

Important: Always edit functions.php in a child theme, never the parent theme. Parent theme updates overwrite any changes made directly to the parent’s files.

 

Verify Installation with GA4 DebugView

  1. In your browser, install the ‘Google Analytics Debugger’ Chrome extension.
  2. Enable the extension and visit your website.
  3. In GA4, go to Admin > DebugView. You should see your session appearing in real time with events listed (page_view, scroll, etc.).
  4. Confirm events are firing correctly before considering the setup complete.

 

Step 3: Verify the Installation is Working

Realtime Report Check

Open your blog in a separate browser tab or incognito window. In GA4, navigate to Reports > Realtime. Within 30 seconds, you should see ‘1 user in last 30 minutes’ appear. If you see zero users after a minute of browsing your site, the tracking code is not firing correctly.

Common Installation Issues

  • Data not showing after 24-48 hours: Normal — GA4 processes historical data with a delay. Realtime data should appear immediately; standard reports update within 24-48 hours.
  • Duplicate tracking (seeing double the traffic): Caused by having both a plugin and manual code active simultaneously. Remove one. Check via DebugView — if you see two page_view events per page load, you have duplicate tracking.
  • Consent mode conflicts: If you use a GDPR consent plugin (CookieYes, Complianz), ensure it is configured to work with GA4 Consent Mode v2. Without this, GA4 may show fewer users than expected for European visitors.

 

Step 4: Configure Key GA4 Settings

Installing the tracking code is just the beginning. These four configuration steps significantly improve the quality and usefulness of your data.

1. Set Up Internal Traffic Filter (Exclude Your Own Visits)

Without this, every time you visit your own blog to check formatting or proofread, your visit is counted as a user session — inflating your traffic numbers and distorting engagement metrics.

  1. Find your IP address at whatismyip.com.
  2. In GA4: Admin > Data Streams > your stream > Configure tag settings > Define internal traffic.
  3. Click ‘Create’ and enter your IP address. Set the traffic_type value to ‘internal.’
  4. Then go to Admin > Data Filters > Create Filter > Internal Traffic filter. Set the filter state to ‘Active.’

 

2. Connect Google Search Console

  1. In GA4: Admin > Property Settings > Product Links > Search Console Links.
  2. Click ‘Link’ and select your verified Search Console property.
  3. Once linked, the ‘Queries’ report under Reports > Acquisition > Search Console shows which keywords drive your traffic — the most valuable SEO data available for free.

 

3. Extend Data Retention to 14 Months

GA4’s default data retention period is two months — meaning older data disappears from exploration reports after two months. For bloggers tracking long-term content performance, this is inadequate.

  1. Go to Admin > Data Settings > Data Retention.
  2. Change ‘Event data retention’ from 2 months to 14 months (the maximum on the free tier).
  3. Enable ‘Reset user data on new activity’ to keep active users’ data fresh.

 

4. Enable Google Signals

Google Signals enables cross-device tracking — understanding when the same person visits your blog from their phone in the morning and their laptop in the afternoon. Go to Admin > Data Settings > Data Collection > Google Signals Data Collection and toggle it on. Note: requires users to be signed into a Google account to function.

 

Step 5: GA4 Reports Every Blogger Should Know

Traffic Acquisition — Where Your Visitors Come From

Navigate to Reports > Acquisition > Traffic Acquisition. This report shows your traffic broken down by channel: Organic Search (Google), Direct, Referral, Social, and Email. For most bloggers, Organic Search should be the dominant channel as the site matures. A high Direct percentage often indicates strong brand recognition or newsletter traffic.

Pages and Screens — Your Best-Performing Posts

Navigate to Reports > Engagement > Pages and Screens. Sort by Views to identify your most-visited posts. Sort by Average Engagement Time to identify which content readers actually read versus skim. A post with high views but low engagement time signals content that does not deliver on its title — a revision opportunity.

Events — What Readers Do on Your Site

GA4 automatically tracks scroll depth (scroll event with percent_scrolled parameter), outbound clicks (click event), and file downloads. Navigate to Reports > Engagement > Events to see these. The scroll event data tells you what percentage of readers reach the bottom of each post — critical for understanding where to place your affiliate CTAs.

Setting Up a Custom Blogging Dashboard

  1. In GA4, navigate to Reports > Library (the small book icon at the bottom of the Reports sidebar).
  2. Click ‘Create new report’ > ‘Create overview report.’
  3. Add the following cards: Sessions by Channel, Top Pages by Views, Average Engagement Time, New vs Returning Users, Top Countries.
  4. Save and name it ‘Blogging Dashboard.’ Pin it to the top of your Reports navigation.

 

GA4 + AdSense Integration

Linking GA4 to your AdSense account unlocks revenue data inside Analytics — you can see which specific posts and traffic sources generate the most ad revenue, not just overall AdSense earnings.

  1. In GA4, go to Admin > Product Links > Google AdSense Links.
  2. Click ‘Link’ and select your AdSense account from the dropdown (it must be the same Google account).
  3. The link completes within 24 hours.

 

Reports Unlocked After Linking

  • Publisher overview: Ad revenue, RPM (revenue per 1,000 impressions), and ad clicks by page
  • Monetisation > Publisher ads: Revenue breakdown by traffic channel — reveals whether organic search or social media monetises better on your specific blog
  • Revenue by content: Which individual posts generate the most AdSense revenue — essential for deciding where to invest future writing effort

 

Common GA4 Problems and Solutions

Problem Cause Solution
No data for 24-48 hours Normal processing delay Check Realtime first; standard reports update in 24-48 hrs
Bounce rate shows 0% GA4 uses Engagement Rate, not Bounce Rate Go to Reports > Customise > add Bounce Rate metric manually if needed
Referral spam inflating traffic Bot traffic from spam domains Admin > Data Filters > Create filter for internal/spam traffic
Duplicate pageview events Plugin + manual code both active Remove one tracking method; verify with DebugView
European users not tracked Consent Mode v2 not configured Configure your consent plugin for GA4 Consent Mode v2
Search Console data missing Properties not linked Admin > Product Links > Search Console Links

how to set up Google Analytics 4 WordPress, GA4 WordPress tutorial 2026, connect GA4 WordPress

Scroll to Top