# Google Analytics on WordPress

> Two documented ways to add GA4 to WordPress, the Site Kit plugin or the gtag.js snippet, with the Measurement ID path and a check that data arrives.

Canonical: https://scaplet.com/seo/wordpress/google-analytics

Guide WordPress WordPress · Analytics

Two documented ways to add GA4 to WordPress, the Site Kit plugin or the gtag.js snippet, with the Measurement ID path and a check that data arrives.

4 min

read

4

sources

Oct 31, 2026

updated

Scaplet Editorial Team

author

In one line

Add GA4 to WordPress with Google's Site Kit plugin, or paste the Google tag into your site's head yourself. Either way you need the Measurement ID from your web data stream, which starts with "G-". Pick one method, not both, then confirm with Tag Assistant or the Realtime report.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fwordpress%2Fgoogle-analytics%20(%22Google%20Analytics%20on%20WordPress%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fwordpress%2Fgoogle-analytics%20(%22Google%20Analytics%20on%20WordPress%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fwordpress%2Fgoogle-analytics%20(%22Google%20Analytics%20on%20WordPress%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fwordpress%2Fgoogle-analytics%20(%22Google%20Analytics%20on%20WordPress%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 5 parts, 4 minutes.

1. [Pick a method first 01](#pick-a-method-first)
2. [Find the Measurement ID 02](#find-the-measurement-id)
3. [Method 1: Site Kit 03](#method-1-site-kit)
4. [Method 2: paste the Google tag 04](#method-2-paste-the-google-tag)
5. [Check it worked 05](#check-it-worked)

_01_Your call

## Pick a method first

If this fits

### Use Site Kit if

- You want setup without editing your site's source code
- You also want [Search Console](/glossary/google-search-console) numbers on the WordPress dashboard
- Several people manage the site and each can connect their own Google account

Or

### Paste the tag yourself if

- You already manage theme code or a code-snippet plugin
- You want one small script and no dashboard plugin
- Another tool already holds your Measurement ID and you only need the [snippet](/glossary/snippet) in the head

Google's own tag guide says it recommends [Google Tag Manager](/glossary/google-tag-manager) for deploying tags. Site Kit also lists Tag Manager among the tools it can set up, so that route exists on WordPress too. This page covers the two direct routes.

_02_How it works

## Find the Measurement ID

1. 1

### Open the data stream

In [Google Analytics](/glossary/google-analytics-4), go to Admin. Under Data collection and modification, click [Data streams](/glossary/data-streams), then click the web stream for your site.
2. 2

### Copy the ID

Under Stream Details, copy the Measurement ID. Google's help page says it starts with "G-" or "AW-".
3. 3

### No stream yet

Click Add stream, choose Web, enter your site URL and a stream name, then click Create stream. Google recommends leaving enhanced measurement on, and says you can switch individual events off later.

Google's setup page says you must be an Editor or above on the Google Analytics account at the property level to add a data stream.

_03_How it works

## Method 1: Site Kit

Site Kit requirements on the plugin listing
| Requirement | What the listing says |
| WordPress and PHP | WordPress version 5.2+ and PHP version 7.4+ |
| Public site | Not in maintenance mode, accessible only via password, or otherwise blocked |
| REST API | Must be available. Check under Tools > Site Health |
| Cost | The plugin is free and open source |

**Staging and maintenance mode**Site Kit needs a live site to show data. If a coming-soon plugin hides the site from visitors, read [WordPress maintenance mode](/seo/wordpress/maintenance-mode) before blaming the connection.

1. 01

### Install

In WordPress go to Plugins > Add New, search for Site Kit by Google, then install and activate it.
2. 02

### Connect your Google account

Follow the setup flow in the new Site Kit menu. The plugin listing says that with multiple WordPress admins, each admin must connect their own Google account.
3. 03

### Add Analytics

The plugin listing says to connect additional Google tools under Site Kit > Settings. Analytics is one of the tools it supports.

_04_Check it

## Method 2: paste the Google tag

Google's help page says to open Admin > Data streams > your web stream > View tag instructions under Google tag, then choose Install manually. Google's gtag.js guide gives this snippet and says to place it immediately after the opening `<head>` tag on every page you want to measure.

On WordPress the head is printed by the theme's `header.php` through the `wp_head()` function, which fires the `wp_head` action. WordPress's hook reference says that although this is theme-dependent, it is one of the most essential theme hooks and is widely supported. Add your snippet through that hook, in a child theme or a code-snippet plugin, so a theme update does not erase it. Replace `TAG_ID` with your Measurement ID.

**Do not run both methods**Site Kit's listing describes it as a way to deploy Google tools without editing your site's source code. A hand-pasted snippet on top of it would be a second copy of the same tag. Check the page source for more than one `gtag/js?id=` request before you trust any numbers.

Google tag, from Google's gtag.js guide

```
<!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=TAG_ID"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'TAG_ID'); </script>
```

_05_How it works

## Check it worked

Google says Analytics sends a `page_view` event automatically when the `config` command is called, unless you set `send_page_view` to false. If you see the library load but no hits, check the Console for errors. Site Kit's listing adds that a "gathering data" message can last a few days after connecting a new Google service.

**Already on GA4?**Scaplet connects to Google Analytics and Search Console, and every change it proposes goes through approval and can be undone. You can also run a free [site audit](/site-audit).

1. 01

### Network tab

Open the live site in Chrome, open Developer Tools, go to the Network tab and refresh. Requests to `googletagmanager.com` mean the tag is firing. For Analytics, Google says to filter for `google-analytics.com` or `analytics.google.com`.
2. 02

### Tag Assistant

Go to tagassistant.google.com, click Add domain, enter your URL starting with "[https](/glossary/https)://" or "http://", and click Connect. Your tag ID should appear under Google tags found.
3. 03

### Realtime report

Google says data collection may take up to 30 minutes to begin, after which the Realtime report should show your own visit.

Sources · 4

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- wordpress.org
- google.com

1. 01 [Site Kit by Google | WordPress.org plugin directory](https://wordpress.org/plugins/google-site-kit/) wordpress.org · checked 2026-11-01
2. 02 [Set up Analytics for a website and/or app | Analytics Help](https://support.google.com/analytics/answer/9304153) support.google.com · checked 2026-11-01
3. 03 [Set up the Google tag with gtag.js | Google for Developers](https://developers.google.com/tag-platform/gtagjs/install) developers.google.com · checked 2026-11-01
4. 04 [wp_head | WordPress Developer Resources](https://developer.wordpress.org/reference/hooks/wp_head/) developer.wordpress.org · checked 2026-11-01

Questions

## Asked a lot.

3 questions people ask next, answered from the sources on this page.

_01_ Where do I find my GA4 Measurement ID?

In Admin, under Data collection and modification, open Data streams and click your web stream. Copy the Measurement ID under Stream Details. Google's help page says it starts with "G-" or "AW-".

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

No. Google documents pasting the Google tag immediately after the opening head tag on each page. A plugin such as Site Kit does that for you without editing code.

_03_ How long until GA4 shows data?

Google says data collection may take up to 30 minutes to begin, and the Realtime report can then confirm it. Site Kit's own dashboard can show a gathering data message for a few days after you connect a new service.

## Keep learning

[All platform guides](/seo)

[Learn WordPress SEO CMS](/seo/wordpress) [Related Google Analytics 4 Measurement](/glossary/google-analytics-4) [Read next WordPress Google Search Console setup CMS](/seo/wordpress/search-console) [Do Run a free site audit Free, about two minutes](/site-audit)

More in WordPress SEO
[AMP on WordPress](/seo/wordpress/amp) [Google Analytics on WordPress](/seo/wordpress/google-analytics) [How to put WordPress in maintenance mode](/seo/wordpress/maintenance-mode) [WordPress 404 page](/seo/wordpress/404) [WordPress AI crawlers](/seo/wordpress/ai-crawlers) [WordPress breadcrumbs](/seo/wordpress/breadcrumbs) [WordPress canonical tags](/seo/wordpress/canonical-tags) [WordPress Core Web Vitals](/seo/wordpress/core-web-vitals) [WordPress favicon](/seo/wordpress/favicon) [WordPress Google Search Console setup](/seo/wordpress/search-console) [WordPress hreflang and multilingual SEO](/seo/wordpress/hreflang) [WordPress HTTPS](/seo/wordpress/ssl) [WordPress image SEO](/seo/wordpress/image-seo) [WordPress internal links](/seo/wordpress/internal-links) [WordPress lazy loading](/seo/wordpress/lazy-loading) [WordPress noindex](/seo/wordpress/noindex) [WordPress redirects](/seo/wordpress/redirects) [WordPress robots.txt](/seo/wordpress/robots-txt) [WordPress SEO plugins](/seo/wordpress/seo-plugin) [WordPress SEO titles and meta descriptions](/seo/wordpress/title-and-meta) [WordPress speed optimization](/seo/wordpress/page-speed) [WordPress structured data](/seo/wordpress/structured-data) [WordPress www redirect](/seo/wordpress/www-redirect) [WordPress XML sitemap](/seo/wordpress/xml-sitemap)

Terms on this page
[Google Search Console](/glossary/google-search-console) [Search snippet](/glossary/snippet) [Google Tag Manager](/glossary/google-tag-manager) [Google Analytics 4](/glossary/google-analytics-4) [Data streams](/glossary/data-streams) [HTTPS](/glossary/https)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
