WordPress Logo – Athemeart WordPress Themes

How to Add Google Analytics 4 to WordPress (3 Methods)

Learning how to add Google Analytics to WordPress takes about 15 minutes, and it answers questions your dashboard cannot: who visits your site, how they found it, which pages they read and what they do next. This guide shows you three ways to add Google Analytics 4 (GA4) to WordPress: with a plugin, with manual code and with Google Tag Manager. It then shows you how to prove the setup works.

It also covers a recent change that older tutorials miss. In November 2026, Google merged the Google tag and Tag Manager and changed the install code that new users copy. If you follow an old guide and mix the old and new code, your tracking can end up in a setup Google does not support.

Quick Answer: Add Google Analytics to WordPress in 5 Steps

  1. Create a GA4 property and a Web data stream at analytics.google.com.
  2. Copy your Measurement ID, which starts with G-.
  3. In WordPress, install and activate Site Kit by Google.
  4. Sign in with Google, then connect your Analytics property.
  5. Open your site in a private window and confirm the visit in the GA4 Realtime report.
Method Time Skill level Best for
Site Kit plugin 10 minutes Beginner Blogs, business sites, in-dashboard reports
Manual code 10 to 20 minutes Intermediate Developers who want no extra analytics plugin
Google Tag Manager 20 to 30 minutes Intermediate Several tags, custom events, ad campaigns

Why Add Google Analytics 4 to WordPress?

WordPress is excellent at publishing content, but a standard install does not tell you how people use it. Google Analytics fills that gap. GA4 records activity as events such as page views, scrolls, outbound clicks, file downloads and purchases, so one report model covers a blog, a service site and an online store.

Understand your website traffic and visitor behavior

See how many people visit, which countries and devices they use, and whether they are new or returning. If most visitors arrive on phones, test your layout, menus and forms on a phone first.

Identify your top-performing pages and traffic sources

Find the posts and product pages that attract attention, then see whether that attention comes from search, social media, email, referrals or paid ads. Since May 2026, GA4 also reports an for visits referred by chatbots such as ChatGPT, Gemini and Claude. Pair that data with solid on-page SEO basics for WordPress and you know which pages deserve an update first.

Measure conversions and user engagement

Mark important actions, such as a form submission or a sale, as key events. Engagement rate and engaged sessions then show whether visitors do more than load a page and leave.

GA4 data flow on a WordPress siteA visitor opens a page, the Google tag loads, the GA4 data stream receives events, and reports show them.How GA4 data gets from WordPress into your reports1Visitoropens a pagein a browser2WordPress pageloads the Googletag in <head>3GA4 data streamreceives eventsfor your G- ID4ReportsRealtime first,full reports laterIf any link in this chain breaks, Realtime stays empty.
How WordPress website analytics data travels from a browser to your GA4 reports.

Before You Start: Set Up Your Google Analytics 4 Account

Every WordPress Google Analytics setup starts with a GA4 property, and all three methods can share it. Do this once. Google’s own are worth keeping open in a second tab.

Step 1: Create or sign in to your Google Analytics account

Go to analytics.google.com and sign in. New users click Start measuring. If you already have an account and need a separate one, open Admin, click Create and choose Account. Use a Google account your business controls, not a freelancer’s personal login.

Step 2: Create a GA4 property for your WordPress website

In Admin, click Create, then Property. Enter a property name, reporting time zone and currency. Answer the questions about your industry, business size and goals, then finish. Choose the time zone and currency carefully, because they shape every daily and revenue report.

Step 3: Set up a web data stream

Under Data collection and modification, open Data streams, click Add stream and pick Web. Enter your site URL and a stream name. Leave Enhanced measurement on so GA4 can collect common interactions without extra code.

Step 4: Find and copy your GA4 Measurement ID

Open the web stream you just created. The Measurement ID appears in the stream details and looks like G-XXXXXXXXXX. Copy it exactly.

