Open Settings → Google Tag Manager, add your GTM- container ID and choose how GTM4WP should place its code. I'd give one tool responsibility for loading that container, then check the visitor route in Tag Assistant before enabling more data. Installing the plugin supplies the connection to Google Tag Manager; the tags, triggers and consent settings still determine what gets sent.
Choose one owner for the container code
The free GTM4WP plugin by Thomas Geiger places a Google Tag Manager container on WordPress and can add selected page, visitor and integration data to its data layer. Use it when you want that WordPress data available to tags you manage in GTM. A container loading successfully doesn't establish that Analytics received a page view or that a form submission became a lead.
Before installing, identify what already loads your container: Site Kit, a theme setting, a code-snippet plugin or a manual template edit. Check the Analytics collection route too. One container can contain overlapping tags, so removing a duplicate container snippet alone doesn't settle duplicate event collection.
If Site Kit already places your container and you want to keep that arrangement, GTM4WP's Off placement can supply the data layer while leaving container loading to the existing tool. If GTM4WP will load it instead, disable the competing placement through that tool's own setting. Site Kit has a separate Let Site Kit place code on your site control; don't disconnect unrelated services just to change who inserts the container.
Back up the site and record its current tracking settings before changing ownership. The UpdraftPlus backup steps cover a recoverable site copy. Keep the existing GTM configuration under review as well: a WordPress backup and a GTM workspace are different things.
Add the web container in the current settings
GTM4WP 2.1.1 requires WordPress 6.3 or later and PHP 8.0 or later. These are compatibility minima; keep the site on a maintained runtime. Use the stable WordPress.org package. In Plugins → Add New Plugin, search for GTM4WP, confirm the Thomas Geiger listing and select Install Now → Activate.
Use a WordPress administrator account for these settings, and make sure you have the appropriate access to the intended Google Tag Manager account and its Web container. If you're creating one, Google's account and container setup steps distinguish Web from app, AMP and Server containers. Copy the container ID beginning GTM-, rather than a GA4 measurement ID beginning G- or an Ads ID beginning AW-.
- Open Settings → Google Tag Manager. In the settings sidebar, choose Google Tag Manager container, then its General group. Version 2.x uses sections and a container table; older screenshots with one ID field describe the previous interface.
- In Google Tag Manager containers, enter the intended ID in a container row. I'd start with one row so that the first check has one clear target. Multiple containers are supported, but each adds another configuration to inspect.
- For a normal live-container setup, leave Environment gtm_auth and Environment gtm_preview empty. Those fields select a GTM environment when both are supplied. Leave custom domain and path options alone unless you already have a server-side tagging arrangement that needs them.
- Choose the placement below, save the settings and reopen the section to confirm that the intended row and option remain saved.
Choose placement without confusing Off with automatic
The developer's current container settings reference defines these options. The main script goes in the page's head when GTM4WP is loading the container; the placement choice controls its accompanying noscript part, with Off as the exception that removes both.
- Automatically after the opening body tag: use this when the theme calls WordPress's wp_body_open hook. It places the noscript part near the beginning of the body without a template edit.
- Footer of the page: the documented default works without editing the theme. It doesn't support Search Console ownership verification through the Tag Manager container because that method needs the noscript part directly after the opening body tag.
- Manually coded after the opening body tag: this is a developer route for a theme without that hook. Have the maintainer follow the documented template integration rather than pasting a second whole container snippet elsewhere.
- Off: use this only when another method should load the container. In the current version it keeps the data layer available and needs no container ID; it doesn't mean automatic placement.
Keep the default dataLayer name unless an existing implementation needs another. Renaming it also requires a matching change in the GTM container. Leave Load GTM container as early as possible off for the initial check; moving tags earlier can expose dependencies that haven't loaded yet.
Settle consent and data before collecting events
GTM4WP has no visitor consent banner. Its consent tools guide separates the initial consent default, the visitor's later update and integration-specific bridges. Decide which tool sends the default before turning on GTM4WP's Google Consent Mode option. Two tools sending defaults can overwrite each other; leaving the update unconfigured won't reflect the visitor's choice.
Enable only the data layer variables and integration events your tags need. Avoid adding email addresses, IP addresses or other visitor details simply because the plugin offers them. A data layer value makes information available to page scripts; review which tags can read and transmit it.
For a site using full-page caching, review the experimental Cache-safe data layer option before adding visitor-specific fields. It leaves those fields out of cacheable HTML and delivers them later in the browser. That timing changes triggers that depend on login or role data: those values can arrive on gtm4wp.visitorData, after an initial page-view tag would have fired. Don't serve logged-in users an anonymous cached page and expect a later role update to undo an earlier tag.
Verify the container, then the tag
Check a staging or development copy with an appropriate test configuration. The experimental Only output the container on production environments option relies on WP_ENVIRONMENT_TYPE. WordPress reports production when that value isn't configured, so a staging hostname alone doesn't prevent live tracking. Read the environment reported in the setting instead of assuming the copy is excluded.
- Open the intended GTM workspace and click Preview. Google's preview and debug instructions take you to Tag Assistant. Enter the exact page URL, choose Connect, then return to Tag Assistant and choose Continue to inspect the debug interface.
- Confirm that the intended container connects. Check the event sequence, the data available at the relevant event and which tags fired or stayed blocked. Container presence, an available variable and a fired tag are separate checkpoints.
- Perform the page action you're measuring. Check that the intended tag fires for the intended event and destination, then verify receipt in the destination service's own debugging tools. Repeat the route with consent denied and granted where those states apply.
- Check a signed-out visitor view as well as your working session. If User roles to exclude includes your role, GTM4WP leaves out the container for that session and GTM preview can't connect through it. Use a separate signed-out browser session for that check.
If the page breaks only when Tag Assistant adds its debug parameter, Google recommends clearing Include debug signal in the URL and trying the connection again.


