How to add Google Analytics 4 to WordPress

10 min · no code needed · updated June 2026

Quick answer. The easiest way to add GA4 to WordPress is the free Site Kit by Google plugin: install it, connect your Google account, and it wires up Analytics for you, no code. If you'd rather paste the tag yourself, use a header-code plugin like WPCode to drop Google's gtag.js snippet into your site's head. Avoid using two methods at once or you'll double-count every visit.

Two methods, both free, both work. Pick one. Not both.

What you'll need

Add GA4 to WordPress

  1. Install Site Kit. In WordPress admin, go to Plugins, Add New and search Site Kit by Google. Install and activate it.
  2. Connect your account. Click Connect Google Account and sign in. Follow the prompts to set up Analytics and choose or create your GA4 property. Site Kit adds the tag for you.
  3. Or paste it yourself. Install WPCode instead, go to Code Snippets, Header and Footer, and paste your gtag.js snippet into the Header box. Save.
  4. Don't do both. One method only. Two tags double-count every visit.

Do it with AI

Want to add it by editing your theme instead of a plugin?

Add GA4 to my WordPress theme by hand
I want to add Google Analytics 4 to my WordPress site by editing code, not a
plugin. My Measurement ID is G-XXXXXXX. Show me the safest way to add the
gtag.js snippet to the <head> on every page using a child theme or a code
snippet plugin, so it survives theme updates. Then tell me how to verify it.

How to check it worked

Open GA4, go to Reports, Realtime, then visit your site in another tab. You should appear as an active user within seconds. Site Kit also shows a status tick once connected.

Common mistakes

FAQ

What's the easiest way to add GA4 to WordPress?
The free Site Kit by Google plugin. Install, connect your Google account, and it sets up Analytics with no code.
Do I need a paid plugin like MonsterInsights?
No. Site Kit (free, official) or a free code plugin like WPCode both work. Paid plugins add reports inside WordPress, not better tracking.
Will it slow my site down?
The GA4 tag is lightweight and loads asynchronously. One tag is fine. Multiple overlapping tags are what cause bloat.

Tag's in. Now you still have to read it.

Holy Bucket reads your WordPress site's GA4 and tells you what's leaking, in plain English.

Keep going

Last updated June 2026. By Holy Bucket.