Getting Started

Setting up GA4 on WordPress without the headaches

Learn the best ways to install Google Analytics 4 on WordPress using plugins like Site Kit, GTM Kit, or Google Tag Manager. Step-by-step instructions included.

A
Antoine
January 14, 20266 min read

WordPress makes GA4 setup relatively , if you choose the right method. There are several ways to do it, and the best choice depends on how much control you need.

Let me walk you through your options.

Choose your installation method

MethodBest forComplexity
Site Kit by GoogleBeginners, simple sitesEasy
GTM Kit pluginWooCommerce, e-commerceMedium
Google Tag ManagerFull control, complex trackingAdvanced
Manual codeDevelopers, specific needsAdvanced

If you're not sure, start with Site Kit. You can always move to GTM later.

Method 1: Site Kit by Google (easiest)

Site Kit is Google's official WordPress plugin. It integrates Analytics, Search Console, AdSense, and more in one dashboard.

Step-by-step

  1. Install the plugin

    • Go to Plugins → Add New
    • Search for "Site Kit by Google"
    • Click Install Now, then Activate
  2. Connect your Google account

    • After activation, you'll see a setup wizard
    • Click Sign in with Google
    • Grant the requested permissions
  3. Connect Google Analytics

    • Site Kit will prompt you to connect Analytics
    • If you have an existing GA4 property, select it
    • If not, Site Kit can create one for you
  4. Verify it's working

    • Wait a few minutes
    • Go to Site Kit → Dashboard
    • You should see analytics data starting to appear

What you get with Site Kit

  • Analytics right in your WordPress dashboard
  • Automatic pageview tracking
  • Search Console integration
  • No coding required

Limitations

  • Limited custom event tracking
  • Not ideal for complex setups
  • Less flexibility than GTM

Method 2: GTM Kit plugin (recommended for WooCommerce)

GTM Kit is purpose-built for Google Tag Manager and GA4. It's especially powerful if you're running WooCommerce.

Step-by-step

  1. Install GTM Kit

    • Go to Plugins → Add New
    • Search for "GTM Kit"
    • Click Install Now, then Activate
  2. Get your GTM container ID

  3. Configure GTM Kit

    • Go to Settings → GTM Kit
    • Enter your container ID
    • Enable options based on your needs:
      • WooCommerce integration (if applicable)
      • Contact Form 7 tracking
      • Data layer features
  4. Set up GA4 in GTM

    • In GTM, create a Google Tag with your Measurement ID
    • Set trigger to Initialization - All Pages
    • Publish your container

WooCommerce e-commerce tracking

GTM Kit automatically pushes WooCommerce data to the dataLayer:

EventWhat it tracks
view_itemProduct page views
add_to_cartAdd to cart actions
remove_from_cartCart removals
begin_checkoutCheckout starts
purchaseCompleted purchases

You just need to set up corresponding GA4 Event tags in GTM to send this data.

Method 3: Google Tag Manager (manual)

For full control, install GTM directly without a plugin.

Step-by-step

  1. Create GTM container (if you haven't)

  2. Get the installation code

    • Click on your container
    • Copy both code snippets (head and body)
  3. Add to your theme

    Option A: Edit theme files (not recommended for updates)

    • Add the <head> snippet to header.php
    • Add the <body> snippet right after <body> tag

    Option B: Use a code snippets plugin

    • Install "Code Snippets" or similar plugin
    • Add the head code to run in <head>
    • Add the body code to run in <body>

    Option C: Use your theme's settings

    • Many themes have "header scripts" and "body scripts" sections
    • Paste the code in the appropriate fields
  4. Set up GA4 in GTM

    • Create Google Tag with your Measurement ID
    • Set trigger to Initialization - All Pages
    • Add any custom event tags you need
    • Publish

Why use GTM directly?

  • Maximum flexibility
  • No plugin dependencies
  • Works with any theme
  • Full event tracking control

But requires more technical knowledge.

Method 4: Manual gtag.js installation

If you don't want GTM and don't want a plugin, you can add GA4 code directly.

Step-by-step

  1. Get your GA4 tracking code

    • Go to GA4 → Admin → Data Streams
    • Click your web stream
    • Click View tag instructions
    • Copy the gtag.js code
  2. Add to your site

    <!-- Google tag (gtag.js) -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'G-XXXXXXX');
    </script>
    
  3. Insert into WordPress

    • Use a code snippets plugin
    • Or add to your theme's header via customizer
    • Or edit header.php (not recommended)

When to use this method

  • Simple sites with basic tracking needs
  • When you need to avoid GTM for some reason
  • Quick testing setups

Verifying your installation

Whichever method you use, verify it works:

Quick check: Realtime reports

  1. Go to GA4 → Reports → Realtime
  2. Open your WordPress site in another tab
  3. You should see yourself as an active user

Thorough check: DebugView

  1. Install the GA Debugger extension
  2. Go to GA4 → Admin → DebugView
  3. Navigate your site
  4. Watch for page_view and other events

For more testing methods, see our GA4 testing guide.

Plugin comparison

FeatureSite KitGTM KitManual GTM
Setup difficultyEasyMediumAdvanced
WooCommerce e-commerceLimitedFullFull
Custom eventsLimitedVia GTMFull
Dashboard in WP
FlexibilityLowMediumHigh
Updates/maintenanceGoogle-managedPlugin updatesManual

Common mistakes

Installing multiple tracking methods

Pick one. Don't use Site Kit AND GTM Kit AND manual code. You'll get duplicate data.

Forgetting to exclude internal traffic

Set up internal traffic filters in GA4 after installation:

  1. Go to Admin → Data Streams → [Your Stream] → Configure tag settings
  2. Define internal traffic with your IP
  3. Enable the filter in Data Settings

Not testing before launch

Always verify tracking works in DebugView or Realtime before assuming it's done.

Using outdated plugins

Check that your chosen plugin supports GA4 (not just Universal Analytics). Many older plugins don't.

Next steps

Once GA4 is installed on WordPress:

  1. Configure your key events
  2. Set up essential events
  3. Verify everything works

If you want an easier way to see your WordPress analytics, try Analayer. We connect to your GA4 data and give you insights that actually make sense.

See your analytics clearly

Stop struggling with Google Analytics. Connect your account and get a cleaner, simpler view of your data in seconds.