How to Add Google Analytics 4 to WordPress (and Track What Matters)

How to set up Google Analytics 4 in wordpress

To add Google Analytics 4 to WordPress, create a GA4 property and web data stream, then install the tag with Google’s Site Kit plugin, Google Tag Manager, or a header code plugin. Site Kit is the simplest. Tag Manager is best for marketing teams that track forms, calls and campaigns. Whichever you choose, set up key events and test them, or the data will not tell you much. If you also want reports inside WordPress, I compare the WordPress analytics plugins worth using.

The short answer

Google Analytics 4 is the current Google Analytics product. Standard Universal Analytics stopped processing new data on 1 July 2023, with the 360 extension ending on 1 July 2024. To add it to WordPress, create a GA4 property, copy the Measurement ID, and install it with Site Kit by Google, Google Tag Manager or a code plugin. Do not paste code into your theme’s header file, because theme updates can erase it. Then mark your enquiries and sales as key events and check them in the real-time report.

When my team takes over a website, tracking is one of the first things we check, because broken analytics hides every other problem. The most common faults are duplicate tags, forms that are not tracked, and no one sure who owns the GA4 property.

I map the Measurement IDs and installation routes before changing a tag. Sending the same event twice to the same GA4 stream can duplicate it. Sending data to two different properties creates separate reports, which is a different ownership problem. Choose the property the business will use, keep one intended installation route and test the events after the change. A tidy plugin list is not proof of clean analytics.

How do you set up a Google Analytics 4 property?

Set up a GA4 property in your Google Analytics account under Admin, Create, Property. Enter your business details, then create a web data stream with your website URL. Google gives you a Measurement ID that starts with “G-“. You will use that ID to connect WordPress. Review enhanced measurement settings and enable the features you need after checking consent, URL content and event behaviour.

  1. Sign in to Google Analytics with a company Google account, not a personal one.
  2. Go to Admin, then Create, then Property.
  3. Enter the property name, time zone (Australia, if that is your market) and currency.
  4. Create a web data stream with your website URL.
  5. Copy the Measurement ID that starts with “G-“.
  6. Leave enhanced measurement on to track scrolls, outbound clicks, site search and some form interactions.

What is the best way to add GA4 to WordPress?

The best way to add GA4 to WordPress depends on who manages tracking. Site Kit by Google is easiest for small sites. Google Tag Manager is best for marketing teams that need to track forms, calls, campaigns and other tags without a developer. A header code plugin suits a quick, single tag. Avoid editing theme files.

MethodBest forSkill neededWatch out for
Site Kit by GoogleSmall sites, quick setup, GA4 plus Search Console in WordPressLowLess control over custom events
Google Tag ManagerMarketing teams tracking forms, calls and campaignsMediumNeeds someone to own and document the container
Header code plugin (such as WPCode)A single tag, quicklyLowEasy to duplicate tags with other methods
Theme code (child theme or block theme)Developers with version controlHighNever edit a parent theme’s header file directly

Caption: Ways to add Google Analytics 4 to WordPress compared. Plugin and tool links checked 19 October 2026.

Use only one method. Installing the same GA4 tag twice, for example through Site Kit and through Tag Manager, often sends duplicate page views and events. Whether it does depends on how each copy is set up, so check in Tag Assistant rather than guessing.

How do you add GA4 with Site Kit by Google?

Add GA4 with Site Kit by installing the free Site Kit by Google plugin from the WordPress plugin directory, connecting it to your Google account, and choosing your GA4 property. Site Kit places the tag for you and shows key Analytics and Search Console numbers inside WordPress. It suits site owners who want a simple setup without touching code.

  1. In WordPress, go to Plugins, Add New, and search for Site Kit by Google.
  2. Install, activate and start setup.
  3. Sign in with the Google account that owns your Analytics property.
  4. Choose your GA4 property and web data stream.
  5. Check the real-time report in GA4 while you browse your site.

How do you add GA4 with Google Tag Manager?

Add GA4 with Google Tag Manager by installing the Tag Manager container on your site, then creating a Google tag inside Tag Manager with your GA4 Measurement ID, triggered on all pages. Publish the container and confirm data arrives in GA4. Tag Manager then lets you add form, click and call tracking without changing site code.

  1. Create a container at Google Tag Manager for your website.
  2. Install the container code on WordPress using Site Kit’s Tag Manager option, a code plugin, or your theme.
  3. In Tag Manager, add a Google tag with your “G-” Measurement ID.
  4. For the Google tag, use the Initialization trigger for All Pages in Google’s current setup instructions. Configure consent defaults and updates through the appropriate consent integration before publishing.
  5. Use Preview mode to test, then publish.

Set privacy and consent controls before collecting test traffic. Consent mode adjusts tag behaviour; it does not supply a consent banner or determine which permissions your business needs. Basic and advanced implementations transmit different data before consent, so test accept and reject paths rather than assuming every setup sends nothing. Keep personal information out of ordinary event parameters, page URLs and site-search terms: Google’s PII guidance specifically covers URL paths and query parameters. Do not send people’s names, email addresses, personal phone numbers or message contents as ordinary analytics event data.