Path to the GA4 Measurement IDAdmin, then Data collection and modification, then Data streams, then your web stream, where the Measurement ID starting with G- is shown.Where to find your GA4 Measurement ID1Admingear icon, bottom left2Data collection and modificationsection inside Admin3Data streamschoose your Web stream4Stream detailscopy the Measurement IDG-XXXXXXXXXXIllustration of the menu path, not a Google Analytics screenshot
Where to find the GA4 Measurement ID.
ID format What it is Where you use it
G-XXXXXXXXXX GA4 Measurement ID Manual code, Tag Manager Google tag, most plugins
GTM-XXXXXXX Tag Manager container ID Installing a Tag Manager container
GT-XXXXXXX Google tag ID You may see it in page source with Site Kit
UA-XXXXXXX-X Old Universal Analytics ID Nowhere. Universal Analytics stopped processing data in 2023

Step 5: Prepare your WordPress administrator access

Before changing anything, check these items:

  • You can log in to WordPress as an Administrator.
  • You have a recent backup of files and database.
  • You know whether another plugin, theme option or developer already added Analytics.
  • Your site is public. Site Kit cannot report on a private or local site.
  • You know which cache and cookie consent tools the site uses.

Method 1: Add Google Analytics 4 to WordPress Using Site Kit by Google

is Google’s official, free WordPress plugin. It places the tag for you and shows Analytics and Search Console data inside your dashboard. It has more than 5 million active installations and requires WordPress 5.2 and PHP 7.4 or newer.

Site Kit setup stepsInstall, sign in with Google, verify ownership, set up Search Console, connect Analytics, complete setup.Method 1: the Site Kit setup flow1InstallPlugins, Add Plugin,Site Kit by Google2Sign inSign In with Google,grant permissions3VerifyVerify ownershipof your site4Search ConsoleSet up theproperty5AnalyticsChoose or createa GA4 property6CompletePick your goal,Complete setupIllustration of the setup order. Your Site Kit screens will look different.
The Site Kit by Google WordPress setup, from installation to reports.

Step 1: Install and activate the plugin

In your dashboard, go to Plugins → Add Plugin, search for Site Kit by Google, click Install Now and then Activate. Check that the author is Google. If you manage sites from the command line, WP-CLI does the same job:

wp plugin install google-site-kit --activate

Step 2: Connect your Google account to WordPress

Open Site Kit → Dashboard. You can opt in to connecting Google Analytics during setup. Click Sign In with Google, choose the account that owns your GA4 property, tick the requested permissions and click Continue. Each WordPress administrator connects their own Google account.

Step 3: Verify your website ownership

If your site is not already verified, Site Kit adds a verification file or meta tag. Click Verify ownership, then Allow metrics. Next, set up the Search Console property when prompted.

Step 4: Connect an existing GA4 property or create a new one

Choose your account, property and web data stream, or let Site Kit create them. Pick the property from the earlier section to avoid a second, empty property. If Site Kit finds an Analytics snippet already on your site, stop and decide which source should send data.

Step 5: Complete the Analytics setup

Select your main goal and finish the setup. Skipped Analytics the first time? Go to Site Kit → Settings → Connect More Services → Analytics. Leave the option to place the Analytics code switched on, unless you already install the tag another way.

Step 6: Check your Analytics reports inside WordPress

Return to Site Kit → Dashboard. A new property usually needs a day or two before figures appear there. The Site Kit dashboard is not a real-time view, so use analytics.google.com for your first test.

Important: Site Kit excludes logged-in users by default. Your own visits will not show while you are signed in to WordPress. You can review this under Site Kit → Settings → Connected Services → Analytics → Edit. The explains the other options.

Google Analytics Plugins for WordPress Compared

Site Kit by Google is not the only Google Analytics plugin for WordPress. Pick one tool to place the tag. Choosing a Google Analytics WordPress plugin comes down to the reports you need. Features and prices change, so confirm them on each plugin’s page before you buy.

Plugin Type Choose it when you want
Site Kit by Google Official Google plugin, free A simple setup with Search Console data beside Analytics
MonsterInsights Free and paid Guided dashboard reports, with more tracking features in paid plans
ExactMetrics Free and paid A lighter reporting dashboard in a similar style
Analytify Free and paid Statistics beside individual posts and pages
GA Google Analytics Free and paid Only the tracking code, with no reporting dashboard
GTM4WP Free A Tag Manager container plus a rich data layer
WPCode Free and paid To paste any header or body snippet yourself

