You do not need MonsterInsights. You do not need Google Site Kit. You do not need a dedicated analytics plugin at all.
If your SEO plugin already has analytics built in, adding GA4 to WordPress takes exactly one field and about 90 seconds.
Yet a staggering number of WordPress users install a separate plugin just to paste a tracking ID -- adding another 200KB+ of JavaScript, another settings page, another thing to update, and another potential security surface. For what? To do something that belongs in the same tool that already manages your meta tags, sitemaps, and schema.
Let us fix that.
Why Most People Overcomplicate GA4 on WordPress
The analytics plugin market exists because of history, not necessity.
When Google Analytics first launched, WordPress had no built-in way to add tracking code. So plugins like MonsterInsights (originally "Google Analytics for WordPress" by Yoast) filled the gap. They added the tracking snippet and built dashboards on top of it.
That made sense in 2010. It does not make sense in 2026.
Here is why:
Google Analytics 4 already has a full dashboard. GA4's interface at analytics.google.com gives you everything -- real-time visitors, traffic sources, user behavior, conversions, custom events, audience segments. A WordPress dashboard widget showing a simplified version of the same data is redundant.
The tracking code is trivial. GA4 tracking requires exactly two script tags. That is it. There is no complex configuration that justifies a 1MB plugin.
Plugin bloat is real. MonsterInsights (free) adds ~300KB of admin JavaScript. Google Site Kit adds even more, plus it requires OAuth authentication with Google. Both load their assets on every admin page, not just their settings. If you are already running an SEO plugin, a page builder, and WooCommerce, every additional plugin matters.
Security surface increases with every plugin. In 2024 alone, MonsterInsights had two reported vulnerabilities (both patched quickly, but the point stands). Fewer plugins means fewer attack vectors.
The practical solution: use your SEO plugin for analytics tracking. One plugin, one settings page, one update cycle.
The 3 Ways to Add GA4 to WordPress
Here is a direct comparison of your options, ordered from simplest to most involved.
Method 1: SEO Plugin With Built-In Analytics (Recommended)
Several modern SEO plugins now include a GA4 integration field. You paste your Measurement ID, hit save, and tracking is live. No extra plugin, no code editing.
Pros:
- Fastest setup (under 2 minutes)
- No additional plugin overhead
- Role-based exclusion (stop tracking yourself) built in
- One less plugin to maintain and update
Cons:
- No in-dashboard analytics reports (you use analytics.google.com directly)
- Limited to GA4 (no support for other analytics platforms)
This is the right choice for 80%+ of WordPress sites. You need tracking data, and GA4's own dashboard is where you analyze it. The WordPress plugin's job is just to inject the code correctly.
Method 2: Dedicated Analytics Plugin
Plugins like MonsterInsights, ExactMetrics, or Google Site Kit add GA4 tracking plus WordPress dashboard widgets that display your analytics data without leaving the admin panel.
Pros:
- In-dashboard analytics overview
- Additional features (ecommerce tracking, form tracking, custom dimensions)
- Guided setup wizard
Cons:
- Another plugin to install, update, and maintain
- Adds significant JavaScript (200-500KB+)
- Free versions are limited; meaningful features require $99+/year
- Loads assets on every admin page
Use this approach if you genuinely need analytics dashboards inside WordPress -- for example, if you manage sites for clients who should not access the GA4 interface directly.
Method 3: Manual Code Injection
Paste the GA4 tracking code directly into your theme's header.php, use a code snippets plugin, or add it via functions.php.
add_action( 'wp_head', function() {
?>
<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>
<?php
}, 1 );
Pros:
- Zero plugin overhead
- Full control over the tracking code
- Can add custom events and configurations
Cons:
- Lost when switching themes (if added to
header.php) - No role-based exclusion without extra code
- No UI -- you have to edit code to change the tracking ID
- Easy to break if you are not comfortable with PHP
This approach works for developers who want maximum control. For everyone else, it introduces unnecessary risk.
Prime SEO includes GA4 tracking so you don't need MonsterInsights or Site Kit. One SEO plugin, everything included.
Install Free on WordPress.org →
Step-by-Step: Adding GA4 With Prime SEO
Total time: under 2 minutes. Five steps.
Step 1: Get Your GA4 Measurement ID
If you already have a GA4 property, skip to the "find your ID" part. If not, create one:
- Go to analytics.google.com
- Click Admin (gear icon, bottom left)
- Click Create > Property
- Enter your site name, select your time zone and currency
- Click through the business details and objectives
- Choose Web as the platform
- Enter your website URL and stream name
- Click Create stream
Find your Measurement ID:
- In GA4, go to Admin > Data Streams
- Click your web stream
- Your Measurement ID is at the top right -- it looks like
G-XXXXXXXXXX - Copy it
That ID is everything you need. It is not a secret (it is visible in your site's source code to anyone), so do not worry about security here.
Step 2: Open Prime SEO Analytics Settings
In your WordPress admin, go to Prime SEO > Analytics.
Make sure the Analytics module toggle at the top of the page is enabled (it is on by default).
Step 3: Paste the Measurement ID
Find the GA4 Measurement ID field. Paste your G-XXXXXXXXXX ID. That is the entire configuration.
Prime SEO validates the format automatically -- it must start with G- followed by alphanumeric characters. If you accidentally paste a Universal Analytics ID (UA-XXXXXXXX-X) or a GTM container ID (GTM-XXXXXX), the plugin will not accept it. GA4 only.
Step 4: Exclude Admin Roles From Tracking (Optional but Recommended)
Below the Measurement ID field, you will see checkboxes for WordPress user roles:
- Administrator -- check this (you do not want your own visits in the data)
- Editor -- check this if editors regularly access the site
- Author -- optional
- Contributor -- optional
- Subscriber -- usually leave unchecked (these are regular users)
If you have WooCommerce installed, you will also see Shop Manager and Customer roles.
Why this matters: Without role exclusion, your own activity inflates your analytics data. Every time you preview a post, check a page, or test a form, GA4 records it as a visit. On a low-traffic site, admin visits can account for 30-50% of total pageviews -- completely distorting your data.
Step 5: Save
Click Save Changes. GA4 tracking is now live on your site.
The plugin injects the standard Google gtag.js snippet into your site's <head> section with async loading, exactly as Google recommends. It uses WordPress's wp_enqueue_script() function (not inline echo) for proper compatibility with caching plugins and security headers.
Verifying That Tracking Works
Do not just trust that it is working -- verify it.
Method 1: GA4 Real-Time Report
- Open analytics.google.com
- Go to Reports > Realtime
- Open your website in a new incognito/private browser tab (important: use incognito so your admin session does not exclude you)
- Navigate to a few pages on your site
- Within 30 seconds, you should see your visit appear in the Realtime report
If you see activity: tracking is working.
Method 2: View Page Source
- Visit your site while logged out (or in incognito)
- Right-click > View Page Source
- Search for
gtagor your Measurement ID (G-XXXXXXXXXX) - You should see the Google Analytics script tag near the top of the HTML
Method 3: Browser Developer Tools
- Open your site in Chrome
- Press F12 to open Developer Tools
- Go to the Network tab
- Reload the page
- Filter by
google-- you should see requests togoogletagmanager.com
If you do not see tracking after these checks, the most common causes are:
- You are logged in as an excluded role -- check in incognito
- Caching plugin serving a stale page -- purge your cache and recheck
- The module is disabled -- verify the Analytics toggle is on in Prime SEO settings
- Wrong ID format -- make sure it starts with
G-, notUA-orGTM-
What You Can Track With GA4
Once tracking is active, GA4 automatically collects:
- Pageviews -- which pages people visit, how long they stay
- Sessions -- total visits, new vs. returning users
- Traffic sources -- organic search, social media, direct, referral
- Geographic data -- country, city, language
- Device data -- desktop, mobile, tablet, browser, OS
- Engagement metrics -- scroll depth, outbound clicks, file downloads, video plays
- Site search -- what people search for on your site (if you have search)
GA4 also supports custom events and conversions. You can track form submissions, button clicks, purchases, and virtually any user interaction. These are configured in the GA4 interface -- your WordPress plugin's job is simply to load the tracking code.
For most WordPress site owners, the default GA4 data is more than enough. The real value is in the Acquisition reports (where your traffic comes from) and Engagement reports (what people do on your site).
Prime SEO helps your site get discovered by ChatGPT, Perplexity, and AI search engines.
Install Free on WordPress.org →
Frequently Asked Questions
Do I still need MonsterInsights if my SEO plugin adds GA4?
No. If your only goal is to track pageviews and traffic sources with GA4, an SEO plugin with built-in analytics handles the tracking code injection. MonsterInsights adds value only if you specifically need in-WordPress dashboard reports, enhanced ecommerce tracking, or form conversion tracking. For the majority of sites, the GA4 dashboard at analytics.google.com provides all the reporting you need.
Will adding GA4 through a plugin slow down my site?
The GA4 tracking script itself (gtag.js) is loaded asynchronously, meaning it does not block page rendering. The performance impact is negligible -- typically under 50ms of additional load time. The difference between adding GA4 through a plugin versus manually is essentially zero, since both methods inject the same Google script. What does affect performance is installing a heavy analytics plugin that loads its own JavaScript on top of the Google script.
Can I use GA4 and Google Tag Manager at the same time?
Yes, but you should not add GA4 through both GTM and a WordPress plugin simultaneously -- that results in double-counting every pageview. Pick one method. If you use GTM for managing multiple marketing tags (Facebook Pixel, LinkedIn Insight, etc.), configure GA4 inside GTM and remove it from your WordPress plugin. If GA4 is your only tracking need, skip GTM entirely and use the plugin method.
How do I stop tracking myself on my own site?
The simplest method is role-based exclusion in your SEO plugin. In Prime SEO, check the "Administrator" box under "Exclude from Tracking" in the Analytics settings. This prevents the GA4 script from loading for any logged-in administrator. For a complete overview of the Analytics module settings, see the Analytics documentation.
Ready to optimize for AI search?
Prime SEO is the first WordPress plugin built for AI search engines. Free forever.
Install Free Plugin