How to Add Google Analytics to WooCommerce

Cody Schneider8 min read

Running a successful WooCommerce store is about more than just having great products, it's about understanding how your customers shop. This guide will show you exactly how to add Google Analytics to your WooCommerce site so you can see which products are popular, how users find you, and where they drop off in the buying process.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Why Connect Google Analytics to Your WooCommerce Store?

Your WooCommerce store already provides some basic sales data, but Google Analytics unlocks a far deeper level of insight into customer behavior. Think of it as the difference between knowing what was sold versus knowing why and how it was sold. It’s what helps you move from just having data to having actionable information.

Here’s what you can learn by linking these two powerful tools:

  • Full Customer Journey Tracking: See the exact path visitors take from the moment they land on your site to the final thank you page. You can discover which blog posts or marketing campaigns are driving the most sales.
  • Top Performing Products: Identify which products get the most views, are added to the cart most often, and ultimately convert into sales. You can use this info to feature best-sellers more prominently.
  • Checkout Funnel Analysis: Pinpoint exactly where customers abandon the checkout process. Is it on the shipping page? The payment page? Knowing this allows you to optimize the checkout experience and recover potentially lost sales.
  • Marketing Campaign ROI: Understand which channels - like Google Ads, Facebook, email marketing, or organic search - are bringing you not just traffic, but paying customers. This lets you double down on what’s working and cut spending on what isn't.
  • Audience Insights: Learn about the demographics (age, gender, location) and interests of your buyers, helping you build more accurate customer personas and target your marketing more effectively.

Without this connection, you're essentially operating in the dark. Connecting Google Analytics is the first step toward making truly data-driven decisions to grow your store.

First, Set Up a Google Analytics 4 Property

Before you can connect anything, you need a Google Analytics property to send your WooCommerce data to. If you already have a Google Analytics 4 property set up, you can skip this section and just find your "Measurement ID." If you're new to GA4 or still using the old Universal Analytics, follow these steps.

GA4 is the latest version from Google, and it’s built around events and user interactions, making it perfect for e-commerce tracking.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

How to Create a GA4 Property

  1. Log into your Google Analytics account.
  2. Go to the Admin section (look for the gear icon in the bottom-left corner).
  3. In the Property column, click Create Property.
  4. Give your property a name, like your store's name. Set your reporting time zone and currency.
  5. Click Next and provide some basic information about your business.
  6. Click Create. You'll then be asked to set up a "data stream," which is just a source of data for your property.
  7. Choose Web as the platform.
  8. Enter your website's URL (e.g., yourstore.com) and give the stream a name. Ensure "Enhanced measurement" is turned on - this automatically tracks essential user actions.
  9. Click Create stream.

Once you create the stream, a page will appear with its details. You are looking for a key piece of information called the Measurement ID. It will be in the top right and formatted like G-XXXXXXXXXX. Copy this ID, you’ll need it in the following steps.

How to Connect WooCommerce and Analytics: The Easiest Method (Plugins)

While you can add code manually, the simplest and most reliable way to connect Google Analytics to WooCommerce is by using a WordPress plugin. This method avoids the risk of editing your theme's code directly and makes setup a matter of a few clicks. Two of the best options are Google's own "Site Kit" and the official "WooCommerce Google Analytics" plugin.

For most users, starting with Site Kit is the best approach because it's an all-in-one tool by Google that simplifies connecting various Google services to your WordPress site.

Step by Step: Using the Site Kit by Google Plugin

Site Kit handles the basic authentication and connection process, making it incredibly easy to get your site recognized by Google Analytics.

1. Install and Activate the Plugin

From your WordPress dashboard, navigate to Plugins > Add New. In the search bar, type "Site Kit by Google." Find the official plugin, click Install Now, and then Activate.

2. Run the Setup Wizard