Analytics is only one layer of a healthy site. Our list of must-have WordPress plugins helps you cover backups, security, SEO and speed without piling up overlapping tools.

Method 2: Add Google Analytics 4 to WordPress Manually

You can manually add Google Analytics to WordPress and add GA4 to WordPress without an analytics plugin. You paste the Google tag (gtag.js) into every page, directly after the opening <head> tag.

Step 1: Find your Google tag (gtag.js) tracking code

In GA4, go to Admin → Data streams and select your web stream. Under Google tag, choose Configure tag settings, open the installation instructions and pick Install manually. Copy the whole block.

Which Google Analytics tracking code should you copy for WordPress?

This is where 2026 changed things. Google’s dated November 17, 2026 say that each Google tag now becomes a Tag Manager container, and that new install snippets no longer include the gtag('config') line. gives a short overview.

The classic Google tag looks like this. Google still documents it as a :

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

The newer snippet looks like this. Notice the different loader and the missing config line:

<!-- Google tag -->
<script async src="https://www.googletagmanager.com/gtm.js?id=G-XXXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
</script>
Supported and unsupported Google tag formatsThe classic gtag.js snippet with config and the newer gtm.js snippet without config are documented. Combining the gtm.js loader with a config line is unsupported.Two snippet formats: pick one, never mix themClassic Google tagLoader: /gtag/js?id=G-…gtag('js', new Date())gtag('config', 'G-…')SupportedNewer unified snippetLoader: /gtm.js?id=G-…gtag('js', new Date())No config lineSupportedMixed (avoid)Loader: /gtm.js?id=G-…gtag('js', new Date())gtag('config', 'G-…')Unsupported
Use one complete snippet. Do not combine parts of two formats.
  • New install: copy exactly what your own account shows and paste it whole.
  • Existing classic code that works: you can keep it. Google says in-page behavior of existing tags does not change.
  • Mixed code: a G- ID loaded through gtm.js and then configured with gtag('config') is unsupported. Google scheduled the upgrade for unsupported installs for January 2027, so fix it now.

Step 2, option A: Use a code-insertion plugin to add the code to the header

This is the safest manual route because the code survives theme changes.

  1. Install and activate WPCode or another header and footer plugin.
  2. Open its header and footer screen. In WPCode this is Code Snippets → Header & Footer.
  3. Paste your complete Google tag into the Header box.
  4. Save the changes.

If you keep several custom snippets, see our guide to useful code snippets for WordPress and how to manage them safely.

Step 2, option B: Add the tracking code with a child theme

Never paste code into a parent theme, because the next update overwrites it. First follow our walkthrough on how to create a child theme in WordPress. The WordPress Child Themes handbook covers the details. For the block theme Twenty Twenty-Five, a minimal style.css is:

/*
Theme Name: Twenty Twenty-Five Child
Template:   twentytwentyfive
Version:    1.0.0
*/

Classic themes usually also need to load their stylesheets from functions.php. Next, add this to the child theme’s functions.php. It uses the classic gtag.js format and skips editors and administrators:

<?php
/**
 * Add the Google Analytics 4 tag to every front-end page.
 */
add_action( 'wp_head', 'mysite_add_ga4_tag', 1 );

function mysite_add_ga4_tag() {
	$id = 'G-XXXXXXXXXX'; // Replace with your Measurement ID.

	// Do not count your own editors and administrators.
	if ( current_user_can( 'edit_posts' ) || is_preview() ) {
		return;
	}

	wp_print_script_tag(
		array(
			'async' => true,
			'src'   => 'https://www.googletagmanager.com/gtag/js?id=' . rawurlencode( $id ),
		)
	);

	wp_print_inline_script_tag(
		'window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag("js", new Date());
gtag("config", ' . wp_json_encode( $id ) . ');'
	);
}

