How to Add Google Analytics to WordPress

Add Google Analytics to WordPress through Site Kit or WordPress.com’s built-in connection, then check that GA4 receives a visit to your site.
The right route depends on where you run WordPress. A self-hosted site can use Google’s Site Kit plugin. WordPress.com offers a connection in its own settings on eligible plans, so you may not need a plugin at all.
Before adding either, check whether your site already sends data to Analytics. A working installation deserves an inspection before a replacement.
In this story6 sections
1. Check your WordPress site and existing Analytics setup
For the Site Kit route, you need WordPress access that lets you install and activate plugins, plus a Google account with access to the Analytics property you intend to connect. Site Kit requires a publicly accessible production site and a working WordPress REST API. Check Tools → Site Health if setup reports an API problem.
Already using Analytics? Look in active plugins, theme integration settings and Google Tag Manager before installing anything. Record the property, web stream and tool that places the tag. Ask your developer or agency if you cannot identify the owner; our Google Tag Manager access guide covers that particular obstacle.
Do you need Site Kit to keep an existing tag working? No. A direct tag or Tag Manager installation can already supply the data. Site Kit can display Analytics reports without taking over code placement.
2. Choose or create your GA4 property and web stream
A property holds your Analytics data; a web stream identifies the website sending it. Use the intended existing property and stream when you have them. Creating a new property for an already measured site gives you a separate reporting destination.
For a first setup, follow Google’s account, property and stream instructions. Sign in to Analytics and create an account if you do not have one. Review its data-sharing settings before continuing.
Create the property if you need one
In Analytics, open Admin → Create → Property. Enter a name, reporting time zone and currency, then complete the business details and objectives. Click Create. You need the Editor role to add a property to an existing account.
Find the website’s measurement ID
In the intended property, open Admin → Data collection and modification → Data streams. Select an existing web stream, or choose Add stream → Web. For a new stream, enter your primary website URL and a stream name, review enhanced measurement, then create the stream. Adding a stream requires Editor access or above at the property level.
Open the web stream and copy its G- measurement ID. Keep the property name, stream name and ID together: you will compare these with the WordPress connection and the received test visit.
3. Connect a self-hosted WordPress site with Site Kit
Site Kit by Google is Google’s official plugin. The steps below follow its documentation; our collection test described later used a direct tag rather than a completed Site Kit sign-in.
Install the plugin and connect your Google account
In WordPress, open Plugins → Add New, search for Site Kit by Google, then click Install Now and Activate. Open Site Kit → Dashboard and select the option to connect Google Analytics during setup.
Follow Google’s Site Kit setup sequence: choose Sign in with Google and select the account with access to your intended Analytics property. Review the requested permissions, then follow the site-ownership verification and dashboard-access prompts. Complete the Search Console setup step if the site has not already been added.
Select Analytics and check the destination
At the Analytics step, select the intended account and property. Complete the remaining setup prompts, including the site’s main goal. If you skipped Analytics during initial setup, open Site Kit → Settings → Connect More Services to connect it later.
Then open Site Kit → Settings → Connected Services → Analytics. Compare the displayed measurement ID with the web stream you recorded. Site Kit also displays a GT- Google tag ID; Google explains how the two IDs relate. A different prefix alone does not mean that you chose the wrong destination.
Who should place the code? Google’s code-placement guidance says Site Kit turns its placement toggle off when it detects the selected property’s existing tag. Keep that arrangement if another tool intentionally manages collection. You can find the toggle under Connected Services → Analytics → Edit → Place Google Analytics code.
For a new installation without an existing tag, Site Kit places the required snippet. For an intentional transfer, coordinate removal of the old installation with enabling Site Kit’s placement. Do not disable a whole Tag Manager container just to remove one Analytics tag.
4. Use WordPress.com’s built-in connection instead
WordPress.com currently offers its native Analytics connection on Premium, Business and Commerce plans. Its connection instructions say you do not need to edit header code or install a plugin for this route.
Open your WordPress.com dashboard, then Jetpack → Traffic, or Jetpack → Settings → Traffic. Find the Google Analytics section, paste the G- measurement ID into the Google Analytics Measurement ID field and click Save.
Use the ID from your intended web stream. If you run a plugin-enabled WordPress.com site, Site Kit is another option, but installing it is not a prerequisite for the built-in connection. Choose a clear code-placement arrangement rather than adding both methods without checking the existing setup.
5. Verify a visit in the intended GA4 property
Open a public page as a visitor and use the site’s consent controls as intended. In the same GA4 property you connected, open Realtime and look for the page you visited. Google says data collection can take up to 30 minutes to begin; a blank report immediately after setup does not settle the diagnosis.
For a closer check, open the browser’s developer tools and inspect Analytics collection requests in Network. Compare the event, destination and page location with your chosen stream and visited page. Then match that page in GA4. A script loading in the browser gives you less evidence than a received visit in the correct property.
In our November 28, 2026 test, one consent click on a temporary WordPress page produced one page-view request with an HTTP 204 response. GA4’s Realtime pages report separately showed one view for that exact path. We used a direct tag and a separate test property, then withdrew the page and code.
Does one received visit mean setup is complete? It confirms collection for that visit. Check your other important page templates, then test purchases and other key events separately. The difference between event count and users also matters when reading the result.
6. Follow the symptom if data still looks wrong
Connected Site Kit but no visit in GA4? Compare the measurement ID first, then check whether code placement is active in the tool responsible for it. Inspect a public visit with a known consent state before changing plugins.
Seeing repeated events? Trace the event producers with our GA4 duplicate-events guide. Two tag IDs alone do not prove duplication. Google specifically documents that Site Kit’s Analytics and Tag Manager modules do not duplicate events when their inserted snippets link to the same Analytics stream.
Empty DebugView? Enable debug mode for your test device before using it. Google notes that privacy controls and denied Analytics consent can prevent events appearing there. Check the destination, request and received page together before concluding that Analytics has stopped collecting.





