All How-To Guides
WordPress10 min·5 steps

How to Install Google Analytics on WordPress (2026 Step-by-Step Guide)

WordPress powers more than 40% of the web, and Google Analytics is the default measurement tool for most sites running on it. The setup itself is short - the longer task is picking the right install method, since WordPress gives you three legitimate options depending on whether you have a plugin-friendly setup, a developer in the loop, or a managed host that restricts both.

What you'll need before you start

  • A WordPress site you can log into as an administrator (wordpress.org self-hosted or wordpress.com Business plan and up)
  • A Google account
  • Roughly 10 minutes

How to install Google Analytics on WordPress: Step-by-step

  1. 1

    Create a Google Analytics 4 property

    Go to analytics.google.com and sign in. Click Admin (gear icon, lower-left), then CreateProperty. Enter a property name (your site name is fine), pick your time zone and reporting currency, and click Next.

  2. 2

    Add a Web data stream and copy your Measurement ID

    After creating the property, GA4 prompts you to set up data collection. Choose Web, paste your full site URL (including https://), give the stream a name, and click Create stream. The stream summary screen shows a Measurement ID in the format G-XXXXXXXXXX. Copy it - you'll paste it into WordPress next.

  3. 3

    Install the Site Kit by Google plugin

    In your WordPress admin, go to PluginsAdd New Plugin, search for Site Kit by Google (the official Google plugin - over 3 million installs), then click Install Now and Activate. Site Kit is the path Google itself recommends and it sets up Search Console, PageSpeed Insights, and AdSense from the same dashboard.

  4. 4

    Connect Site Kit to your Google account

    Click the new Site Kit menu item in the WordPress sidebar, then Start Setup. Sign in with the same Google account that owns your GA4 property. Approve the requested permissions. Site Kit will detect the GA4 property automatically if your account has access; otherwise paste the G-XXXXXXXXXX Measurement ID manually.

  5. 5

    Verify the tag is firing

    Open your live site in a separate browser tab (or an incognito window so you don't count yourself), wait a minute, then return to GA4 and open ReportsRealtime. You should see at least one active user. If yes, you're done.

How to verify your setup is working

The fastest sanity check is the Realtime report inside GA4 (ReportsRealtime). Visit your site in an incognito window and within 30 seconds you should appear as one active user. If nothing shows up after two minutes, the tag is not installed correctly - jump to the troubleshooting section below.

For a deeper check, install the free Chrome extension Google Tag Assistant. Open your site, click the extension, and confirm it shows your G-XXXXXXXXXX measurement ID firing.

Common issues and fixes

Realtime report shows zero users even after waiting

Three usual causes. (1) An ad-blocker or privacy extension in your browser is blocking the GA4 script - try a different browser. (2) A caching plugin (WP Rocket, W3 Total Cache, LiteSpeed Cache) is serving an old page without the tag - clear the cache and try again. (3) Site Kit didn't finish writing the tag - go to Site KitSettingsConnected Services and confirm Analytics is listed and "Connected".

I have GA Universal already installed and I'm worried about double-counting

Universal Analytics stopped processing data on July 1, 2024 - any UA tags still on your site are inert and won't double-count anything. You can safely leave the old UA-XXXXXX snippet in place, but cleaning it up is good housekeeping. If you used Site Kit for the old tag, the plugin handles the swap automatically.

Site Kit can't find my Analytics property

This usually means the Google account you authenticated with doesn't have Editor access to the GA4 property. Open analytics.google.comAdminProperty Access Management, add the same Google account with at least Editor access, then re-run the Site Kit setup.

Frequently asked questions

Do I need a plugin to add Google Analytics to WordPress?

No. You can paste the GA4 tracking snippet directly into your theme's header.php file (inside the <head> tag) or use a header-script plugin like Insert Headers and Footers. Plugins are the easier path for most users because they survive theme updates - editing header.php directly means re-pasting the code every time you update or switch your theme.

Is Site Kit the best plugin for Google Analytics on WordPress?

For most users, yes - it's the official Google plugin, it's free, and it integrates GA4, Search Console, PageSpeed Insights, and AdSense in one dashboard. MonsterInsights and ExactMetrics are popular paid alternatives with more granular dashboards. Pick Site Kit unless you specifically need ecommerce dashboards, scroll-depth tracking, or form tracking out of the box.

Can I install Google Analytics on WordPress.com (the hosted version)?

Only on the Business, Commerce, or Enterprise plans. The Free, Personal, and Premium plans don't allow custom code or third-party plugins. If you're on a lower plan, the cheapest workaround is to switch to wordpress.org self-hosted (which costs about $5-15/month for hosting) and install Site Kit.

How do I add Google Analytics to WordPress without a plugin?

Copy your GA4 global site tag (AdminData Streams → click your stream → View tag instructionsInstall manually), then paste it into your theme's header.php immediately after the opening <head> tag. Use a child theme or a code-snippets plugin so the tag survives theme updates.

How do I know if Google Analytics is working on my WordPress site?

Open your site in an incognito window, then open GA4 and go to ReportsRealtime. Within 30 seconds you should appear as one active user. The free Google Tag Assistant Chrome extension is a faster check - it shows every tag firing on the page along with its measurement ID.

Does Google Analytics slow down WordPress?

The GA4 script is small (about 70KB) and loads asynchronously, so the impact on perceived page speed is minimal - usually under 50ms in real-world tests. If you're using a tag manager (GTM) plus several other third-party scripts, the cumulative effect can be larger. Consider Google's Tag Manager Server-Side setup if you serve high traffic or care about every millisecond.

Once you're set up, MeasureBoard turns the data into action

MeasureBoard connects to your analytics, search, and SEO tooling and generates AI-powered weekly reports, GEO readiness scores, and a dedicated AI analyst that answers questions in plain English. Free to start, connects in 30 seconds.

Get Started Free