Replace G-XXXXXXXXXX with your ID. If your child theme file already starts with <?php, do not add a second one. We tested this snippet on WordPress 7.1.5 with a Twenty Twenty-Five child theme: the tag printed once for a logged-out visitor and not at all for the logged-in administrator. That test checks the page output, not data arriving in a GA4 account.

Google Analytics tracking code in a WordPress child theme functions.php file
Screenshot: the GA4 snippet in a child theme, shown in the WordPress Theme File Editor.

The editor is convenient, but a syntax error can break your site. Where possible, edit the file over SFTP or on a staging copy.

Step 3: Save changes and clear your website cache

Purge your caching plugin, any server or host cache and your CDN. Otherwise visitors may keep receiving pages created before the tag existed.

Step 4: Verify that the Google tag appears on your website

Open your home page in a private window, right-click and choose View page source. Search for your G- ID. In a classic snippet it appears twice in one block: once in the loader and once in the config line.

GA4 Google tag visible in the head of a WordPress page source
Screenshot: page source from our test site with the placeholder Measurement ID inside the head.

On macOS or Linux, this command counts the tag loaders on a page. One line with a count of 1 is what you want to see for a single install:

curl -s https://example.com/ \
  | grep -oE "(gtag/js|gtm\.js)\?id=[A-Z]+-[A-Z0-9]+|'GTM-[A-Z0-9]+'" \
  | sort | uniq -c

It reads only the HTML your server sends. Tags that Tag Manager or a consent tool injects later will not appear.

Method 3: Add Google Analytics 4 to WordPress Using Google Tag Manager

Google Tag Manager (GTM) is a free control panel for tags. You add the container to WordPress once, then manage Analytics, advertising pixels and custom events from Google’s interface. It is useful if you also run tools such as Facebook Pixel plugins for WordPress and want one place to control them. If you choose this route, move each pixel into GTM or leave it in its plugin, never both.

Google Tag Manager data flowWordPress loads one container. The container holds the Google tag and trigger and sends data to Analytics, Ads and other services.Method 3: how Google Tag Manager sits in the middleWordPressGTM code in <head>GTM web containerTagGoogle tag + G- IDTriggerInitialization – All PagesPublishmakes the version liveGoogle Analytics 4Google AdsOther tags
Google Tag Manager for WordPress: one container, several destinations.

Step 1: Create a Google Tag Manager account

Go to tagmanager.google.com, sign in, open the Accounts tab and click Create Account. Enter an account name and country.

Step 2: Create a web container for your WordPress website

Name the container after your domain, choose Web as the platform, click Create and accept the terms. You receive an ID that looks like GTM-XXXXXXX.

Step 3: Install the GTM container on WordPress

In the container, click your GTM- ID to open the install window, then choose manual installation. The current version is a single block for the <head>, similar to this:

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

Older installs use two blocks: a script in the head and a <noscript> iframe after the opening body tag. If yours already works, you do not need to retag it. Always copy the code from your own container.

Then choose one way to place it:

  • GTM4WP plugin: go to Settings → Google Tag Manager and enter your container ID. This plugin requires PHP 8.0 and WordPress 6.3 or newer.
  • Header and footer plugin: paste the code from your install window into the matching boxes.
  • Child theme: use the hooks below. only works if your theme calls it.
add_action( 'wp_head', 'mysite_add_gtm', 1 );

function mysite_add_gtm() {
	?>
	<!-- Paste the <head> code from your own GTM install window below -->

	<?php
}

// Only needed if your install window also gives you a <noscript> part.
add_action( 'wp_body_open', 'mysite_add_gtm_noscript', 1 );

function mysite_add_gtm_noscript() {
	?>
	<!-- Paste the <noscript> code here -->
	<?php
}

Step 4: Create a Google tag in Google Tag Manager

Open Tags, click New, name it GA4 – Google tag, click Tag Configuration and select Google tag.

Step 5: Enter your GA4 Measurement ID

Paste your G-XXXXXXXXXX ID into the Tag ID field. Do not paste the GTM- container ID here.

Step 6: Configure the Initialization – All Pages trigger

