A reliable analytics setup starts with clean data. When GA4 is installed on WordPress incorrectly, duplicate page_view hits are one of the most common issues—skewing reporting and making user journey analysis unreliable. This guide walks you through installing Google Analytics 4 (GA4) with Google Tag Manager (GTM) while avoiding duplicate pageviews, plus validation steps to confirm that only one, parameter-rich page_view is fired per load.
Why Duplicates Happen
Duplicate pageviews typically occur when more than one integration sends a page_view:
- A Google Tag in GTM with automatic page_view enabled
- Theme- or plugin-embedded gtag.js
- Google Site Kit injecting Analytics
- Other WordPress plugins that silently add GA4
Because WordPress plugins often auto-inject GA4, a GTM-based setup must explicitly disable all other emitters to ensure one source of truth.
Recommended Approach: Single Source of Truth
The cleanest solution is to:
- Use GTM as the only emitter for GA4
- Disable all other GA4 injections
- Set the Google Tag to not auto-send pageviews
- Fire a single, enriched page_view event from GTM
This prevents silent duplicates and ensures parameters like content_type or event_id are consistently applied.
Prerequisites
- WordPress admin access
- GTM container installed site-wide (in theme header or via a lightweight plugin)
- GA4 Measurement ID (G-XXXXXXXXXX)
- Access to GA4 DebugView and Tag Assistant Preview
Step 1 — Remove Other GA4 Emitters
- Disable GA4 snippets from Site Kit, theme settings, or analytics plugins
- Remove any hardcoded gtag.js from templates
- Check that no parallel GA4 tags remain
Step 2 — Configure the Google Tag in GTM
- Create a Google Tag in GTM and paste your Measurement ID
- In settings, set send_page_view = false so the tag doesn’t auto-emit pageviews
- This gives you full control to dispatch a single, parameter-rich page_view event
Step 3 — Fire a Single Custom Pageview
- Create a GA4 Event tag named page_view
- Trigger it on All Pages
- Add parameters such as:
- page_title
- page_location
- content_type or other taxonomy values
- Include a stable event_id for deduplication (useful for Meta Ads and other downstream tools)
Step 4 — Prevent SPA or Enhanced Measurement Conflicts
- If Enhanced Measurement is enabled in GA4, avoid its automatic page_view
- In single-page apps (SPAs), use GTM triggers to fire on route changes instead of relying on GA4’s automatic history tracking
Step 5 — Validate with DebugView & Network Tab
- Use GTM Preview mode and GA4 DebugView to confirm exactly one page_view appears per load
- Open the browser Network tab, filter for collect?, and verify one request per pageview
- For schema checks, refer to Google’s GA4 Setup Guide
Troubleshooting Duplicates
- Still seeing two hits? Check:
- send_page_view = false
- No plugins/themes are injecting GA4 snippets
- If collisions persist, use GA4’s “Ignore duplicate instances of on-page configuration” setting
WordPress Specifics to Check
- Google Site Kit → ensure Analytics module is disabled or GA4 tagging is off
- SEO/marketing plugins → turn off GA4 injections (common in all-in-one tools)
Optional: Enriching Pageviews
- Standardize parameters via a GTM Settings Variable
- For SPAs, use a History Change trigger to fire updated pageviews with route changes
Final QA Checklist
✅ One Google Tag in GTM with send_page_view = false
✅ One GA4 Event tag (page_view) firing on All Pages
✅ No parallel GA4 snippets or Site Kit injections
✅ DebugView shows a single event per load/route
✅ Network tab confirms one collect request
Quick Verification Script (Optional)
Google recommends verifying payloads against GA4 schema expectations. Running a final DebugView pass for key user journeys helps confirm duplicates are fully eliminated before publishing your GTM version.
👉 Need help setting up GA4 on WordPress without duplicates? Contact Metricbyte Consulting for expert implementation.