Which events should you track in GA4?

Mark confirmed outcomes as key events: completed enquiry forms, bookings and purchases. Track intent signals, such as phone taps, email clicks and downloads, as ordinary events. A tap on a phone number is not a call, and a call is not always a lead, so judge those signals against what your CRM or call log says actually happened. GA4 renamed conversions to “key events” in 2024. Enhanced measurement covers basics such as scrolls and outbound clicks, but enquiries usually need their own events, especially if your forms show a message instead of a thank-you page.

ActionHow to track itMark as key event?
Contact or quote form submittedThank-you page view, or a form submission event via Tag ManagerYes
Phone number tappedClick on tel: linksUsually not. It shows intent; confirm real calls with call tracking or your call log
Email link clickedClick on mailto: linksUsually not. It shows intent, not a sent email
Booking madeBooking tool’s integration or confirmation pageYes
Purchase (WooCommerce)GA4 ecommerce events through an ecommerce integrationYes
Brochure or PDF downloadedFile download event (enhanced measurement)Sometimes

Caption: GA4 events most business websites should track.

If your site is not producing enough enquiries, tracking is the first thing to check. My guide to why a WordPress website is not generating leads covers what to look at next.

For a lead event, use a confirmed success signal from the form integration rather than assuming an automatic form_submit event proves delivery. Keep the CRM as the record of the actual enquiry. Expect differences between CRM and analytics totals because of consent, blocking, spam and duplicate handling. Configure retention deliberately: GA4’s user and event retention setting affects retained user/event data used in explorations; it is not a blanket deletion period for all aggregated reports.

How do you see AI assistant traffic in GA4?

You can see visits from AI assistants in GA4 by looking at referral sources such as chatgpt.com, perplexity.ai, gemini.google.com and copilot.microsoft.com. Create a custom channel group with a rule that matches these sources, so AI referrals show as their own channel. The numbers are small today.

Treat that channel as a floor, not a total. Many visits from AI apps arrive without a referrer, and people often copy a link or search your name after reading an answer, so GA4 records those visits as direct or organic. AI referrals are still worth watching as their own channel. My view is that visitors who arrive after an assistant has compared options may be closer to deciding, but that is a hypothesis to check against your own key events, not a rule.

How do you check GA4 is working on WordPress?

Check GA4 in Realtime and Tag Assistant or Tag Manager Preview while browsing a test session. Data can take a few minutes to appear; consent choices, blockers and filters can affect the result. Submit a valid test enquiry, confirm the CRM received it and check the intended event fires once. Also test validation errors, failed delivery and page reloads. A click on a phone link records intent, not a connected call.

  • Look for duplicate page views, which usually mean two tags are installed.
  • Exclude your own office traffic using internal traffic rules.
  • Check your privacy policy mentions analytics, and add consent controls where your audience requires them.
  • Re-test after theme, plugin or form changes. My guide to WordPress management covers who should own these checks.

What to do next

  1. Confirm your business owns the GA4 property and has admin access.
  2. Choose one installation method and remove any duplicates.
  3. List your key events and set each one up.
  4. Test every form and phone link in real time.
  5. If you want a second opinion on your tracking, book a free call with my team, or use my CRO audit checklist to find where visitors drop out.

Frequently asked questions

Is Google Analytics 4 free?

Yes. Google Analytics 4 is free for most websites. Google also sells Google Analytics 360, a paid version for very large organisations that need higher limits and service agreements. Small and medium businesses rarely need it.

Do I need a plugin to add GA4 to WordPress?

No, but a plugin is the safest option for most people. Site Kit by Google or a code plugin installs the tag without editing theme files, so theme updates will not remove it. Developers can add the tag in a child theme or block theme under version control instead.

Why is GA4 not showing data from my WordPress site?

The most common causes are a wrong Measurement ID, the tag not being installed on all pages, a caching or consent tool blocking the tag, or looking at the wrong property. Check the real-time report while you browse, and use Tag Assistant to see whether the tag fires.

What happened to Universal Analytics?

Google stopped processing data in standard Universal Analytics properties on 1 July 2023 and later removed access to the old properties. GA4 is now the only version. If your site still has an old “UA-” code, remove it.

Can I use GA4 with WooCommerce?

Yes. Install GA4 as normal, then add an ecommerce integration so purchases, add-to-cart and checkout steps are sent as GA4 ecommerce events. This lets you see revenue by channel and where buyers drop out of the checkout.

Nirmal Gyanwali

About the author

Nirmal Gyanwali

Founder of WP Creative and PostCliq

I am a Sydney founder who has built on the web since 2005. I sold my first startup, founded WP Creative, which has served 1,200+ businesses, and built PostCliq. Today I build agent-ready websites, test what works in AI search and publish the evidence, including what does not work.

More about me and how I work

Is your website being found, chosen and growing?

Book a free call. You will talk with me or my team at WP Creative about what your website must earn, and get a straight answer on whether it needs a fix, a rebuild or nothing at all.

Book a free call