Gifts

Culture

Reviews

Local Spots

How to Setup Google Analytics with WordPress (2026 Guide)

Google Analytics

★★★★ 4.5
Analytics Data Web Analytics

Google Analytics is the most widely used web analytics platform that tracks website traffic and user behavior. It provides comprehensive…

Full Review

WordPress

Open-source content management system powering over 40% of the web.

All WordPress Tools

Overview

The WordPress and Google Analytics integration adds website analytics tracking to your WordPress site, enabling you to measure traffic, understand visitor behavior, track conversions, and identify your best-performing content. Google Analytics 4 (GA4) is the current version, and several methods are available for adding it to WordPress — from code-free plugins to manual tag implementation.

Once configured, GA4 tracks every page view, user session, and interaction on your WordPress site. You can see where your visitors come from (search engines, social media, direct traffic, referrals), which pages they visit, how long they stay, and what actions they take (form submissions, button clicks, file downloads). For sites with ecommerce or lead generation goals, GA4's conversion tracking shows you exactly which traffic sources and content drive business results.

This integration is essential for any WordPress site. Without analytics, you are making decisions about content, design, and marketing strategy blindly. GA4 provides the data foundation for evidence-based website optimization and marketing investment decisions.

Prerequisites

  • A self-hosted WordPress site (WordPress.org) or a WordPress.com Business plan or higher
  • A Google account to access Google Analytics
  • A GA4 property and web data stream (created at analytics.google.com)
  • Your GA4 Measurement ID (format: G-XXXXXXXXXX)
  • WordPress admin access to install plugins or edit theme files

Step-by-Step Setup

Step 1: Create a GA4 Property

Go to analytics.google.com and sign in. Click Admin (gear icon in the bottom left). Click Create Property. Enter a property name (your website name), select your reporting time zone and currency. Click Next, enter your business information, and click Create. On the data stream setup screen, select Web, enter your WordPress site URL, and give the stream a name. Click Create stream. Copy the Measurement ID displayed on the stream details page.

Step 2: Choose Your Installation Method

You have three main options: Plugin (recommended) — install a WordPress plugin that handles the tracking code automatically; Google Site Kit — Google's official WordPress plugin that connects Analytics, Search Console, and other Google services; or Manual — paste the GA4 tracking code directly into your theme. The plugin method is recommended for most users as it is the easiest to maintain.

Step 3: Install via Plugin (MonsterInsights or Site Kit)

In WordPress, go to Plugins > Add New. Search for "MonsterInsights" (most popular analytics plugin) or "Site Kit by Google" (Google's official plugin). Click Install Now, then Activate. Follow the plugin's setup wizard. MonsterInsights asks for your GA4 Measurement ID or lets you authenticate with your Google account. Site Kit connects via Google OAuth and walks you through linking your GA4 property.

Step 4: Verify the Tracking Code Is Installed

After setup, verify the GA4 tracking code is present on your site. Visit your WordPress site in a browser, right-click, and select View Page Source. Search for your Measurement ID (G-XXXXXXXXXX). You should find it in a Google tag (gtag.js) script in the page header. Also check GA4's Realtime report — visit your site and confirm you appear as an active user.

Step 5: Configure Enhanced Measurement

In GA4, go to Admin > Data Streams, click your web stream, and review Enhanced measurement settings. Enhanced measurement automatically tracks: page views, scrolls (90% scroll depth), outbound clicks, site search, video engagement (for embedded YouTube videos), and file downloads. Toggle on all events that are relevant to your site. Most WordPress sites benefit from having all enhanced measurement events enabled.

Step 6: Set Up Key Events (Conversions)

Identify the key actions you want to track as conversions on your WordPress site. Common conversions include: form submissions, newsletter signups, contact page visits, and button clicks. In GA4, go to Admin > Events (or Key Events in newer versions). You can either mark existing events as conversions or create custom events. For form tracking, many WordPress form plugins (WPForms, Gravity Forms, Contact Form 7) send events to GA4 when forms are submitted.

Step 7: Set Up Google Search Console Integration (Optional)

Link Google Search Console to GA4 for organic search insights. In GA4, go to Admin > Product Links > Search Console Links. Click Link and select your Search Console property (you need to have verified your WordPress site in Search Console first). Once linked, you can see organic search queries, impressions, and click-through rates alongside your GA4 data in the Search Console reports section.

Configuration Options

Analytics plugins offer additional configuration: exclude logged-in administrators from tracking (to keep data clean), enable demographics and interest reports, configure cross-domain tracking if your site spans multiple domains, and set up custom dimensions to track WordPress-specific data like post author, category, and publication date. You can also configure data retention settings in GA4 under Admin > Data Settings > Data Retention (default is 2 months for free GA4; extend to 14 months for longer analysis windows).

What Syncs

DataDirectionFrequency
Page views and sessionsWordPress to GA4Real-time
User interactions (clicks, scrolls, searches)WordPress to GA4Real-time
Conversion eventsWordPress to GA4Real-time
User demographics and technology dataWordPress to GA4Real-time
Traffic source and campaign dataWordPress to GA4Per session

Best Practices

  • Exclude your own visits from tracking — either filter by IP address in GA4 or enable the admin exclusion setting in your analytics plugin
  • Set up at least one conversion event (form submission, newsletter signup) so GA4 can calculate conversion rates by traffic source
  • Extend GA4 data retention to 14 months (under Admin > Data Settings) for year-over-year comparison capabilities
  • Create GA4 audiences based on WordPress content engagement (e.g., "Read 3+ blog posts") and use them for Google Ads remarketing
  • Review the Realtime report after any WordPress theme or plugin changes to confirm tracking is still working

Common Issues and Fixes

No Data in GA4 After Setup

GA4 can take 24-48 hours to populate standard reports (although Realtime works immediately). If Realtime also shows no data, check that the tracking code is actually on your pages by viewing the source code. Common culprits are caching plugins serving pages without the tracking script — clear all caches after installing the analytics plugin.

Tracking Code Appears Twice

If you install GA4 via a plugin and also have the code manually in your theme, events will be double-counted. Use only one installation method. Search your page source for your Measurement ID — if it appears more than once, remove the duplicate from your theme files or deactivate the redundant plugin.

Ad Blocker Impact

Browser ad blockers (like uBlock Origin) block Google Analytics tracking scripts. This means GA4 underreports your actual traffic by 10-30% depending on your audience. This is a known limitation with no simple fix. Use GA4 data for trend analysis and relative comparisons rather than absolute numbers. For critical conversion tracking, implement server-side tracking via Google Tag Manager's server container.

Advanced Configuration

For advanced tracking, use Google Tag Manager (GTM) instead of a direct plugin integration. Install the GTM container code on your WordPress site (via a plugin like "GTM4WP"), then configure all your GA4 tags, triggers, and variables in GTM's web interface. This gives you complete control over event tracking without modifying WordPress code. You can create custom events for specific button clicks, track scroll depth at multiple thresholds, implement ecommerce tracking for WooCommerce, and deploy marketing pixels for Facebook, LinkedIn, and other advertising platforms — all managed centrally through GTM.

Google Analytics Full Review » | All WordPress Tools »