How to Set Up Google Analytics 4 on Your WordPress Site

This guide shows you how to set up Google Analytics 4 (GA4) on a WordPress site hosted with Noiz, so that you can see how many people visit, where they come from and which pages they read. It is written for site owners and editors who are comfortable in the WordPress dashboard but are not analytics specialists. Google Analytics 4 is often shortened to GA4, and the single tracking code you add to your site is called the Google tag (formerly gtag.js). Since 1 July 2024, GA4 is the only supported version of Google Analytics: the older Universal Analytics has been switched off, so any guide referring to "UA" or tracking IDs beginning UA- is out of date.

Last reviewed: 27 July 2026, against Google Analytics 4 (the current and only supported version of Google Analytics) and the Site Kit by Google plugin 1.183.0 (latest stable). This guide is written for Noiz hosting and is kept current against Google Analytics and WordPress. It complements, and does not replace, the official Google Analytics and Site Kit documentation linked below.

Official Documentation Reference

Prerequisites

  • A Google account. A free personal or Google Workspace account both work.
  • Administrator access to your WordPress dashboard. If you are not sure how to sign in, see How to login to WordPress (Admin Dashboard).
  • Your live site URL, for example https://yourdomain.com (replace with your own domain, this is an example placeholder).
  • A few minutes to complete the Google-side setup, then up to 30 minutes for GA4 to start showing data.

How the Pieces Fit Together

Adding analytics is not built into WordPress core, so there is no analytics field in a fresh WordPress install. The job has two halves, and it helps to keep them separate in your mind:

  1. The Google side: you create a GA4 property and a web data stream. This gives you a Measurement ID that looks like G-XXXXXXXXXX.
  2. The WordPress side: you place the Google tag (which carries that Measurement ID) on every page of your site. You can do this with a plugin or by editing your theme.

Once the tag is loading on your pages, GA4 begins collecting visits automatically. The rest of this guide walks through both halves.

Step 1: Create a Google Analytics 4 Property