Click Triggering, select Initialization – All Pages and save. Google recommends this trigger so the tag is ready before other events fire. See the . If a new container already holds a Google tag for your ID, edit it instead of creating a duplicate.

Step 7: Preview and test your tracking configuration

Click Preview, enter your site URL and connect. Tag Assistant opens your site and lists the tags that fired. Confirm your Google tag appears under the initialization event.

Step 8: Submit and publish your container

Click Submit, add a version name such as Add GA4 Google tag and click Publish. Preview mode alone does not make changes live. If your site still has a direct GA4 snippet or Site Kit is placing one, switch that off to avoid double counting.

How to Verify Google Analytics 4 Is Working on WordPress

A green message in a plugin is not proof. Run these four checks in a private window, logged out of WordPress, with ad blockers off.

Four GA4 verification checksCheck page source, then Tag Assistant, then the Realtime report, then DebugView.Verify GA4 in four checks1Page sourceIs the tag there,and only once?2Tag AssistantIs your ID foundand firing?3RealtimeDoes your testvisit appear?4DebugViewDo events andparameters look right?
The verification order: code, firing, reporting, detail.

Check 1: Test your Google tag with Google Tag Assistant

Open , add your domain and connect. Look for your ID in the tags found, and check that it fires. Visit two or three pages.

Check 2: Check the GA4 Realtime report

In GA4, open Reports → Realtime. Browse your site from your phone on mobile data. Your visit should appear shortly. Google notes that data collection can take up to 30 minutes to begin on a new setup.

Check 3: Verify events using GA4 DebugView

Go to Admin → Data display → DebugView. Connecting through Tag Assistant or GTM preview turns on debug mode for your device. With a classic snippet you can also add it temporarily:

gtag('config', 'G-XXXXXXXXXX', { 'debug_mode': true });

Remove the whole debug_mode parameter afterwards. Setting it to false does not switch it off. The DebugView help page also notes that events can be missing if consent or privacy controls block them.

Check 4: Confirm that page views are being recorded

Look for the page_view event, one for each page you open. Two identical page views for one load usually mean two tags. In your browser’s developer tools, you can also filter the Network tab for collect and look for requests carrying your ID.

Using Site Kit? Go to Tools → Site Health → Info, open the Site Kit section and check whether the Analytics snippet is placed.

Common Google Analytics 4 Issues and How to Fix Them

GA4 troubleshooting flowchartCheck that the tag is visible, the ID is correct, consent allows requests, and the Tag Manager container is published.No data in GA4? Follow this orderTag visible when logged out?NoClear every cache; check the plugin or themeYesCorrect G- ID?NoCopy it again from your web streamYesRequests sent after consent?NoTest your cookie banner and delay settingsYesGTM container published? (if used)NoSubmit, publish, then check the trigger
A quick order of checks when GA4 shows no data.
Problem Likely cause Fix
No visitors tracked Tag missing, or only you are testing while logged in Test logged out and view the page source
Realtime shows nothing Cache, consent, ad blocker or wrong property Purge caches, accept cookies, try another device
Data in the wrong place Incorrect Measurement ID Compare the ID on your site with the web stream
Doubled page views Two plugins, or plugin plus theme or GTM Keep one source only
GTM tag not firing Container unpublished or wrong trigger Use Preview, then publish
Tracking stopped after an update Code lived in the parent theme Move it to a plugin or child theme

Google Analytics not tracking WordPress visitors

Confirm the tag exists on several templates: home page, post, page, product and checkout. Some page builder landing page templates skip the theme header. If your theme does not call wp_head(), header code cannot print.

GA4 Realtime report showing no data

Check that you opened the correct property. Then turn off ad blockers, accept analytics cookies on your own banner and visit again. Browsers with strict tracking protection can block requests.

Incorrect Measurement ID

Look for a missing character, a GTM- ID in a G- field, or an ID from a staging property. Copy it again from Data streams instead of retyping it.

Duplicate Google Analytics tracking codes

