Understanding how people use your WordPress website can help you make better decisions about its content, design and functionality. But without reliable analytics, it can be difficult to know which pages attract visitors, where your traffic comes from or how people interact with your site.
Google Analytics is a free tool that helps answer these questions.
The latest version, Google Analytics 4 (GA4), lets you monitor website traffic, understand visitor behaviour and measure important interactions.
In this guide, we’ll show you how to install Google Analytics on WordPress using two methods:
- Google Site Kit: The easiest option for most WordPress website owners, using Google’s official free plugin.
- Manual installation: An alternative for those who prefer to add the Google Analytics tracking code without a dedicated plugin.
We’ll also explain how to check that tracking works, what you can measure and how to avoid common installation mistakes.
What Is Google Analytics 4?
Google Analytics 4 (GA4) is Google’s website and app analytics platform. It collects information about how visitors interact with your website and presents that information in reports.
For example, you can use Google Analytics to answer questions such as:
- How many people visit my website?
- Which pages receive the most traffic?
- Do visitors arrive through Google Search, social media or other websites?
- Are people browsing on mobile devices or desktop computers?
- Which pages encourage visitors to explore further?
- Are visitors completing important actions, such as submitting enquiries or making purchases?
Unlike the older Universal Analytics platform, which stopped processing new data in July 2023, GA4 uses an event-based measurement system.
An event represents an interaction, such as viewing a page, clicking a link or downloading a file. This provides a flexible way to understand what visitors do on your website.
Google Analytics vs Google Search Console
Google Analytics and Google Search Console are separate tools that provide different information.
Google Analytics focuses on what visitors do on your website, including their traffic sources, engagement and recorded interactions.
Google Search Console focuses on how your website performs in Google Search, including search queries, impressions, clicks and indexing issues.
Both tools can be useful, and Google Site Kit can connect them to your WordPress dashboard.
However, installing Google Analytics does not automatically improve your search rankings. Its purpose is to provide information that can help you make informed decisions.
Before You Install Google Analytics on WordPress
Before making changes to your website, check whether Google Analytics is already installed.
Some WordPress websites use analytics plugins, theme integrations, Google Tag Manager or custom tracking code.
Installing another tracking tag without checking the existing setup can result in duplicate page views and inaccurate reports.
You should also make sure you have:
- Administrator access to your WordPress website.
- A Google account that you control.
- Access to any existing Google Analytics property associated with the website.
- A suitable privacy and consent setup for your visitors.
If someone previously configured Analytics for your website, try to obtain access to that property rather than immediately creating another one.
Understanding GA4 accounts, properties and measurement IDs
Google Analytics uses several terms that are worth understanding before you begin.
| Term | What it means |
|---|---|
| Account | The main container for your Google Analytics properties |
| Property | The collection of reports and settings for a particular website, app or business |
| Web data stream | The connection through which your website sends data to GA4 |
| Measurement ID | An identifier, usually beginning with G-, associated with your web data stream |
| Google tag | The code or integration used to send website information to Google |
For example, a website might have a measurement ID resembling G-XXXXXXXXXX.
You don’t need to memorise these terms. However, knowing the difference between a property and a measurement ID will make setup and troubleshooting easier.
Method 1: Install Google Analytics Using Site Kit
For most WordPress website owners, we recommend Site Kit by Google.
Site Kit is Google’s official free WordPress plugin. It connects your website to supported Google services, including Analytics and Search Console, without requiring you to manually edit your theme’s code.
It can also display selected statistics within your WordPress dashboard.
Step 1: Install and activate Site Kit
Log in to your WordPress administration area.
- Navigate to Plugins > Add New Plugin.
- Search for Site Kit by Google.
- Locate the official plugin published by Google.
- Click Install Now.
- Once installation finishes, click Activate.
You should now see Site Kit in your WordPress dashboard menu.
If you’re unfamiliar with installing plugins, our guide to installing WordPress plugins explains the process in more detail.
Step 2: Connect your Google account
Navigate to Site Kit > Dashboard.
You should see an option to begin setting up the plugin.
During the initial setup, you can choose to connect Google Analytics. Enable this option if you want to configure Analytics as part of the process.
Next:
- Click Sign in with Google.
- Select the Google account you want to use.
- Review the permissions requested by Site Kit.
- Follow the prompts to verify ownership of your website.
- Allow Site Kit to display information from your connected Google services.
Site Kit may also guide you through connecting Google Search Console.
If you manage a client’s website, use an appropriate Google account with the necessary permissions. Ideally, the business should retain ownership and administrative access to its Analytics property.
You don’t want important website statistics tied permanently to an account nobody else can access.
Step 3: Connect or create a GA4 property
Once Site Kit is connected, you’ll be guided through setting up Google Analytics.
If you already have an Analytics account and GA4 property, select the appropriate existing property.
Otherwise, Site Kit can guide you through creating the necessary Analytics account and property.
Depending on your existing setup, you may need to select an account, approve additional permissions or complete property configuration.
Take care to select the correct website.
For example, if you manage several WordPress websites through the same Google account, each might have a separate GA4 property and web data stream.
Connecting the wrong property could send data to an unrelated set of reports.
Site Kit may also ask about your website’s main purpose so it can tailor the metrics shown in its dashboard.
Complete the setup using the options appropriate for your website.
Step 4: Confirm Analytics is connected
Return to your WordPress dashboard and navigate to:
Site Kit > Settings > Connected Services
Find Analytics and expand its details.
You should be able to see information about the connected Analytics account and property.
If Site Kit is responsible for adding the Google Analytics tag, make sure the relevant code placement option is enabled.
However, if Site Kit detects that a Google Analytics tag is already installed, it may disable automatic code placement to avoid duplicating your tracking.
Don’t enable another copy of the same tracking tag without first checking how Analytics is currently installed.
You can also connect Analytics after the initial setup by visiting:
Site Kit > Settings > Connect More Services
Once connected, Site Kit can display selected analytics metrics within WordPress. The complete range of reports remains available through Google Analytics.
Important: Connecting Analytics and placing the tracking tag are not substitutes for configuring appropriate visitor consent. Review the privacy section later in this guide before relying on your new tracking setup.
Method 2: Install Google Analytics Without a Plugin
You can install Google Analytics manually if you prefer not to use Site Kit.
This method involves obtaining your website’s Google tag and adding it to the site’s HTML.
It provides greater control over the implementation, but you’ll need to maintain the code and ensure it remains in place when your website changes.
For beginners, the Site Kit method is generally simpler.
Step 1: Create or select your GA4 property
Visit Google Analytics and sign in.
If you’ve never used Analytics before, select Start Measuring and follow the account creation process.
If you already have an account, select the appropriate account and property.
To create a new property, navigate to:
Admin > Create > Property
Enter the requested details, including:
- Property name.
- Reporting time zone.
- Reporting currency.
- Business information and objectives.
For a UK business, you might select the United Kingdom time zone and GBP as the reporting currency, depending on your reporting requirements.
Review the settings carefully before proceeding.
Next, create a Web data stream for your WordPress website if one does not already exist.
Enter your website address and a suitable stream name.
Google will create the web data stream and provide its measurement information.
Step 2: Find your Google tag
In Google Analytics, navigate to:
Admin > Data streams
Select your website’s web data stream.
You’ll see its measurement ID, normally beginning with G-.
To obtain the installation code:
- Open your web data stream.
- Find the Google tag section.
- Select View tag instructions.
- Choose Install manually.
- Copy the complete Google tag snippet provided for your website.
Use the snippet Google currently provides rather than copying an old example from another website.
Google’s tagging implementation has evolved over time, and older tutorials may contain outdated tracking code.
Step 3: Add the Google tag to WordPress
Google generally instructs website owners to place the tag near the beginning of the HTML <head> section on every page they want to measure.
The exact implementation depends on your WordPress theme.
Some themes provide a dedicated field for custom header scripts. If yours does, you may be able to paste the complete Google tag there.
Check your theme’s documentation to confirm that the field inserts code into the HTML head across the website.
If your theme doesn’t provide this functionality, a developer can add the Google tag through a child theme or another maintainable, site-specific implementation.
For example, an appropriate WordPress wp_head hook can output the tag without requiring direct changes to a parent theme.
Avoid editing your parent theme’s functions.php or header.php files directly.
A theme update could overwrite your changes, while incorrect PHP modifications could cause website errors.
Also, don’t paste the tracking snippet into an ordinary page, post or the Additional CSS editor. It needs to load correctly across the pages you intend to track.
If your website uses a block theme, it may not have the traditional header.php file described in older WordPress tutorials.
In that situation, use a compatible theme integration or a suitable developer-managed approach.
Make a backup before changing theme code, and test the result carefully.
Step 4: Check that the tag is installed
Once you’ve added the code, open your website in a browser.
You can use Google Tag Assistant to check whether Google detects your tag.
Enter your website address, connect to the site and inspect the detected Google tags.
Confirm that the relevant Google tag or measurement destination matches the one configured for your website.
You can also inspect your website’s page source, although finding a tag in the source doesn’t necessarily prove that data is reaching Google Analytics.
The next section explains how to verify actual data collection.
What about Google Tag Manager?
If your website already uses Google Tag Manager, you can manage Google Analytics through that system instead.
Google Tag Manager allows you to configure and manage tracking tags without repeatedly editing your website’s code.
However, it introduces another layer of configuration.
For a straightforward WordPress website that only needs basic Analytics tracking, Site Kit is usually easier to manage.
Avoid adding GA4 through Site Kit, Google Tag Manager and a manually inserted Google tag simultaneously without understanding how those implementations interact.
How to Check Google Analytics Is Working
After installation, verify that your website is sending data to the correct GA4 property.
Don’t assume everything works simply because a plugin says it’s connected.
Step 1: Open the Realtime report
Sign in to Google Analytics and select your website’s property.
Navigate to:
Reports > Realtime
The Realtime report shows visitor activity from the previous 30 minutes.
Step 2: Visit your website
Open your website in another browser window or on a separate device.
If your website uses a consent banner, make an appropriate consent choice for testing.
Visit several pages and interact with the website normally.
Return to the Realtime report and look for recent activity.
You may see:
- An active user.
- Page views from the pages you visited.
- Recorded events.
- Information about the device or location associated with the visit.
Google indicates that data collection can take up to approximately 30 minutes to begin after a new installation.
Don’t assume the setup has failed immediately if nothing appears.
Step 3: Check the standard reports
Once Analytics has been collecting information, you can explore other reports.
For example:
Reports > Acquisition helps you understand how visitors find your website.
Reports > Engagement > Pages and screens can show which pages people view and how they interact with your content.
The available navigation and report collections can vary depending on your GA4 configuration.
Standard reporting data may take 24 to 48 hours to finish processing, so it won’t always match what you see in Realtime.
Remember: Google Analytics cannot normally reconstruct historical website visits that occurred before tracking was installed.
Your data starts accumulating when your tracking implementation begins collecting it.
What Can You Track After Installation?
Google Analytics 4 provides several types of tracking, but it’s important to distinguish automatic measurements from features that require additional configuration.
Page views and visitor activity
With basic GA4 tracking correctly installed, Analytics can collect events such as page views and session activity.
You can use these to understand:
- Which pages visitors access.
- How visitors arrive at your site.
- How many users and sessions are recorded.
- How people engage with different pages.
- Which devices visitors use.
These reports provide a starting point for understanding your audience.
Enhanced measurement events
GA4 includes an enhanced measurement feature that can automatically collect additional interactions when enabled.
Depending on your settings and website functionality, these can include:
| Interaction | Example |
|---|---|
| Page views | Someone opens a blog article |
| Scrolls | A visitor reaches approximately 90% of a page |
| Outbound clicks | Someone follows a link to another website |
| Site searches | A visitor uses a supported website search |
| File downloads | Someone clicks a link to download a PDF |
| Video engagement | A visitor interacts with a supported embedded YouTube video |
| Form interactions | Someone starts or submits a detectable form |
You can review these options in your GA4 web data stream settings.
Not every interaction will be detected on every WordPress website.
For example, some forms use JavaScript or other submission methods that prevent automatic form tracking from working as expected.
If you need reliable form submission tracking, test it using the actual form on your website.
Tracking enquiries and important actions
You may also want to measure actions that matter to your business.
These could include:
- Contact form submissions.
- Appointment enquiries.
- Newsletter registrations.
- Quote requests.
- Purchases.
- Other completed customer actions.
GA4 refers to important business events that you designate for reporting as key events.
However, installing the basic Google tag doesn’t guarantee that all these actions are automatically recorded.
Some require additional event configuration or a compatible plugin integration.
Site Kit also supports plugin conversion tracking for certain WordPress plugins, including selected form plugins and WooCommerce. This is a separate feature that must be configured and tested appropriately.
Tracking affiliate links
If your website contains affiliate links, GA4 enhanced measurement may record clicks that take visitors to external websites.
However, tracking can depend on how those links are implemented.
For example, a link that passes through an internal redirect or cloaked URL might not behave like a standard outbound link.
Check the actual events recorded before assuming that every affiliate click is being measured.
Click tracking also doesn’t automatically tell you whether a visitor purchased a product or generated a commission.
That information generally requires additional reporting from your affiliate provider or a suitable integration.
Tracking WooCommerce purchases
If you operate an online shop using WooCommerce, you may want to track product views, basket activity, checkout progress and completed purchases.
GA4 supports ecommerce events, but comprehensive ecommerce tracking requires a suitable implementation.
Depending on your setup, this might involve a compatible WooCommerce integration, Site Kit’s supported plugin conversion tracking or another appropriately configured solution.
Basic page-view tracking alone is not sufficient to provide complete ecommerce reporting.
You should verify that important events, particularly purchases, are recorded correctly and aren’t duplicated.
Common Google Analytics Setup Problems
Even with the correct installation method, there are a few common reasons why Google Analytics may not appear to work.
No visitors appear in Realtime
First, confirm that you’re viewing the correct Analytics property.
Then:
- Visit your website and generate some activity.
- Check that your consent choices permit the tracking you’re testing.
- Allow some time for data collection to begin.
- Use Tag Assistant to inspect the implementation.
- Check whether browser extensions, security settings or consent tools are blocking the tag.
Also check whether internal traffic filters or other Analytics settings could be affecting the data you expect to see.
The wrong measurement ID is installed
If you manage several websites or Analytics properties, it’s easy to select the wrong one.
Open your GA4 web data stream and compare its measurement ID with the tag or integration installed on your website.
If they don’t match, correct the configuration using the method responsible for placing the tag.
Page views are being counted twice
Duplicate tracking can happen when the same page-view event is sent more than once.
For example, a website might have Google Analytics installed through an existing plugin and then add another tag through a theme integration.
Review the active tracking methods before adding or removing code.
Don’t assume that every website using both Google Tag Manager and Site Kit has duplicate tracking. The actual tag configuration determines whether events are duplicated.
Site Kit is connected but no data appears
Site Kit can connect to Google Analytics without necessarily being responsible for placing the tracking code.
Navigate to Site Kit > Settings > Connected Services > Analytics and review the available settings.
Check whether an existing tag was detected and whether Site Kit is configured to place the Analytics code.
If tracking is already managed elsewhere, make sure that existing implementation is working correctly.
Some visitors aren’t being recorded
Google Analytics shouldn’t be treated as an exact visitor counter.
Reported numbers may be affected by consent choices, privacy controls, browser restrictions, content blockers and technical configuration.
This is particularly relevant when using consent management tools.
If visitors decline analytics tracking, you shouldn’t expect their activity to appear in the same way as activity from consenting visitors.
The plugin stops working after an update
If Site Kit develops a problem after a WordPress or plugin update, check the plugin’s connection status and any error messages.
Avoid immediately deleting the plugin or resetting its configuration without understanding the issue.
Our guide to fixing WordPress plugin problems explains how to investigate conflicts and other plugin issues safely.
Google Analytics, Cookies and Privacy
Before using Google Analytics on your WordPress website, you should understand the privacy implications.
Google Analytics can involve technologies that store or access information on visitors’ devices, along with the processing of information about their website activity.
For UK websites, the relevant rules include the Privacy and Electronic Communications Regulations (PECR) and UK GDPR.
Do you need consent for Google Analytics?
You shouldn’t assume that installing Analytics automatically makes your website compliant with UK privacy requirements.
UK rules now include a statistical-purposes exception that may allow certain website analytics without prior consent when strict conditions are satisfied.
However, this is a narrow exception. It doesn’t automatically apply to every analytics service or configuration.
Factors include why the information is collected, how it is used, what a third-party provider does with it, and whether visitors receive the required information and opportunity to object.
Analytics used for advertising or other purposes outside the exception may require consent.
Google also has its own consent requirements for supported services and visitors in regions including the UK.
For these reasons, website owners should assess their actual configuration rather than assuming that GA4 qualifies for a general analytics exemption.
The Information Commissioner’s Office (ICO) provides guidance on the available exceptions and their conditions.
Using consent management with Site Kit
Site Kit includes an option for Google consent mode.
You can find it under:
Site Kit > Settings > Admin Settings
Consent mode adjusts how supported Google tags behave according to visitors’ consent choices.
However, enabling consent mode does not itself provide a cookie banner or obtain visitor consent.
For Site Kit’s consent mode integration, you’ll also need the appropriate consent management setup. Google’s documented approach includes the WP Consent API and a compatible consent management plugin.
Your consent mechanism needs to be configured correctly, with the necessary choices communicated to the relevant tracking services.
Avoid enabling multiple competing consent mode implementations without checking how they work together.
Keep your privacy information up to date
Your website’s privacy information should accurately explain the analytics technologies you use and how visitor information is handled.
Make sure any relevant consent or objection mechanism works as intended.
If you’re unsure which rules apply to your particular website, seek appropriate professional privacy advice.
Installing an analytics plugin is a technical task. Determining whether your data collection meets all applicable privacy requirements is a separate responsibility.
Frequently Asked Questions
Is Google Analytics free?
Yes. Google Analytics offers a free version that is suitable for many businesses and WordPress websites.
Google also offers Analytics 360 for organisations with more advanced requirements.
You don’t need a paid Google Analytics subscription to use the installation methods covered in this guide.
Do I need a plugin to install Google Analytics on WordPress?
No. You can install the Google tag manually or through an existing compatible integration.
However, using Site Kit is often easier because it handles the connection and can manage tag placement without editing your theme’s files.
How long does Google Analytics take to start working?
Google indicates that data collection may take up to approximately 30 minutes to begin after installation.
You can use the Realtime report to look for recent activity.
Standard reports may take 24 to 48 hours to finish processing.
Can I see Google Analytics inside WordPress?
Yes. Site Kit displays selected analytics metrics directly in your WordPress dashboard.
For more detailed reports and configuration options, you’ll still use the main Google Analytics interface.
Will Google Analytics slow down my website?
Google Analytics requires tracking code to load and execute, so it introduces some additional work in a visitor’s browser.
The actual effect depends on your website and how tracking is implemented.
Avoid installing duplicate tags or unnecessary third-party tracking scripts.
If performance is a concern, test your website rather than assuming the analytics tag is either harmless or responsible for every slowdown.
Can I use Google Analytics with WooCommerce?
Yes. GA4 supports ecommerce measurement, and compatible integrations can help send WooCommerce events to Google Analytics.
However, you should verify the specific events you need.
Installing basic Analytics tracking doesn’t automatically guarantee accurate revenue, checkout or purchase reporting.
Need Help Installing Google Analytics?
Google Analytics can provide useful information about your WordPress website, but the setup needs to be correct before you can rely on the reports.
For most website owners, Google Site Kit offers a straightforward way to connect GA4 without manually editing WordPress theme files.
Once tracking is working, you can begin understanding where visitors come from, which content they use and which interactions matter to your business.
If you’d prefer help with the technical setup, Newt Labs provides one-off WordPress support and website changes.
Tell us about your existing setup and what you need. We can review the request, confirm the appropriate work and quote separately for more involved tracking or integration requirements.

