Analytics Setup
Connecting Google Analytics 4 to a WordPress Site
Create a GA4 property, wire it into WordPress with a plugin or a manual tag, then confirm real visitor data is actually arriving.
5 Min
Typical time to connect GA4 via a plugin
1-Click
WordPress installers make analytics plugins easy to add
24/7
Human support if a tracking code won't save
Free
GA4 property creation and standard reporting
In short
To add Google Analytics to WordPress: create a GA4 property in analytics.google.com, copy its Measurement ID (starts with G-), then connect it either through a plugin (Site Kit by Google or an analytics plugin's settings field) or by pasting the gtag.js snippet into the site's header via a header/footer plugin or theme setting. Afterward, open GA4's Realtime report and browse the live site to confirm visits are logging.
Skipping the Realtime check is the most common mistake — a mistyped Measurement ID or a caching plugin stripping the script tag both look identical to 'no data yet' unless verified directly.
Google Analytics tells a site owner what a WordPress dashboard never can: which pages visitors actually read, where they came from, and where they leave. But GA4 replaced the older Universal Analytics several years back with a different data model and a different setup flow, and a lot of tutorials still describe the old version's steps.
This guide walks through the current GA4 process end to end — creating the property, choosing a connection method that fits a WordPress site's technical comfort level, and, critically, confirming the connection actually works before trusting the numbers for a business decision.
Step One: Create the GA4 Property and Get the Measurement ID
Inside a Google Analytics account (analytics.google.com), creating a new property involves naming it, setting the reporting time zone and currency, and answering a short business-details questionnaire. GA4 then generates a data stream for the website, and that data stream is where the Measurement ID lives — a short string formatted like G-XXXXXXXXXX that identifies exactly which site is sending data.
This ID is the only piece of information WordPress actually needs to start tracking. Everything after this step is really just about getting that ID, and the tracking script it triggers, loaded onto every page of the site.
Connecting via a Plugin (the Beginner-Friendly Route)
Site Kit by Google is Google's own official plugin and, once installed from the WordPress plugin directory, walks through signing in with a Google account and picking the right GA4 property automatically — no manual code required. It also surfaces basic Analytics numbers directly inside the WordPress dashboard, which is convenient for a quick daily glance.
Alternatively, many SEO and analytics plugins simply provide a settings field to paste in the Measurement ID directly, which the plugin then injects into the site's header on every page. Either route avoids touching theme files, which matters because theme files get overwritten on updates and a hand-edited tracking snippet placed there can silently disappear.
Connecting Manually via the gtag.js Snippet
For anyone who prefers not to add another plugin, GA4's setup screen provides a full gtag.js snippet that can be pasted directly into a theme's header using a 'header and footer scripts' plugin, or into a child theme's header.php file just before the closing head tag. This method gives the most direct control and is the same approach used outside WordPress entirely.
The risk with manual installation is duplication — pasting the snippet twice, or once in a plugin and once in the theme, causes GA4 to count some visits twice and inflate every report. If numbers ever look suspiciously high, checking the page source for two gtag('config'... calls is the first thing to rule out.
Verifying the Tracking Is Actually Working
GA4's Realtime report, found in the Reports section of the property, shows visitors on the site within the last 30 minutes. Opening the site in a separate browser tab, clicking through a few pages, and watching that Realtime count tick up is the fastest and most reliable way to confirm the connection is live — far faster than waiting a day for standard reports to populate.
If Realtime shows nothing after several minutes of browsing, the usual causes are a caching plugin serving an old cached page without the new script, an ad blocker on the testing browser hiding the request, or the Measurement ID being pasted with a typo. Testing in a private browser window with no extensions rules out the ad-blocker possibility immediately.

Hosting That Doesn't Fight Your Tracking Setup
A tracking snippet is only as reliable as the page it's attached to — Hosting Cheap's NVMe SSD and LiteSpeed stack keeps pages loading fast enough that GA4's script fires before a visitor bounces, which matters for accurate bounce-rate and engagement numbers.
The cPanel-style panel's one-click installer makes it simple to add Site Kit or another analytics plugin during initial WordPress setup, so tracking can go live the same day a site does rather than being an afterthought weeks later.
- 1-click WordPress installer to add analytics plugins fast
- Pure NVMe SSD + LiteSpeed so tracked pages load quickly
- 24/7 human support if a Measurement ID won't connect
- Free auto-renewing SSL, which GA4 and most plugins expect
Why Hosting Cheap
What you get
Fast Pages, Cleaner Data
NVMe SSD and LiteSpeed reduce the chance a slow page load causes GA4's script to miss a visit.
1-Click Plugin Installs
Add Site Kit or an analytics plugin through Softaculous during initial WordPress setup.
24/7 Human Support
Get help if a tracking snippet won't save or a plugin conflicts with the theme.
Free Managed Migration
Moving an existing tracked site over preserves the same GA4 connection without starting over.
Daily Backups
A snapshot to restore to if a header-script edit breaks the site while adding tracking.
Free Auto-Renewing SSL
HTTPS is expected by GA4 and most modern browsers before scripts are trusted fully.
How It Works
Get set up in a few steps
Create the GA4 property
Sign into Google Analytics, add a new property for the site, and copy the Measurement ID from its data stream.
Connect it to WordPress
Install Site Kit or paste the Measurement ID into an analytics plugin's settings field, or add the gtag.js snippet manually.
Verify with the Realtime report
Browse the live site in another tab and confirm the visit appears in GA4's Realtime section within a minute or two.
Included
Everything you need, on every plan
- GA4 property created with the correct time zone and currency
- Measurement ID (G-XXXXXXXXXX) copied without typos
- Tracking added via plugin or manual snippet, never both
- Caching plugin cache cleared after adding the tracking code
- Realtime report tested in a private browser window
- Only one gtag('config'...) call present in the page source
- Google account access shared with any team member who needs reports
FAQ
Frequently asked questions
Do I need a plugin to add Google Analytics to WordPress?
No, a plugin isn't required — the gtag.js snippet can be pasted manually into a theme's header. A plugin like Site Kit is simply the faster, lower-risk route for anyone who doesn't want to edit theme files directly.
How long until Google Analytics starts showing data?
The Realtime report can show a visit within seconds to a couple of minutes of it happening. Standard reports (by day, by page, by source) usually take up to 24-48 hours to fully populate after the connection first goes live.
Why does GA4 show zero visitors even after I connected it?
The most common causes are a caching plugin serving old pages without the new script, an ad blocker on the browser used for testing, or a mistyped Measurement ID. Testing in a private browser window with no extensions rules out most of these quickly.
Can I use GA4 alongside an SEO plugin's built-in analytics?
Yes, GA4 and an SEO plugin's own analytics dashboard can run side by side without conflict, since most SEO plugins simply read from GA4's data via the API rather than tracking separately.
Is Universal Analytics still an option instead of GA4?
No, Universal Analytics stopped processing new data some time ago, so GA4 is the only current version Google supports for new or existing WordPress sites.
Will adding Google Analytics slow down my WordPress site?
The gtag.js script is small and loads asynchronously, so its effect on page speed is minimal on a well-optimized site. Pairing it with fast NVMe-based hosting and a caching plugin keeps any impact negligible.
Related hosting
WordPress Hosting
Fast, one-click WordPress hosting built for adding plugins like Site Kit without slowdowns.
SSL Certificates
Free auto-renewing HTTPS, which GA4 and modern browsers expect before trusting a site's scripts.
CMS Hosting
General content-platform hosting for sites tracking traffic across more than just WordPress.
Host a Site That's Ready to Track From Day One
Get WordPress hosting with 1-click installers, NVMe speed, and 24/7 support while you set up Google Analytics.
Get Started