Almost every WordPress site I audit has Google Analytics installed. Far fewer have it set up in a way that answers useful questions. I regularly find the tracking code loaded twice, inflating every number. Or analytics running, but no conversions tracked, so nobody knows which pages or campaigns bring in enquiries. Or analytics loading before visitors consent, in regions where that’s not allowed.
Google Analytics 4, GA4, replaced Universal Analytics, which stopped processing data in July 2023. GA4 works differently, built around events rather than sessions and pageviews, and many site owners never fully adjusted.
Here’s how I set up GA4 on WordPress sites so the data is accurate, compliant and genuinely useful.
Understand how GA4 works
GA4 tracks everything as events. A page view is an event. A scroll is an event. A form submission, a purchase, a file download: all events. Each event can carry parameters with extra details, like the page URL or the purchase value.
Some events are collected automatically. Enhanced measurement adds more, like scrolls, outbound clicks, site search and file downloads. You can define custom events for anything else.
Events you care most about, like enquiries and purchases, can be marked as key events, which is GA4’s current term for conversions.
Step 1: Create your GA4 property
In Google Analytics, create a property for your site, then a web data stream for your domain. You’ll get a Measurement ID that starts with G-.
While setting up:
- Set the correct time zone and currency.
- Review data retention settings under Admin. The default retention for detailed data may be shorter than you want; you can increase it to the maximum available for your account type.
- Turn on enhanced measurement for the web stream, and review which events it collects.
Step 2: Choose one installation method
There are several ways to add GA4 to WordPress. Pick one, and only one.
Google Site Kit
Google’s official WordPress plugin connects Analytics, Search Console and other Google services, and shows data in the dashboard. It’s simple and reliable for basic setups.
Google Tag Manager
Tag Manager lets you manage GA4 and other marketing tags in one place, with flexible triggers and custom events. It’s my preferred option for sites that need custom event tracking or multiple marketing tags. It requires a bit more setup knowledge.
Analytics plugins
Several WordPress plugins add GA4 with extra features, like WooCommerce ecommerce tracking and form tracking. Convenient, especially for stores.
Manual installation
Adding the Google tag snippet directly to your theme’s head, through a child theme or a custom plugin. Fine for simple sites, but harder to manage as needs grow.
The duplicate tag problem
The most common GA4 problem I find is the tag installed twice: once by a plugin and again in Tag Manager, or by both the theme and a plugin. Duplicate tags double-count page views and events, making every number wrong.
Check for duplicates by viewing your page source and searching for your Measurement ID, or by using Tag Assistant to see which tags fire. You should see the GA4 configuration once per page.
Step 3: Handle consent properly
In regions with strict privacy rules, analytics cookies require consent before they’re set. Your GA4 setup must respect visitors’ choices.
Use a consent management platform
A consent banner should block GA4, or adjust its behaviour, until visitors consent to analytics. Make sure it actually works by testing in a private window: no analytics cookies or requests should appear before you accept, unless you’re using Consent Mode in a way that sends only cookieless pings.
Configure Consent Mode
Google’s Consent Mode lets your consent tool tell Google tags what visitors agreed to. Tags then adjust: when consent is denied, they don’t set cookies. In advanced implementations, they can send cookieless signals that Google uses for modelling, filling gaps in data from visitors who declined.
Since 2024, Google requires Consent Mode for advertisers using measurement and personalisation features for users in the European Economic Area. Most reputable consent plugins support it.
Expect lower reported numbers after implementing consent correctly. That’s not a bug; it reflects visitors who declined tracking.
Step 4: Define what matters
Before adding events, decide what you need to know. For most business sites:
- Which pages and sources bring visitors.
- Which pages and sources produce enquiries or sales.
- How visitors move toward conversion.
That means tracking conversions is far more important than tracking every scroll and click.
Step 5: Track key events
Form submissions
Form submissions are the most important conversion for lead generation sites. Reliable approaches include:
- Thank-you page tracking: redirect to a unique thank-you page after submission and mark visits to it as a key event. Simple and reliable.
- Form plugin events: many form plugins push events to the data layer on successful submission, which Tag Manager can use.
- Custom events from JavaScript when a form is submitted successfully.
Avoid tracking button clicks as conversions. Clicks include failed submissions, such as validation errors.
Phone and email clicks
Track clicks on tel: and mailto: links as events. They indicate intent, especially on mobile. Mark them as key events if they’re important leads for your business.
Bookings and sign-ups
Track completions of booking flows, newsletter sign-ups and account registrations.
Mark key events
In GA4, under Admin, then Events, mark important events as key events. They then appear in conversion reports and can be imported into Google Ads.
Step 6: Ecommerce tracking for WooCommerce
For stores, ecommerce tracking reveals which products, categories and campaigns generate revenue. GA4 uses recommended ecommerce events, such as view_item, add_to_cart, begin_checkout and purchase, with product and value details.
WooCommerce analytics plugins and Tag Manager setups can send these events. Check that:
- Purchase events fire once per order, not on every refresh of the thank-you page.
- Revenue matches WooCommerce totals reasonably closely, allowing for refunds and consent-related gaps.
- Product details, like names, IDs and categories, are passed correctly.
- Currency is set correctly.
Duplicate purchase events are a common problem, especially when both a plugin and a manual setup send them.
Step 7: Exclude internal traffic
Your own visits, and those of your team, distort data, especially on low-traffic sites. In GA4, define internal traffic by IP address under the data stream settings, then activate the internal traffic data filter. Test it in a filter’s testing state before activating.
Also consider filtering developer traffic, such as visits from staging tools.
Step 8: Link other Google tools
- Search Console: links organic search queries to GA4 reports.
- Google Ads: imports key events as conversions and shares audience data, subject to consent.
- BigQuery: for advanced analysis, GA4 can export raw event data.
Step 9: Learn the reports that matter
GA4’s interface can feel overwhelming. Focus on a few areas:
- Traffic acquisition: where visitors come from, by channel and source.
- Pages and screens: which pages get views and engagement.
- Key events: conversions by source, page and campaign.
- Landing pages: which entry pages bring engaged visitors and conversions.
- Explorations: custom reports for deeper analysis, like funnels and paths.
GA4 uses “engaged sessions” rather than bounce rate as its main engagement metric. An engaged session lasts longer than ten seconds, includes a key event or includes at least two page views. Bounce rate in GA4 is simply the percentage of sessions that weren’t engaged.
Step 10: Verify and maintain
After setup:
- Use DebugView in GA4 and Tag Assistant to confirm events fire correctly.
- Submit a test form, make a test purchase and check the events appear with correct parameters.
- Check realtime reports for your own test visits before enabling internal traffic filtering.
Then review periodically. Theme changes, plugin updates and new forms can break tracking. Check key events monthly to make sure numbers look sensible.
Privacy-friendly alternatives
Some businesses prefer analytics tools that don’t use cookies or collect personal data, reducing consent requirements. These tools offer simpler reports and less integration with advertising platforms. They can be a good fit for sites that don’t run paid campaigns and want lightweight, privacy-focused measurement.
Frequently asked questions
Why are my GA4 numbers lower than before?
Possible reasons include consent banners blocking tracking for visitors who decline, ad blockers, differences in how GA4 counts sessions compared with Universal Analytics and fixing previous duplicate tags. Focus on trends and conversions rather than raw totals.
Do I need Google Tag Manager?
Not for basic tracking. Tag Manager is valuable when you need custom events, multiple marketing tags or flexible triggers without editing code.
Why don’t GA4 and WooCommerce revenue match exactly?
Consent, ad blockers, refunds, cancelled orders and tracking errors all cause differences. A small gap is normal; a large one suggests duplicate or missing purchase events.
How long does GA4 keep my data?
Aggregated reports are kept, but detailed event-level data used in explorations is subject to the retention period you set. Increase retention in Admin settings, and consider BigQuery export for long-term raw data.
Final thoughts
GA4 can tell you which marketing works and which pages bring customers, but only if it’s set up carefully. Install it once, handle consent properly, track the conversions that matter to your business, set up ecommerce events correctly for stores, exclude internal traffic and verify everything with debugging tools. Then focus on a handful of reports that guide real decisions. Accurate, focused data beats a dashboard full of numbers nobody trusts.