After activation, you'll see a banner prompting you to start the setup process. Click Start Setup.

  • Sign in with the Google account that you used to create your GA4 property.
  • Grant all the requested permissions. Site Kit needs this access to manage services on your behalf.
  • Site Kit will verify site ownership and connect to Google Search Console (another essential tool for SEO).
  • Next, it will prompt you to connect more services. Find Google Analytics and click Connect Service. Site Kit should automatically detect the GA4 property you created earlier. Select it from the dropdown menu and click Configure Analytics.

And that's it for the basic setup! Site Kit will automatically add the Google Analytics tracking code to every page of your site. You will even get a simplified analytics dashboard directly inside WordPress.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Turn on Enhanced Ecommerce Tracking

The basic Site Kit setup tracks traffic, page views, and user behavior, but it doesn't automatically track the most valuable e-commerce data - like product views, add-to-cart events, or purchases. To capture this critical information, you need to enable Enhanced Ecommerce tracking.

This is where the second plugin comes in. The official WooCommerce Google Analytics Integration plugin is purpose-built to send all that rich e-commerce event data from your store into your Google Analytics property.

Step by Step: Using the WooCommerce Google Analytics Plugin

1. Install and Activate

Head back to Plugins > Add New from your WordPress dashboard. Search for "WooCommerce Google Analytics Integration." Install and activate it.

2. Configure the Settings

Navigate to Marketing > Integrations in your WordPress menu. Find the Google Analytics option.

  • Enter your GA4 Measurement ID (the "G-XXXXXXXXXX" code) you copied earlier into the corresponding field.
  • Enable Standard Tracking: Make sure the box for "Use Global Site Tag" is checked. This ensures the foundational tracking code is present.
  • Track E-commerce Events: Scroll down and check the boxes next to the events you want to track. Typically, you should enable all of them:

These settings tell WooCommerce to fire specific events whenever a customer interacts with your products or checkout page. This data flows directly into GA4, giving you a full view of your sales funnel.

Scroll to the bottom and click Save changes.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Confirm That Your Tracking Is Working

After setting everything up, you need to make sure data is actually being collected. Never assume it works! Here are a few ways to verify your setup is correct.

1. Check the GA4 Realtime Report

The easiest check is to see your own activity in real-time.

  • Log into your Google Analytics account.
  • Navigate to Reports > Realtime.
  • In a separate incognito or private browser window, visit your WooCommerce store. Browse a few pages, click on a product, and add it to your cart.
  • Look back at the Realtime report. You should see yourself appear as a user on the map and see page view or event cards populate with your activity. Seeing your visit means the basic tracking tag is working.

2. Use the "DebugView" in Google Analytics

For checking e-commerce events like add_to_cart and purchase, GA4's DebugView is invaluable.

  • In WordPress, install and activate the GTM & GA Debug plugin, or use a similar debugging extension in your browser.
  • With a debug plugin or mode enabled on your site, open your Google Analytics account.
  • Go to Admin > DebugView (under 'Data display').
  • Now, back in your store with debug mode active, perform specific e-commerce actions like adding an item to your cart or completing a test purchase.
  • As you perform these actions, you should see the corresponding events (view_item, add_to_cart, begin_checkout, purchase) appear in the DebugView timeline in real time. This confirms that your e-commerce events are firing and reaching Google.

Note that while realtime data appears instantly, it can take 24-48 hours for data to fully process and appear in the standard E-commerce purchase reports in Google Analytics, so be patient!

Final Thoughts

By connecting WooCommerce to Google Analytics, you’ve installed the most powerful insights engine available for your e-commerce business. Following the plugin method above makes the entire process manageable in under an hour, giving you the critical data needed to understand your store's performance and customer behavior.

Once your data is flowing in, your next challenge becomes turning those endless reports and metrics into clear, actionable answers. At Graphed, we help you solve that by connecting directly to tools like Google Analytics. You can instantly create real-time dashboards and get answers to your most pressing questions — like "Which campaigns had the best ROI this month?" or "Show me my sales funnel from visitor to purchase" — just by using plain English instead of navigating complex report builders.

Related Articles

How to Enable Data Analysis in Excel

Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!