In this guide: How to set up Google Analytics 4 on WordPress: create a GA4 property, add the tag with a plugin or code, configure key events, and the reports to check weekly.
If you don’t measure your website, you’re guessing. Google Analytics 4 (GA4) is free and tells you who visits your site, where they come from, what they do, and which pages lead to results like signups or sales.
Here’s how to set it up on WordPress and start using it properly.
GA4 answers questions like:
GA4 is event-based: every interaction — page views, scrolls, clicks, form submissions, purchases — is tracked as an event. You choose which events count as key events (formerly “conversions”).
G-).Choose one method — never add the tag twice.
Option 1 — Google Site Kit (official plugin)
Option 2 — Your SEO or analytics plugin
Many SEO plugins and analytics plugins (like MonsterInsights or similar) let you paste your Measurement ID.
Option 3 — Google Tag Manager
Best for advanced tracking and multiple marketing tags. Install GTM, then add a GA4 tag inside it.
Option 4 — Add the code manually
Paste the Google tag snippet into your theme’s <head> using a code snippets plugin or your child theme. Theme updates won’t remove it if done correctly.
Verify it works: open your site in another browser and check Reports → Realtime in GA4. You should see yourself as an active user within a minute.
Privacy: if you have visitors from regions with strict privacy laws, use a consent banner and consider Google’s Consent Mode. See Privacy Policy and Cookie Consent.
Page views alone don’t tell you if your site works. Mark the actions that matter as key events:
/thank-you/) or a form submission event from your form plugin.How to mark an event as a key event:
You can also create custom events based on existing ones — for example, a generate_lead event when page_location contains /thank-you/.
Also: link GA4 with Google Search Console (Admin → Product links) to see search queries alongside behavior data, and set data retention to the maximum available.
Spend 10 minutes each week on:
Use UTM parameters on campaign links (email, social, ads) to know exactly which campaign sent each visitor — see UTM Parameters.
Why does GA4 show fewer users than my hosting stats?
Ad blockers, consent choices, and bots filtered from GA4 cause differences. Server logs count everything, including bots.
How long until data shows?
Realtime works within minutes; standard reports can take 24–48 hours.
Further reading: official WordPress documentation
We may earn a commission on purchases made through these links, at no extra cost to you.
Don’t miss the chance to participate in the biggest giveaway of this year.