Preview lets you inspect an unpublished GTM workspace without deploying it to ordinary visitors. Publish the reviewed container version through the site's normal approval process only after the checks pass. Then repeat the relevant visitor route against the live configuration; a successful preview doesn't prove that the same version is live.
Trace a missing or repeated event
No container: check the saved ID, placement Off, excluded role and production-only setting first. The current plugin writes console notes explaining deliberate exclusions unless those notes are disabled. View page source and search for GTM4WP to locate its marked block. Check cached HTML after changing the settings.
Container present, tag absent: inspect the trigger, required variables and consent state in GTM, plus any tag restrictions configured in GTM4WP. A plugin event in the data layer doesn't create the corresponding Analytics tag for you. If a cache-safe visitor field arrives later, inspect the event where it becomes available.
The same action appears more than intended: inspect both code ownership and tags that collect the same event. Compare GTM with direct Analytics placement from Site Kit or another plugin, and check whether multiple triggers send the same action. Correct the overlapping route rather than adding another event to compensate.
For configuration diagnostics, use Tools → Site Health, including the GTM4WP information and status checks. Keep this first setup focused on a verified route; ecommerce, server-side refunds and complex consent integrations need their own configuration. The WordPress plugin catalog links back to other site tasks.
Setup guide
- Record the current tracking route and back up WordPress. Identify one owner for container placement and review overlapping Analytics tags.
- Install the stable GTM4WP plugin by Thomas Geiger and open Settings → Google Tag Manager.
- Add the intended Web container's GTM- ID in the container section. Leave environment and server-side fields empty unless that setup needs them.
- Choose the appropriate placement, save and confirm it. Use Off for data-layer-only operation when another tool supplies the container.
- Review consent ownership, selected data and any cache-safe timing. Check environment and excluded-role settings before debugging.
- Use GTM Preview and Tag Assistant to verify the container, event, fired tag and destination receipt. Review denied/granted and signed-out routes, then repeat after an authorized container release.
