Analytics (GA4)
Connect Google Analytics 4 to your WordPress site with a simple, lightweight integration.
On this page
Overview
Prime SEO includes a lightweight Google Analytics 4 (GA4) integration. It adds the GA4 tracking script to your site's frontend without any bloat — no dashboard widgets, no heavy reporting features. Just clean, efficient tracking.
Navigate to Prime SEO → Analytics to configure.
Setting Up GA4
Navigate to the Analytics page
Go to Prime SEO → Analytics in your WordPress admin panel.
Enable the Analytics module
Toggle the module switch at the top of the page to enable it.
Enter your GA4 Measurement ID
Paste your Measurement ID (starts with
G-) into the input field.
Save Changes
Click Save Changes. The tracking script loads automatically on all frontend pages after saving.
Finding Your Measurement ID
If you don't have your GA4 Measurement ID yet, follow these steps to find it:
Open Google Analytics
Go to analytics.google.com and sign in.
Open Admin settings
Click Admin (gear icon at the bottom left).
Go to Data Streams
In the Property column, click Data Streams.
Select your web stream
Click on the web data stream for your site.
Copy the Measurement ID
You'll see the Measurement ID at the top of the stream details. It follows the format
G-XXXXXXXXXX.
Important
Make sure you're using a GA4 property, not a Universal Analytics (UA-) property. Universal Analytics was sunset by Google in July 2024.
Role Exclusions
You can exclude specific WordPress user roles from being tracked. This prevents admin visits from inflating your analytics data.
Common exclusions:
- Administrator — always recommended
- Editor — recommended for editorial teams
- Author — optional
Navigate to the Analytics settings and check the roles you want to exclude.
Tip
At minimum, exclude the Administrator role to keep your analytics clean. Your own visits while managing the site would otherwise skew the data.
Tracking Behavior
The GA4 tracking script:
- Loads on all frontend pages (not in wp-admin)
- Uses the official Google
gtag.jslibrary - Respects role exclusions — logged-in users with excluded roles don't get tracked
- Does not add any tracking to the WordPress admin area
Troubleshooting
No data in Google Analytics
- Verify your Measurement ID is correct (starts with
G-) - Check that the module is enabled
- Wait 24–48 hours — GA4 data can take time to appear
- Make sure you're not logged in as an excluded role
Tracking script not loading
- Check if the Analytics module is enabled in Prime SEO → Settings
- Verify no caching plugin is serving an old version of your pages
- View page source and search for
gtagto confirm the script is present
Warning
If you're using another analytics plugin or manually adding GA4 code, disable one to avoid duplicate tracking.
Ready to optimize your site?
Install Prime SEO in under 2 minutes. Free forever.
Install Free Plugin