How to Add Google Analytics to WordPress

To add Google Analytics to WordPress, first check who already places the tag. Connect the right GA4 property, then verify a real page view.
Our WordPress test produced a successful browser request and, separately, a received page view in GA4. Those two checks matter: a dashboard connection shows which property WordPress can read, while the public site still needs to send events to the intended destination.
Start with the existing installation. Then choose whether Site Kit should place the code or simply display data from a tag another tool already manages.
In this story6 sections
Check the existing tag before installing another plugin
Look at the site’s active plugins, theme integration settings and Tag Manager ownership. Record the intended Analytics property and web stream, along with the tool responsible for loading the tag. Ask the site’s developer or agency if that ownership is unclear.
Do you need a second installation because Site Kit is missing? No. A site can already collect Analytics data through Tag Manager or a direct Google tag. If you have lost access to Google Tag Manager, recover that setup before adding another implementation.
Google tag IDs and Analytics destination IDs can differ. Site Kit’s Google tag documentation distinguishes GT- tag IDs from G- measurement IDs. Match the destination to the intended property rather than treating a missing G- string in the initial HTML as proof of failure.
Connect WordPress with Site Kit
Site Kit is Google’s official WordPress plugin. The sequence here follows Google’s current installation instructions; our separate collection test below used a direct tag, not a completed Site Kit account connection.
Install and connect the right account
In WordPress, open Plugins, find Site Kit by Google, then install and activate it. Open Site Kit’s setup screen and select the option to connect Analytics during setup. Sign in with the Google account that has access to the property you intend to use.
Follow the ownership-verification and service-permission steps. Read the requested access before granting it. Site Kit’s requirements include a publicly accessible production site and a working WordPress REST API; Google provides a separate workflow for staging environments.
During Analytics setup, choose the intended account and property, or follow the creation option if you need a new one. Complete setup and check Site Kit’s connected Analytics service settings against your intended destination.
Decide who places the code
Can you use Site Kit without letting it install another tag? Yes. Google’s code-placement guidance says Site Kit can display metrics while another implementation supplies the code.
If Site Kit detects the selected property’s existing tag, it turns its code-placement toggle off. Retain that arrangement when the existing implementation is intentional. If you plan to transfer ownership to Site Kit, identify and remove the old installation as part of a controlled change, then check collection again.
Finding two IDs does not prove that one property receives duplicate events. Another property’s tag can send data elsewhere. Google also documents that Site Kit’s Analytics and Tag Manager modules do not duplicate events when their inserted snippets link to the same Analytics stream. Inspect the actual event and destination before removing anything.
Keep a working direct tag or Tag Manager setup
Do you have to replace an existing direct tag? Google’s installation documentation says existing implementations remain supported. For a new installation, use the current snippet supplied by your Google account and have the site’s implementation owner place it on the pages you intend to measure.
Google’s newer default installation example differs from older examples containing a config command. The same documentation says those existing config-based snippets continue to work for backward compatibility. Copying a current account-provided snippet avoids guessing which tag ID or destination an old tutorial expected.
For a WordPress developer, a site plugin can provide a controlled installation point. Our test used WordPress’s wp_head hook on one temporary preview page. That proved collection on that page, not coverage across an entire site. Check an ordinary article, a page and other important templates before calling a site-wide installation complete.
Verify the visitor action, destination and received event
Open a public page in a test browser context and use the site’s consent controls as intended. A blocked or unconsented visit can tell a different story from an allowed visit, so record which state you are checking.
In the browser’s Network panel, inspect the Analytics collection request. Match its destination to your intended stream and its page location to the page you opened. A loaded Google script establishes less than a request carrying the right event to the right destination.
Next, open the intended GA4 property and inspect Realtime pages for that page path. A successful network response alone does not prove that you are looking at the correct property. Matching the received page gives you a second, separate check.
What does a successful page view establish? It shows that this visit reached the property. It does not prove that purchases, key events, campaign attribution or every page template work. Keep those checks separate. Our GA4 event-count guide explains why event totals and user totals answer different questions.
What our WordPress test established
On November 28, 2026, we installed a direct Google tag through a WordPress hook on a temporary preview page, using a separate Analytics test property. The page made no external HTTP requests while Analytics remained off. After one consent click, the browser sent one page-view request to the test destination and received HTTP 204.
GA4’s Realtime pages report then showed one view for the exact test-page path. It showed zero active users at that observation, so we recorded a received page view rather than treating the two metrics as interchangeable. A second press of the start button queued no second configuration and produced no new HTTP request in the captured interval.
We matched the actual page path in Realtime to the browser request. That gave us a received-event check alongside the successful network response.
We withdrew the temporary test page and code after verification. The test covered one direct-tag installation; it did not include a fresh Site Kit sign-in, ecommerce tracking, campaign attribution or complete-site coverage.
If Site Kit connects but data still looks wrong
First compare the property’s identity and the tag’s destination. Then check the consent state, browser request and received page, in that order. Those observations help distinguish a dashboard connection from collection on the public site.
Seeing an event twice? Use the duplicate-events investigation to trace the producers before disabling a plugin or container. Removing an implementation without knowing what else it supplies can leave you with a different measurement problem.
Need DebugView? Google’s DebugView instructions explain how to enable it for your device and note that privacy controls or denied Analytics consent can prevent events appearing. An empty DebugView report alone does not establish that all collection has stopped.