Search the page source for every G-, GT- and GTM- ID. Check theme settings, header plugins, SEO plugins, WooCommerce integrations and the GTM container. Remove every source except the one you chose.

Google Tag Manager tags not firing

Verify the container ID on the site, the Tag ID in the Google tag, the trigger and the published version. Since October 2026, gtag.config commands also appear as events in the data layer, so review any custom event trigger that uses a catch-all wildcard.

Tracking code removed after a theme update

Code added to a parent theme file is lost on update. Changing themes also deactivates code in the old child theme. A header plugin or a small site plugin avoids both problems.

Caching or cookie consent preventing tracking

Script delay or combine options can hold back the tag until a visitor scrolls or clicks. Exclude the Google tag from those options and test again. Do not bypass your consent tool to “fix” tracking: a tag blocked until consent may be working exactly as designed.

Which Google Analytics 4 Installation Method Is Best?

Site Kit by Google vs. manual installation vs. Google Tag Manager

Feature Site Kit Manual code Tag Manager
Coding needed No A little No for basic setup
Reports in WordPress Yes No No
Extra plugin Yes Optional Optional
Custom events Limited With code Strong
Main risk Overlap with other tags Editing errors Misconfigured triggers
Choosing a GA4 installation methodSite Kit for simple setup, manual code for developers who want no extra plugin, Tag Manager for many tags and custom events.Which installation method should you use?What do you need?Simple setup andin-dashboard statsSite KitBeginners, blogsFull control,no extra pluginManual codeDevelopersMany tags andcustom eventsTag ManagerMarketers, stores
Match the method to the job.

Best method for beginners

Choose Site Kit. It needs no code and checks for existing snippets during setup.

Best method for developers

Choose manual code in a child theme or site plugin. You control exactly what prints and can keep it in version control.

Best method for advanced tracking and conversions

Choose Google Tag Manager for button clicks, form events, scroll thresholds and several advertising platforms.

7 GA4 Settings to Change After Installation

After you install Google Analytics 4 on WordPress, collection starts. These settings make the data useful.

  1. Data retention: in Admin, find the data retention setting and choose the period that matches your privacy policy. A new property keeps user-level data for 2 months; standard properties can choose 14.
  2. Enhanced measurement: review each toggle in the web stream so you know what is collected.
  3. Internal traffic: define your office IP addresses in the tag settings, then test the data filter before activating it.
  4. Unwanted referrals: add payment gateway domains so sales are not credited to the gateway.
  5. Key events: mark real goals, such as generate_lead or purchase.
  6. Search Console link: connect it to see search queries alongside site behavior.
  7. User access: give each person their own login and the lowest role they need.

Tracking WooCommerce Sales With Google Analytics 4

A basic tag records page views but does not know your order totals. For a store, you need ecommerce events such as view_item, add_to_cart, begin_checkout and purchase.

  1. Install Google Analytics for WooCommerce, or use an ecommerce data layer plugin with Tag Manager.
  2. Enter your Measurement ID under WooCommerce → Settings → Integration.
  3. Remove or disable other sources that send the same events.
  4. Place a test order and check the events in DebugView.
  5. Compare GA4 revenue with WooCommerce orders. Treat WooCommerce as your record of sales, since consent choices and blockers make analytics figures lower.

Once you can see where shoppers drop off, act on it. Compare these essential plugins for WooCommerce and work through our guide to speeding up a WooCommerce store.

Privacy and Cookie Consent Considerations

This section is general information, not legal advice. Rules depend on where you and your visitors are.

Understand Google Analytics cookie usage

GA4 typically sets first-party cookies named _ga and _ga_<container-id> to tell visitors and sessions apart.

Configure visitor consent where required

Google requires consent signals for certain uses of data from the European Economic Area, and many sites also need consent in the UK and Switzerland. Consent mode v2 passes the visitor’s choice to Google tags through four signals. A basic default, placed before the Google tag, looks like this in a child theme:

add_action( 'wp_head', 'mysite_consent_defaults', 0 );

