How to Set Up Google Analytics 4 on Your WordPress Site

Set Up GA4 in WordPress

How to Set Up Google Analytics 4 on Your WordPress Site

Here’s a step-by-step guide to setting up Google Analytics 4 (GA4) on a WordPress site. I’ll include options (with and without plugins) so you can pick what fits your setup best.


1. Create a GA4 property in Google Analytics

If you haven’t already done this, you need to:

  1. Go to Google Analytics and sign in with your Google account.
  2. In the left sidebar, click Admin (gear icon).
  3. Under the “Account” column, select or create the account you want to use.
  4. Under the “Property” column, click + Create Property. Google Help+1
  5. Provide a property name, choose the reporting time zone, currency, etc., then click Next and fill business details. Google Help
  6. After the property is created, you’ll set up a Data Stream. Choose “Web”, enter your site URL and a stream name. Google Help+2Google Help+2
  7. Once the web stream is created, Google will give you a Measurement ID (starts with “G-”) and instructions for installing the Google tag (gtag.js). Google Help+2Google Help+2

Keep your Measurement ID handy, because you’ll need to put that into your WordPress site.


2. Add GA4 to your WordPress site

There are a few ways to integrate GA4. I’ll cover the major ones and their trade-offs.

Option A: Use a plugin (easiest and safer for most users)

Using a plugin is typically the easiest, because it reduces the risk of messing up theme files. Some good choices:

  • Site Kit by Google — Google’s official plugin for WordPress that supports GA4.
  • MonsterInsights — Has GA4 support and additional tracking features. MonsterInsights+2WPBeginner+2
  • Analytify — Good alternative, integrates with GA4. Kinsta®+1
  • HT Easy GA4 — Lightweight plugin where you just enter your Measurement ID. WordPress.org

Example: Using HT Easy GA4

  1. In WordPress dashboard, go to Plugins ? Add New.
  2. Search for “HT Easy GA4” and install + activate. WordPress.org
  3. Once active, go to its settings page (usually under “Settings” or a new menu).
  4. Enter your GA4 Measurement ID. Save. WordPress.org
  5. (Optional) Configure extra settings (e.g. exclude admin users, enable event tracking).

Pros:

  • No editing of theme files.
  • Updates and compatibility tend to be safer.
  • Many plugins add extra tracking (downloads, scrolls, outbound links) automatically.

Cons:

  • Adds another plugin overhead.
  • Some advanced features may be behind a paywall.

Option B: Manually insert the GA4 tag (no plugin)

This is more hands-on and risky (if your theme updates, you could lose your code). Use a child theme if possible.

  1. Copy the gtag.js snippet from the GA4 “Install” instructions (they show how to “Add new tag ? gtag.js code”). Google Help+2Google Help+2
  2. In WordPress Admin, go to Appearance ? Theme Editor (or use FTP).
  3. Open header.php (or the file that outputs <head>).
  4. Paste the gtag.js snippet just before the closing </head> tag.
  5. Save.

After that, your site should start sending data to GA4.

Note: If your theme or WordPress setup has a “header scripts” or “custom code injection” area (e.g. under theme settings), you can use that instead of editing files directly.

Option C: Use Google Tag Manager (GTM)

This is a more flexible and scalable approach (especially if you have multiple tags or marketing tools).

  1. Create a Google Tag Manager account and container.
  2. Add the GTM container code into your WordPress site (via plugin or manually in header + body).
  3. Inside GTM, create a GA4 Configuration tag, using your Measurement ID.
  4. Set trigger to All Pages. Publish.
  5. (Optional) Add more tags for specific events.

Using GTM gives you control to add more tags later (e.g. for ads, pixels) without editing your theme again.


3. Verify and test

  1. In Google Analytics, go to Realtime > Overview.
  2. Visit your website in a different browser or private/incognito window.
  3. If setup correctly, your visit should appear in the Realtime report. Cloudways+2WPBeginner+2
  4. Use Google’s Tag Assistant (Chrome extension) or browser dev tools to inspect whether your site is sending the GA4 tag.

If nothing shows up:

  • Check that the Measurement ID is correct.
  • Make sure the code is in every page’s <head>.
  • Ensure caching or optimization/plugins aren’t interfering.
  • If using a plugin, check its settings or conflicts.

4. Additional configurations (optional but useful)

  • Enhanced Measurement: GA4 supports automatic tracking of scrolls, outbound clicks, site search, etc. You can enable or disable in the stream settings. Google Help+1
  • Event Tracking: You may want to set up custom events (form submissions, button clicks). If using a plugin or GTM, you can define those.
  • Ecommerce Tracking: If your site is a WooCommerce store, you can enable ecommerce reporting so Google tracks product views, add-to-cart, purchases, etc.
  • Excluding internal traffic: You may want to filter out admin or your own visits.
  • Retention & data settings: In GA4 Admin > Data Settings, adjust how long Google retains data.

As always Thanks for engaging with this episode of
Practical Digital Strategies

 
How to Set Up Google Analytics 4 on Your WordPress Site

To share this Google Document associated with this episode, please click on the “Share” link above.

If you’re on a desktop, find the episode title at https://guyrcook.com 

I hope you enjoy the content.

What I use for ‘face to face’ is https://whereby.com/

Official website: https://guyrcook.com

LinkedIn: https://www.linkedin.com/in/guycook/

X: https://X.com/Guyrcookrepor

Facebook: https://www.facebook.com/GuyRCookReportPersonalBlog
Instagram: https://www.instagram.com/guyrcook/

Vivaldi Social: https://social.vivaldi.net/@guyrcook

Reddit: https://www.reddit.com/user/UncleGuy/

Stack Overflow: https://stackoverflow.com/users/25119577/guy-r-cook

Thank you for taking the time to listen, view or read.

SUBSCRIBE ON YOUTUBE https://www.youtube.com/@PracticalDigitalStrategies 

The link for viewing this episode on YouTube is https://youtu.be/jxYnitlAQJI

Amazon affiliate link: https://guyrcook.com/computers-tablets-stuff/

On X https://X.com/guyrcook

On Facebook https://www.facebook.com/GuyRCookReportPersonalBlog

Check out Ileane Smith and Fraser Ramsey

Don’t miss out on this must-listen resource for anyone looking to succeed in the digital space.

#podbean,#theguyrcookreport,#podcast_hosting,#podcasting,#landingpage,#wordpress,#fraser_ramsay,#ileane_smith,#googledocs

Link to the Android mobile app for The Guy R Cook Report

How to save content as a PDF on desktop

Before you go

Subscribe where you listen to podcasts

vDomainHosting, Inc

Kennewick, WA 99337

Get the latest tech education and digital marketing insights; Internet Marketing and Consulting Services

Podcast RSS Feed Youtube Playlist

Related Post

Leave a Reply