Gifts

Culture

Reviews

Local Spots

How to Setup Google Analytics with WooCommerce (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

WooCommerce

Open-source e-commerce plugin for WordPress.

All WooCommerce Tools

Overview

The WooCommerce and Google Analytics integration enables ecommerce tracking for your WordPress store, giving you detailed insights into product performance, shopping behavior, checkout funnel drop-off, and revenue attribution by traffic source. Google Analytics 4 (GA4) is the current version, and WooCommerce supports it through official and third-party plugins that send enhanced ecommerce events automatically.

Once configured, Google Analytics tracks the entire customer journey: which products visitors view, what they add to cart, where they drop off in checkout, and what they ultimately purchase. You can see which marketing channels drive the most revenue, which products have the highest conversion rates, and what your average order value is across different customer segments. This data is essential for making informed decisions about marketing spend and store optimization.

The integration uses GA4's enhanced ecommerce measurement, which sends structured event data for product impressions, product clicks, add-to-cart actions, checkout steps, purchases, and refunds. This is far more detailed than basic page view tracking and is critical for any WooCommerce store serious about data-driven growth.

Prerequisites

  • A self-hosted WordPress site with WooCommerce installed and active
  • A Google Analytics 4 property (create one at analytics.google.com if you do not have one)
  • Your GA4 Measurement ID (format: G-XXXXXXXXXX), found in GA4 under Admin > Data Streams > Web
  • WordPress admin access to install and configure plugins

Step-by-Step Setup

Step 1: Create a GA4 Property (If Needed)

Go to analytics.google.com and sign in. Click Admin (gear icon), then click Create Property. Enter your property name, select your time zone and currency, and click Next. Choose your business category and size, then click Create. Set up a Web data stream by entering your store URL and stream name. Copy the Measurement ID (G-XXXXXXXXXX) — you will need this for the plugin configuration.

Step 2: Install a WooCommerce Google Analytics Plugin

In WordPress, go to Plugins > Add New. The recommended options are: the official Google Analytics for WooCommerce plugin (by WooCommerce, free), or MonsterInsights (freemium, more user-friendly), or GTM4WP (if you prefer Google Tag Manager). Search for your chosen plugin, click Install Now, then Activate.

Step 3: Configure the Plugin with Your GA4 Measurement ID

If using the official WooCommerce plugin: go to WooCommerce > Settings > Integration > Google Analytics. Paste your GA4 Measurement ID in the designated field. If using MonsterInsights: go to Insights > Settings and follow the setup wizard to connect your Google Analytics account via OAuth authentication.

Step 4: Enable Enhanced Ecommerce Tracking

In the plugin settings, enable Enhanced Ecommerce tracking (sometimes labeled "ecommerce events" or "detailed ecommerce tracking"). This enables the following GA4 events: view_item, add_to_cart, begin_checkout, add_payment_info, add_shipping_info, purchase, and refund. Make sure all relevant event types are toggled on.

Step 5: Enable the GA4 Ecommerce Reports

In Google Analytics 4, go to Reports > Monetization. If you do not see the Monetization reports, click Library at the bottom of the left navigation, find Monetization, and click the three-dot menu to publish the collection. The key reports are: Ecommerce purchases (product performance), Purchase journey (funnel visualization), and Checkout journey (step-by-step checkout analysis).

Step 6: Verify Tracking Is Working

Use GA4's Realtime report to verify events are firing. Open your store in a browser, view a product, add it to cart, and begin checkout. In GA4's Realtime report, you should see the corresponding events (view_item, add_to_cart, begin_checkout) appear within seconds. Also use the DebugView in GA4 (under Admin > DebugView) for more detailed event inspection.

Step 7: Set Up Conversions

In GA4, go to Admin > Events and find the purchase event. Click the toggle to mark it as a conversion (in newer GA4 versions, this is under Admin > Key Events). This ensures purchases are tracked as key conversion events and appear in attribution reports, audience reports, and advertising integrations.

Configuration Options

Most WooCommerce GA4 plugins let you configure: whether to track logged-in user IDs (useful for cross-device tracking), whether to exclude admin and shop manager visits from tracking, which product attributes to send as custom dimensions (brand, category, SKU), and whether to track refund events. You can also configure content grouping to categorize pages by type (product pages, category pages, checkout, blog) for cleaner reporting.

What Syncs

DataDirectionFrequency
Product view eventsWooCommerce to GA4Real-time
Add-to-cart eventsWooCommerce to GA4Real-time
Checkout step eventsWooCommerce to GA4Real-time
Purchase events (with revenue)WooCommerce to GA4Real-time
Refund eventsWooCommerce to GA4On refund processing
Product data (name, category, price)WooCommerce to GA4Per event

Best Practices

  • Always use DebugView to verify events are firing correctly after setup — incorrect tracking can lead to months of bad data before you notice
  • Exclude your own IP address and admin users from tracking to keep data clean (configure this in the plugin settings or GA4's data filters)
  • Set up GA4 audiences based on ecommerce behavior (e.g., "added to cart but did not purchase in 7 days") and use them for Google Ads remarketing
  • Create custom explorations in GA4 to analyze checkout funnel drop-off by device type, traffic source, and customer segment
  • Connect GA4 to Google Ads and import the purchase conversion for automated bidding optimization

Common Issues and Fixes

Purchase Events Not Recording

The purchase event fires on the WooCommerce "thank you" page. If customers are redirected to a payment gateway (like PayPal) and do not return to the thank you page, the purchase event will not fire. Configure your payment gateway to return customers to your site after payment. Also check for caching plugins that might serve a cached thank you page without the tracking code.

Duplicate Transactions

If customers refresh the thank you page, the purchase event can fire again. Most WooCommerce GA4 plugins include duplicate transaction prevention — verify this is enabled in the plugin settings. The plugin should store the order ID and skip re-firing for already-tracked orders.

Revenue Numbers Do Not Match WooCommerce Reports

Slight discrepancies are normal due to timing differences, blocked tracking scripts (ad blockers), and refund handling. GA4 may underreport revenue by 5-15% compared to WooCommerce's actual orders because some visitors block JavaScript tracking. Use WooCommerce as the source of truth for financial reporting and GA4 for behavioral and attribution analysis.

Advanced Configuration

For the most flexible setup, use Google Tag Manager (GTM) with the GTM4WP plugin. This approach pushes WooCommerce ecommerce data to the GTM data layer, where you can configure GA4 tags with custom event parameters, send data to multiple analytics platforms simultaneously, and implement server-side tagging for more reliable tracking. Server-side GTM (using a server container) can also help capture purchase events even when client-side JavaScript is blocked by ad blockers.

Google Analytics Full Review » | All WooCommerce Tools »