function mysite_consent_defaults() {
	wp_print_inline_script_tag(
		"window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
  'ad_storage': 'denied',
  'ad_user_data': 'denied',
  'ad_personalization': 'denied',
  'analytics_storage': 'denied',
  'wait_for_update': 500
});"
	);
}

Do not use this on its own. It denies everything until a consent banner sends an update. Use a consent management plugin that sends that update, and follow Google’s consent mode implementation guide. Site Kit also offers a consent mode option that works with consent plugins supporting the WP Consent API.

Advertisers should note a 2026 change: since June 15, the ad_storage consent setting alone controls whether advertising cookies and IDs from the Analytics tag reach Google Ads, not the Google signals switch. This 2026 overview of Google’s data control updates explains what to audit.

Review your privacy policy

Say that you use Google Analytics, what it collects, why, how long you keep it and how visitors can refuse. WordPress helps you choose or create the page under Settings → Privacy.

WordPress Privacy settings screen for choosing a privacy policy page
Screenshot: the Privacy settings screen in WordPress.

Fonts and other third-party files can raise privacy questions too. See how to host Google Fonts locally in WordPress.

Avoid collecting unnecessary personal information

Never send names, email addresses or phone numbers to Analytics. Check page URLs from search boxes, form confirmations and password reset links, which can leak personal data. Google lists ways to avoid sending personally identifiable information.

Frequently Asked Questions About GA4 and WordPress

Is Google Analytics 4 free for WordPress?

Yes. Standard GA4 is free and enough for most sites. Google sells Analytics 360 to large organizations, and some WordPress plugins charge for extra features.

Do I need a plugin to add Google Analytics?

No. You can paste the Google tag with a child theme or custom site plugin. A plugin is easier and reduces the chance of editing mistakes.

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

Copy the Google tag from your web stream and print it in the head with the wp_head hook in a child theme, as shown in Method 2.

Can I use GA4 without Google Tag Manager?

Yes. Site Kit and the manual Google tag both send data to GA4 without a separate Tag Manager container of your own.

Where can I find my GA4 Measurement ID?

Go to Admin, then Data collection and modification, then Data streams. Open your web stream. The ID starts with G-.

How long does GA4 take to start collecting data?

It can take up to 30 minutes to begin. Realtime is the first place to look. Standard reports often need 24 to 48 hours.

Can I use Site Kit and Google Tag Manager together?

Yes, as long as only one of them sends GA4 page views. If your GTM container holds the Google tag, stop Site Kit from placing the Analytics code.

Which is the best Google Analytics plugin for WordPress?

Site Kit is a strong free choice for most people. Choose a paid analytics plugin if you need its particular reports, or GTM4WP if you work in Tag Manager.

Why are my own visits missing from GA4?

Many setups, including Site Kit by default, exclude logged-in users. Ad blockers, consent choices and internal traffic filters can also hide your visit.

Does Google Analytics slow down WordPress?

Any third-party script adds some network and processing work. The Google tag loads asynchronously, so the effect is usually modest. Avoid loading duplicate tags and unused tags in Tag Manager.

How do I track WooCommerce conversions with GA4?

Send ecommerce events with a WooCommerce analytics integration or a data layer plus Tag Manager, mark purchase as a key event and verify it with a test order.

Will GA4 show visits from before I installed it?

No. Analytics collects data from the moment the tag works. It cannot fill in earlier traffic.

Conclusion

You now know how to add Google Analytics to WordPress in three reliable ways. Use Site Kit for the quickest setup, manual code for control and Google Tag Manager for advanced measurement. Whichever you choose, install it once, copy the whole snippet your account gives you, and verify it in Tag Assistant, Realtime and DebugView.

Then set your data retention, key events and consent options. After a few weeks of data, pick one page that gets traffic but little engagement, improve it and measure the difference.

Inspire us with your love!

Saiful Islam

By Saiful Islam

Saiful Islam, the founder of aThemeArt, is a successful freelancer, a father of two boys, and an enthusiast in coding, YouTube, and gaming. Connect with me on Twitter, Facebook, and Instagram to stay updated with my latest endeavors.

You can check also

Leave a Reply

Your email address will not be published. Required fields are marked *.

*
*