Google Analytics tells you exactly how people find a WordPress site, what they click, and where they leave, but only if it’s actually installed correctly. A proper Google Analytics 4 WordPress setup takes about 15 minutes and works the same way whether the site runs on shared hosting or a managed WordPress host.
This guide covers what GA4 actually is, the three real ways to connect it to WordPress, and the mistakes that quietly break tracking data after setup.
What Is Google Analytics 4?
Google Analytics 4, or GA4, is Google’s current analytics platform, and it replaced the older Universal Analytics, which stopped processing data in July 2023. GA4 tracks visitor behavior using events instead of the old pageview-and-session model, which means it can follow a single visitor across a WordPress site, a mobile app, and other properties as one connected journey.
Every GA4 property has a unique Measurement ID in the format G-XXXXXXXXXX, and that ID is what actually connects a WordPress site to a specific GA4 property. Without it correctly installed on every page, no data reaches the GA4 dashboard at all.
How Do You Find Your GA4 Measurement ID?
The Measurement ID is generated the moment a new GA4 property is created inside a Google Analytics account, and it’s found under Admin > Data Streams > (your web stream) in the Google Analytics dashboard. It always starts with “G-” followed by ten characters, and copying it correctly matters, since a single wrong character means the WordPress site sends no data anywhere.
Setting this up starts at analytics.google.com. Creating a property requires a property name, reporting time zone, and currency, followed by adding a “Web” data stream with the WordPress site’s URL. Google generates the Measurement ID automatically once that data stream is created.
Method 1: Site Kit by Google (Recommended)
Site Kit by Google is Google’s own official WordPress plugin, and it connects GA4, Search Console, and PageSpeed Insights to a WordPress dashboard without writing any code. According to WordPress.org, Site Kit has over 5 million active installations and a 4.2 out of 5 rating, making it the most widely used way to connect Google’s tools to WordPress.
Installing it means going to Plugins > Add New in the WordPress dashboard, searching for “Site Kit by Google,” and clicking Install and Activate. The plugin then walks through connecting a Google account and either creating a new GA4 property or linking an existing one, and it inserts the tracking code automatically, with no manual editing of theme files required. Since Site Kit also connects Google Search Console, sites that already have Search Console set up can link both tools from the same plugin.
Method 2: A Dedicated Analytics Plugin
Plugins built specifically for analytics, like MonsterInsights, add GA4 tracking along with pre-built reports inside the WordPress dashboard itself, so traffic data can be checked without leaving WordPress. These plugins typically ask for the Measurement ID or a Google account connection during setup, then handle inserting the tracking script on every page automatically.
The tradeoff against Site Kit is that most dedicated analytics plugins put their fuller reporting and event tracking features behind a paid tier, while the free version mainly just installs the tracking code.
Method 3: Manual Code Installation
Manual installation means pasting the GA4 tracking snippet directly into a WordPress site’s header, either by editing the theme’s header.php file or through a code snippets plugin, without installing a full analytics plugin.
- Copy the GA4 tracking snippet from Admin > Data Streams > (web stream) > View tag instructions in Google Analytics.
- Open the WordPress site’s active theme and locate header.php, or open a code snippets plugin instead of editing theme files directly.
- Paste the snippet immediately before the closing </head> tag.
- Save the change and confirm the tracking code appears by viewing the page source of the live site.
This method avoids installing an extra plugin, but it also means the tracking code gets wiped out the moment the theme updates, unless a child theme or a dedicated code snippets plugin is used to hold it instead.
Site Kit vs Analytics Plugin vs Manual Code
Each method installs the same underlying GA4 tracking code, but they differ in setup time, ongoing maintenance, and what happens when a theme updates. The table below compares the three side by side.
| Feature | Site Kit by Google | Dedicated Analytics Plugin | Manual Code |
|---|---|---|---|
| Setup time | About 5 minutes | 5-10 minutes | 10-15 minutes |
| Coding required | No | No | Yes |
| Survives theme updates | Yes | Yes | Only with a child theme or snippets plugin |
| Best for | Most WordPress sites | Sites wanting built-in reports | Developers avoiding extra plugins |
Is My GA4 Setup Actually Working?
The fastest way to confirm GA4 is tracking correctly is the Realtime report inside Google Analytics, found under Reports > Realtime, which shows active visitors on the site within seconds of a page load. Opening the WordPress site in an incognito browser tab and checking whether that visit appears in Realtime confirms the Measurement ID and tracking code are both installed correctly.
If nothing shows up in Realtime after a few minutes, the most common cause is a caching plugin serving a cached version of the page from before the tracking code was added. Clearing the site’s cache, similar to the caching checks covered when comparing WordPress caching plugins, usually resolves it immediately.
Common GA4 Setup Mistakes
Running two different tracking methods at once, like activating Site Kit and a separate analytics plugin at the same time, sends duplicate pageview events and inflates every report with double-counted traffic. Only one method should ever be active on a single WordPress site.
Forgetting to exclude internal traffic is another common mistake, where a site owner’s own visits during testing and daily browsing get counted as regular visitor traffic, quietly skewing every report. Setting up an internal traffic filter in GA4’s Admin settings, using the site owner’s home or office IP address, keeps that traffic out of the real numbers.
A Google Analytics 4 WordPress setup that only takes 15 minutes to do correctly can save hours of confusion later, when traffic numbers finally make sense instead of looking randomly inflated or completely empty. Getting the Measurement ID right and picking exactly one installation method is most of the work; everything else is just double-checking that Realtime actually shows real visits.
Frequently Asked Questions
A GA4 Measurement ID is a unique code in the format G-XXXXXXXXXX that connects a specific website to a GA4 property, found under Admin > Data Streams in the Google Analytics dashboard.
Yes, Site Kit by Google is completely free and available on WordPress.org, with over 5 million active installations. It connects GA4, Search Console, and PageSpeed Insights without any paid tier required.
Missing data is most often caused by an incorrectly copied Measurement ID, a caching plugin serving old pages without the tracking code, or two analytics methods conflicting with each other. Checking the Realtime report in an incognito tab isolates which of these is the cause.
Running two analytics plugins or tracking methods at once causes duplicate pageview events, which inflates every report with double-counted traffic. Only one GA4 installation method should be active on a WordPress site at any time.
The GA4 tracking script is small and loads asynchronously, so a correctly installed setup has a negligible effect on page speed compared to larger factors like unoptimized images or a heavy theme.

Leave a Reply