This is done entirely in Google Analytics, not in WordPress. The screens change from time to time, so treat the following as the shape of the process and rely on Google's Set up Analytics for a website guide for the exact current wording.

  1. Go to analytics.google.com and sign in with your Google account. If this is your first time, click Start measuring.
  2. Create an Account (for example, your business name) and accept the data-sharing settings you are comfortable with.
  3. Create a Property. Give it a clear name such as yourdomain.com, then set the reporting time zone to South Africa and the currency to ZAR so your reports match your day and your billing.
  4. When prompted to choose a platform, select Web and add a data stream: enter your site URL (for example https://yourdomain.com) and a stream name such as Main website.
  5. Leave Enhanced measurement switched on. It automatically records useful interactions such as scrolls, outbound link clicks, site searches and file downloads without any extra work. See Enhanced measurement events for the full list.
  6. Click Create stream.

If you plan to use the Site Kit plugin (Method A below), you can let it create the property for you during setup and skip most of this step. It is still worth understanding what it is creating on your behalf.

Step 2: Find Your Measurement ID

The Measurement ID is the value that links your website to this GA4 property. You only need it if you are connecting your site manually or with a third-party plugin. The Site Kit plugin detects it for you.

  1. In Google Analytics, click Admin (the gear icon, lower left).
  2. Under the property column, click Data streams, then click your web stream.
  3. In Stream details, copy the Measurement ID at the top right. It always starts with G-, for example G-XXXXXXXXXX.

An ID beginning UA- is a Universal Analytics ID and no longer works. If you only have one of those, create a fresh GA4 property as in Step 1.

Step 3: Connect GA4 to WordPress

There are three common ways to get the Google tag onto your WordPress pages. Choose one, and one only. Installing GA4 through more than one method at the same time makes it count every visit two or three times, which quietly ruins your numbers.

Method A: The Official Site Kit by Google Plugin (Recommended for Most People)

Site Kit by Google is Google's own free WordPress plugin. It connects your site to GA4 (and, if you want, Search Console and PageSpeed Insights) and shows key figures right inside your WordPress dashboard. It is the least error-prone option because it handles the Measurement ID and the tag for you.

  1. In your WordPress dashboard, go to Plugins > Add New Plugin, search for Site Kit by Google, then click Install Now and Activate.
  2. Open the new Site Kit menu and click Start Setup.
  3. Sign in with the same Google account that owns the GA4 property from Step 1, and grant the permissions it asks for.
  4. When prompted, connect Analytics and select your existing GA4 property (or let Site Kit create one).

Each administrator who wants to see the dashboard figures signs in with their own Google account; this is normal and does not create duplicate tracking. The visitor tag is set once for the whole site.

Method B: A Third-Party Analytics Plugin

Many analytics and SEO plugins can insert the Google tag for you, and some add their own reports inside WordPress. Examples include the plugins commonly listed under "Google Analytics" in the WordPress plugin directory; Noiz does not endorse any single one, so choose based on reviews, active-install count and how recently it was updated. Whichever you pick, the process is the same in shape:

  1. Install and activate the plugin from Plugins > Add New Plugin.
  2. Open the plugin's settings and either sign in with Google or paste the Measurement ID (G-XXXXXXXXXX) from Step 2 into its tracking-ID field.
  3. Save. The plugin adds the tag to every page for you.

A lighter-weight route is a "header and footer scripts" plugin, which simply gives you a box to paste code into. That overlaps with Method C, below.

Method C: Add the Google Tag to Your Theme Manually

If you would rather not add a plugin, you can paste the Google tag into your site's HTML yourself. This keeps things lean but is the easiest method to get wrong, so it suits confident users.

  1. In Google Analytics, go to Admin > Data streams > your web stream, then click View tag instructions and choose Install manually.
  2. Copy the whole snippet that begins with <!-- Google tag (gtag.js) -->.
  3. Paste it immediately after the opening <head> tag so it loads on every page. How you do this depends on your theme:
    • Block themes (the default in recent WordPress) have no editable header.php file, so use a header-scripts plugin or a small custom plugin to inject the code, rather than editing theme files.
    • Classic themes have a header.php you can edit, but only ever edit it inside a child theme. If you edit the parent theme directly, the next theme update will overwrite your change and tracking will silently stop.

Some themes and page builders provide their own "custom code" or "header scripts" field in their settings; if yours does, that is the safest place to paste the tag manually.

Step 4: Clear Your Cache

Your Noiz hosting, and any caching plugin or content delivery network (CDN) you use, may serve a saved copy of your pages to visitors. If that saved copy was generated before you added the tag, GA4 will see nothing. After completing Step 3, clear every cache in the chain: your caching or performance plugin, then any CDN, and finally your browser. Then load your site in a private or incognito window to fetch a fresh copy.

Step 5: Confirm Tracking Is Working

Do not wait a day to find out whether it worked. GA4's Realtime report shows activity within seconds.

  1. Open your website in a separate browser tab or on your phone and click around a couple of pages.
  2. In Google Analytics, go to Reports > Realtime.
  3. You should see at least one active user, which is you, along with the pages you are viewing.

If you see yourself, tracking is live. Standard reports such as Acquisition and Engagement can take 24 to 48 hours to fill with meaningful figures, so do not be alarmed if they look empty at first.

Where to View Your Traffic

Everyday reporting lives under Reports in the left-hand menu of Google Analytics. The three you will use most are:

  • Reports > Acquisition > Traffic acquisition: where your visitors come from, grouped into channels such as Organic Search, Direct, Referral and Social. This answers "is my marketing working?".
  • Reports > Engagement > Pages and screens: which pages and posts are read most, and how long people stay. This answers "what content is landing?".
  • Reports > Realtime: who is on the site right now, useful when you publish a post or run a campaign.

The Home and Reports snapshot screens give a quick overview if you just want the headline numbers.

A note on history: by default GA4 keeps detailed event data for two months. If you want to explore longer trends in the Explore section, raise this to the maximum in Admin > Data retention. Your standard reports above are aggregated and are not limited by this setting.

Get an Email When Your Traffic Changes

GA4 can watch your data and email you when something moves sharply, for example a drop in visitors that might mean your site is down, or a spike worth acting on. This is done with custom insights on the Google side, not in WordPress.

In brief: open the Insights card on your Reports or Home screen, click View all insights, then Create. Choose how often GA4 checks (hourly, daily, weekly or monthly), pick a metric, condition and threshold (such as active users decreasing by more than 20 percent), name it, and add the email addresses that should be alerted. Full details are in Google's Analytics Insights guide.

A Word on Privacy and Consent

Google Analytics sets cookies and collects data about your visitors, which brings it within the scope of South Africa's POPIA and, if you have European visitors, the GDPR. A responsible setup pairs GA4 with a clear privacy or cookie notice on your site, and many site owners add a consent banner that only loads the Google tag once a visitor agrees. This guide covers the tracking mechanics; treat consent as a separate task to complete before you rely on the data commercially, and take your own legal advice where needed.

Troubleshooting

Symptom: the Realtime report shows no active users even though you are on the site. The tag is not loading. Check that you completed Step 4 and cleared all caches, then view your homepage source (right-click, View Page Source) and search for gtag or your G- ID. If it is missing, the plugin or manual snippet did not apply; re-check the method you chose in Step 3.

Symptom: your visit numbers look far too high, or every visit is counted twice. GA4 is almost certainly installed twice, for example through both a plugin and a manual snippet, or through two plugins. Pick a single method from Step 3 and remove the others.

Symptom: your own visits are inflating the figures. While testing this is expected. For a live site, exclude your own traffic by defining internal traffic in Admin > Data streams > Configure tag settings, then applying a data filter. Your day-to-day browsing of your own site will otherwise skew small sites noticeably.

Symptom: Site Kit says it cannot verify ownership or connect Analytics. Make sure you signed in with the exact Google account that owns the GA4 property, and that the property and data stream from Step 1 actually exist. Reconnect the Analytics service from Site Kit > Settings if needed.

Symptom: standard reports are still empty after a day. Confirm tracking in Realtime first. If Realtime works but Acquisition and Engagement do not fill, give it a full 48 hours, and check you are looking at the correct property and an appropriate date range at the top right.

If you would rather not do this yourself, the Noiz support team can help. On a Noiz managed WordPress plan, open a support ticket and the team can add and verify your Google tag for you; send through your Measurement ID (the G- value) and let the team know which pages you want tracked. If you are self-managed and get stuck at any step, open a ticket describing the method you used and what the Realtime report shows, and the team will help you get your traffic flowing into GA4.

  • 0 Users Found This Useful
  • wordpress
Was this answer helpful?

Related Articles

How to Manage WordPress Categories the Right Way

This guide shows you how to manage the categories on your WordPress site properly: creating them,...

Practical Ways to Use AI with WordPress

This guide is a practical, plain-language tour of the useful ways you can put artificial...

How to Use the WordPress Block Editor Efficiently

This guide shows you how to get real work done faster in the WordPress block editor, the standard...

How to Email Your Registered Users in WordPress

This guide explains how to email the people who have registered on your WordPress site, whether...

How to Bulk Find and Replace Content in WordPress

This guide shows you how to find a piece of text, a link, or an image on your WordPress site and...