Recommended Free Tools
The reliable way to add Google Analytics 4 (GA4) to WordPress with Google Tag Manager is to create a GA4 web data stream, place its Google tag ID in a Google tag inside the correct web container, install that container on every WordPress page, test it in Tag Assistant, and publish only after the tag fires. Then confirm visits in Analytics Realtime. Choose one primary installation route—GTM, Site Kit, another analytics plugin, or manual code—because combining them can send duplicate page views.
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
What you are installing
Google Analytics 4 records activity in an Analytics property. Google Tag Manager (GTM) is the delivery layer that places the Google tag and future event or marketing tags on your site. Google describes the Google tag as the component that lets data flow from a website to Google Analytics and other designated destinations.
As an Amazon Associate I earn from qualifying purchases.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteIn this setup, WordPress serves your pages, the GTM web container loads on those pages, and a Google tag in that container sends page-view and configuration data to your GA4 web stream. You can later add events—such as outbound-link clicks, form submissions, or game-download interactions—without editing every page template.
The procedure below uses the current Google tag terminology in Tag Manager. Older instructions may call the configuration a “GA4 Configuration” tag. Use the Google tag option when it is available in your container.
#1 Best Overall
Decide which WordPress installation route fits
Do not install Analytics through every available method. Select one primary route and record where the tag is deployed so a later plugin change does not create a second implementation.
| Route | Setup effort | Control over future events and marketing tags | Debugging visibility | WordPress dashboard convenience | Maintenance and consent considerations |
|---|---|---|---|---|---|
| Google Tag Manager | Moderate | High; tags and triggers are managed centrally | High; Preview and Tag Assistant expose firing decisions | Low to moderate; most work happens in GTM | Requires container governance and a consent workflow |
| Site Kit by Google | Low for a guided connection | Moderate; advanced tag management still belongs in GTM | Moderate | High; Google services are connected from WordPress administration | Can connect Analytics and Tag Manager; consent plugins can block collection until consent |
| Another WordPress analytics plugin | Low when you want a native dashboard | Moderate, depending on the plugin | Low to moderate compared with GTM Preview | High | Check carefully that it does not inject a second Google tag |
| Manual Google tag code | Moderate to high | Low for non-developers; code changes are required | Moderate | Low | Suitable when you control the HTML; the complete tag belongs immediately after <head> on every page |
GTM is the strongest choice for a site that expects additional events, advertising tags, or several people making measured changes. A guided plugin is simpler when the priority is a WordPress dashboard and minimal GTM concepts. Manual code makes sense only when you have a specific reason not to use a CMS integration.
Free tools Windows power users keep installed
One-click scans. No signup required.
Prerequisites and access
Gather these items before opening Tag Manager:
- A Google Analytics account with a GA4 property, or permission to create one.
- A web data stream for the WordPress site.
- A Google Tag Manager account and a web container configured for the site.
- Access to place the container on the WordPress site, either through the theme, a controlled insertion method, or an approved WordPress integration.
- Container access in GTM and an Analytics Editor-or-higher role for the property.
- A way to test the public site without browser extensions or caching rules masking the requests.
Use a staging environment first if your organization has one. Keep production and staging containers or environments clearly labeled; sending staging traffic into the production property makes later reports difficult to interpret.
Create the GA4 property and web data stream
GA4 must exist before the GTM tag can send data. If the property and stream are already present, open the stream and copy its measurement ID.
- Open Google Analytics and go to Admin.
- Create a new property, or select the existing GA4 property that should receive the WordPress data.
- In the property column, open Data streams.
- Select Web and enter the WordPress site URL and stream name. Use the production URL for production data; do not substitute a staging hostname.
- Open the new web stream and view its tag instructions. Copy the measurement ID, which commonly begins with
G-.
The ID identifies the destination stream. It is not the GTM container ID, and substituting one for the other prevents the tag from sending data to the intended property.
Install the GTM container on WordPress
GTM cannot fire until the container itself is present on the pages you want to measure. In Tag Manager, open the web container and use its installation instructions to obtain the two container snippets and their placement requirements. WordPress implementations vary, so use the method your site owner can maintain:
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #2
- If your theme or site framework exposes controlled head and body insertion points, place each GTM snippet in the location specified by Tag Manager and ensure the changes apply to every page template.
- If your team uses a WordPress GTM integration, enter the exact container ID shown for the web container and select the option that loads it site-wide. Confirm that the integration is not also configured to add a separate Analytics tag.
- If a developer manages the theme, give them the official snippets and require a review of both desktop and mobile templates, cached pages, and any checkout or landing-page templates that use a different layout.
After saving, load a public page and use the browser’s source or network tools to confirm that the expected container ID is present. A container that appears only on the home page will produce incomplete Analytics data.
Configure the Google tag in Tag Manager
This is the central configuration that connects the container to the GA4 stream.
- Open the correct GTM account and select the correct Web container.
- In the workspace, select Tags, then New.
- Choose Tag Configuration, select Google Analytics, and choose Google tag.
- Enter the GA4 web stream’s measurement ID in the Tag ID field. Check every character against the ID in Admin > Data streams.
- For Triggering, choose Initialization – All Initialization Events unless you have a documented reason to scope the tag to a different trigger. Initialization makes the Google tag available at the earliest stage of the page lifecycle.
- Name the tag so another administrator can identify its destination and environment, for example
Google tag - GA4 production. - Select Save.
A deliberately scoped trigger can be appropriate for a special environment, but an accidental restriction—such as a trigger limited to one path—will make the implementation appear broken on the rest of the site.
Set up consent before Analytics runs
Consent is an implementation requirement, not a decorative banner. Your legal or privacy owner must decide which consent signals are required for the people and jurisdictions your site serves. Do not treat this guide as a universal legal determination.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Google’s Consent Mode guidance was updated in November 2023 with two additional parameters. Google also advises replacing legacy tags such as ga.js, analytics.js, and conversion.js with gtag.js or Google Tag Manager.
The technical sequence should be:
- Set default consent states before measurement tags run. The default should reflect your organization’s policy for a visitor who has not made a choice.
- Display your consent-management interface through the approved WordPress consent solution.
- When the visitor makes a choice, update the consent state through the consent integration used by your site.
- Verify the signal in Tag Assistant and confirm that Analytics tags behave as intended before publishing.
Site Kit documents integrations in which a consent-management plugin blocks Google Analytics or Google Ads collection until the visitor consents through Google’s Consent Mode API, including an integration with the WordPress Consent API. Whichever tool you use, document the default state, the update event, and the owner responsible for changing the policy.
Test in Preview and Tag Assistant before publishing
Never publish a new container version solely because the tag saved successfully. Preview runs the workspace against a real page while keeping the changes unpublished.
Rank #3
- In GTM, select Preview.
- Let Tag Assistant open, enter the full URL of a public WordPress page, and select Connect.
- In the Tag Assistant session, inspect the page-load or initialization event. Confirm that the expected container ID is loaded.
- Open the tags fired for that event and confirm that the Google tag with the correct measurement ID fired.
- Navigate to another representative page, such as a post, category page, game detail page, or checkout template. Check whether the same container and tag behavior applies.
- Review the event stream for blocked tags, consent-state changes, exceptions, or a second Analytics implementation.
Use a fresh browser session when possible. Ad blockers, privacy extensions, browser developer settings, and cached scripts can hide a legitimate request or create a misleading failure. Test both a normal visitor path and the consent-denied path required by your policy.
Publish the validated container
Publishing moves the workspace changes to the live container. Do it only after Preview shows the intended firing behavior.
- Return to the GTM workspace and select Submit.
- Choose Publish and Create Version.
- Give the version a useful name, such as
GA4 Google tag - production - 2026-10-15, and describe the measurement ID, consent change, or other relevant edits. - Publish the version and confirm that the production container reports the new version.
Version names make rollback and auditing practical. If several people work in the container, include the environment and purpose rather than a vague label such as “update.”
Verify data in Analytics Realtime
After publishing, open the live WordPress site in a separate browser tab and visit a page. In Google Analytics, open the property’s Realtime report and look for your activity. Google states that data collection may take up to 30 minutes to begin; Realtime is the appropriate first report for confirming that the published tag is receiving data.
Use the same browser and page you tested in Tag Assistant, then try a second page. If consent is required, make the permitted choice before expecting measurement data. Realtime confirmation proves that the stream is receiving activity; it does not by itself prove that every custom event, attribution setting, or reporting configuration is correct.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Prevent duplicate page views and conflicting tags
The most common architectural mistake is installing the same Google tag through GTM and a WordPress plugin, Site Kit connection, theme code, or an older manual snippet. Duplicate implementations can send multiple page views for one visit and inflate engagement or conversion counts.
Rank #4
Keep a short deployment record containing:
- The GA4 property and web-stream name.
- The measurement ID and production or staging environment.
- The GTM account, container name, and published version.
- The WordPress method that loads the container.
- Any plugin or Site Kit connection that touches Analytics or Tag Manager.
- The consent tool, default state, update event, and test date.
When adopting a dashboard plugin, first identify whether it injects a Google tag. Either leave the GTM Google tag as the sole page-level implementation or remove the overlapping deployment and document the decision. Do not assume that two tools will automatically deduplicate one another.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.What to do after the base tag works
The base Google tag establishes the stream connection. Add business-specific events in GTM only after page-view collection, consent behavior, and Realtime verification are stable.
Define the event before building it
Write down the user action, the page or element that identifies it, the event name, and any parameters required for reporting. For a video-game site, examples might include a guide download, a trailer interaction, or an outbound link to a community page. Avoid sending the same action from both a plugin and GTM.
Use a narrowly scoped trigger
Keep the Google tag on its initialization trigger, but scope custom event tags to the click, form, or page condition that represents the action. Preview the exact interaction and verify that one event fires once.
Document consent and data minimization
Confirm that an event is allowed under the consent state and that its parameters do not contain unnecessary personal information. Pass only values your analytics and privacy owners have approved.
Troubleshoot an empty Realtime report
An empty report does not identify one single cause. Work through the checks below in order, beginning with the implementation that can be observed directly.
Check the measurement ID
Compare the ID in the GTM Google tag with the ID shown by opening the intended web stream under Admin > Data streams. A typo or a stream from another property sends data somewhere other than the report you are watching.
Check the container and environment
In Tag Assistant, verify the container ID and hostname. Make sure Preview is connected to the same production or staging environment that you later published. A staging container can be valid while the production site still loads an older container.
Check publication state
Preview can show an unpublished workspace change. After leaving Preview, confirm that the version containing the Google tag was submitted and published to the live container.
Check consent defaults and updates
If consent is denied or the consent signal is not updated, the tag may be prevented from collecting. Inspect the consent state in Tag Assistant, test the visitor’s choice path, and compare the behavior with your approved policy.
Check caching and content delivery layers
WordPress caching, a CDN, or an optimization layer can continue serving HTML that lacks the container or an older script. Purge the relevant cache only after recording the current version, then retest a fresh page load.
Check browser extensions
Privacy extensions and ad blockers can suppress Analytics requests or alter Tag Assistant behavior. Repeat the test in a clean browser profile or a permitted test environment.
Check for duplicate or conflicting implementations
Inspect the page and Tag Assistant for a plugin, theme snippet, Site Kit connection, or manual tag in addition to GTM. Remove or disable the overlapping deployment, then test again so you are measuring one known path.
Allow for processing time
Google says collection may take up to 30 minutes to begin. If the tag is firing correctly, the ID and property are correct, consent permits collection, and the live container is published, wait through that stated window before treating a newly created stream as failed.
A maintenance checklist for WordPress owners
- Review the published GTM version after every tag or consent change.
- Keep production and staging container names unmistakable.
- Retest a page template whenever the theme, cache layer, or consent plugin changes.
- Check Realtime after deploying a significant change.
- Audit plugins for Analytics injection before activating a new dashboard or advertising integration.
- Keep the measurement ID, container ID, consent behavior, and deployment owner in your site documentation.
- Remove obsolete legacy tags rather than leaving them alongside the Google tag.
Final decision
For a WordPress site that will grow beyond basic page views, use one GTM web container, place the GA4 web-stream measurement ID in a Google tag triggered on Initialization, and manage future events in that container. Install the container site-wide, validate it with Tag Assistant, publish a named version, and confirm activity in Realtime. If a guided WordPress dashboard matters more than centralized tag control, use Site Kit or another plugin instead—but make that the primary implementation and remove any overlapping Google tag.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




