How Do I Add Google Analytics to WordPress?
Set up GA4 on WordPress, verify tracking, and fix common errors.
Why Google Analytics Matters for WordPress
Google Analytics 4, or GA4, is Google’s current analytics tool. It shows how visitors use your WordPress site.
GA4 can record page views, clicks, downloads, searches, and purchases. This data helps you see which pages support your goals.
Many site owners ask, “How do I add Google Analytics to WordPress?” The process has three main parts.
Create a GA4 property, connect it to WordPress, and check the data. The same steps work for a blog, shop, or service website.
This guide explains how to add Google Analytics to a WordPress site. It also covers how to add Google Analytics to a WordPress blog.
Create Your Google Analytics Account
Use a Google account that your team can keep using. Account ownership matters when staff or agencies change.
Open Google Analytics and choose Start measuring. Google’s Google Analytics setup instructions show the current account flow.
- Enter an account name for your company or site group.
- Choose data sharing settings that suit your needs.
- Enter a clear name for the GA4 property.
- Select your reporting time zone and currency.
- Choose your business details and main goals.
Your time zone sets the start of each day in reports. Pick the zone used by your team.
Your currency affects value fields in reports. It does not change your payment system.
Use clear names if you manage several sites. This keeps each property easy to find.
Set Up a GA4 Property and Data Stream
Open the new property and choose Web as the platform. Enter your full website address.
Next, add a stream name such as “Main site.” GA4 then gives you a measurement ID.
The ID starts with G-. It links your WordPress site with the right data stream.
Turn on enhanced measurement for most sites. It can track scrolls, outbound clicks, searches, videos, and downloads.
Review each setting before saving it. One web stream is enough for most WordPress sites.
- Use one stream for one main website.
- Check the site address before saving.
- Copy the correct measurement ID.
- Note which enhanced events you enable.

Choose How to Add Google Analytics to WordPress
There are four common ways to put Google Analytics on WordPress. Choose one method for each site.
Using two methods can send duplicate page views. That will make your reports hard to trust.
Use Site Kit by Google
Site Kit is the simplest way to add Google Analytics to a WordPress site. It avoids direct theme edits.
- Open Plugins in the WordPress dashboard.
- Select Add New and search for Site Kit by Google.
- Install and activate the plugin.
- Start setup and sign in to Google.
- Verify site ownership when asked.
- Connect your GA4 property and finish setup.
Site Kit’s installation steps cover account links and site checks. The plugin can also show basic reports inside WordPress.
Use another analytics plugin
Other plugins can place the Google Analytics tag for you. Some also support consent tools and custom events.
Check its update date and support record first. Then add your measurement ID in its settings.
Choose one plugin that fits your needs. Do not install several tools that track the same page.
Add Google Analytics without a plugin
Many developers ask how to add Google Analytics to WordPress without a plugin. You can copy the Google tag from your web stream settings.
Place the tag in the shared site head. A child theme is safer than editing a parent theme.
Theme updates can erase parent file changes. A code snippet tool can keep the tag separate.
This option suits users who manage theme files well. One wrong edit can break the site.
Use Google Tag Manager
Tag Manager suits sites with many tags or custom events. Create a web container and add a Google tag.
Enter the GA4 measurement ID. Set the tag to fire on all pages.
Test the container before publishing it. This method gives more control but needs more checks.

Verify Your WordPress Analytics Installation
After setup, open your site in a private browser window. Then open the GA4 real-time report.
Visit two or three pages on your site. Look for your visit within a few minutes.
Real-time data confirms that the tag sends data. It does not prove every event works yet.
Use Google Tag Assistant to inspect tags on your pages. It can help find missing or repeated tags.
- Open the site in a private browser window.
- Visit the home page and two inner pages.
- Check the GA4 real-time report.
- Run Tag Assistant on the same pages.
- Confirm one Google tag loads on each page.
Do not test only while logged into WordPress. Some tools exclude admin traffic by design.
Apply Useful GA4 Best Practices
Clean data matters more than a large data set. Set basic rules before you judge site performance.
Exclude your own visits from reports when possible. Add staff IP addresses to an internal traffic rule.
Use consent settings that match your visitors and local rules. Your cookie tool may control when analytics loads.
Set up custom events for actions that matter. Examples include form starts, file downloads, and product enquiries.
- Define one clear goal for each key page.
- Use stable event names across your site.
- Mark important events as key events in GA4.
- Review reports each month for odd traffic.
Keep a short record of each change. This helps explain sudden shifts in your reports.
Troubleshoot Common WordPress Analytics Issues
No data usually means the tag did not load. Check the measurement ID first.
A wrong ID sends data to another property. Copy it again from the correct web stream.
Duplicate data often comes from two tracking methods. Check Site Kit, other plugins, theme code, and Tag Manager.
Cache tools can serve old page code. Clear site, server, and browser caches after each change.
Consent tools can block analytics until visitors agree. Test both consent states when your setup requires it.
- No real-time data: check the tag, ID, and consent settings.
- Double page views: remove the extra tracking method.
- Some pages lack data: inspect templates and cache rules.
- Events fail: test each event with Tag Assistant.
- Reports look low: review filters and internal traffic rules.
Make one change at a time. Then test again before changing another setting.
Finish Your WordPress GA4 Setup
The best answer to “How do I add Google Analytics to my WordPress website?” starts with a clean GA4 property.
Choose Site Kit for a simple setup. Choose manual code or Tag Manager when you need more control.
Check real-time data after installation. Then remove duplicate tags and define useful events.
With those steps, you can use Google Analytics with WordPress without guesswork. Your reports will be easier to trust and act on.
Step-by-step
- 01 Create a GA4 property
Open Google Analytics and create an account and property. Set the correct time zone and currency.
- 02 Create a web data stream
Choose Web, enter your WordPress address, and create the stream. Copy the measurement ID that starts with G-.
- 03 Choose one WordPress method
Connect GA4 with Site Kit, another plugin, manual code, or Tag Manager. Do not combine methods.
- 04 Add the measurement ID
Enter the ID in your chosen tool. If using code, place the Google tag in the shared site head.
- 05 Test your setup
Visit several pages in a private window. Check the GA4 real-time report and inspect the pages with Tag Assistant.
- 06 Set data rules and events
Exclude internal traffic and add custom events for useful actions. Test each event before using its data.
Frequently asked questions
- How do I add Google Analytics to WordPress?
- Create a GA4 property and copy its measurement ID. Connect it with Site Kit, another plugin, manual code, or Tag Manager.
- What is the easiest way to add GA4 to WordPress?
- Site Kit by Google is often the easiest choice. It guides setup and avoids direct theme edits.
- Can I add Google Analytics to WordPress without a plugin?
- Yes. Add the Google tag to your site head through a child theme or code snippet tool.
- How do I check Google Analytics on WordPress?
- Open your GA4 real-time report after visiting your site. Tag Assistant can also confirm that the tag loads.
- Why is Google Analytics not tracking my WordPress site?
- Check the measurement ID, consent settings, cache, and active tracking method. Also remove duplicate tags from plugins or themes.
- Should I use more than one Google Analytics plugin?
- No. Multiple tracking tools can send duplicate page views and weaken your reports.
Related reading
How Do You Check Traffic on a WordPress Website?
Track WordPress traffic, understand key metrics, and improve your site with confidence.
How to Embed Instagram on WordPress
Embed Instagram posts, videos, and live feeds in WordPress with ease.
How to Put Mailchimp on WordPress
Add Mailchimp forms to WordPress and grow your email list with less effort.