How to Set Up Google Analytics 4 on WooCommerce (Step-by-Step)
Dec 18, 2025

Setting up GA4 on your WooCommerce store isn't optional anymore. It's the foundation for understanding what drives revenue, where users drop off, and which products actually convert. If you're still relying on gut feelings or incomplete data to make business decisions, you're leaving money on the table. The problem? Most WooCommerce stores have broken tracking or rely on plugins that track surface-level metrics without capturing the full customer journey. This guide walks you through a complete GA4 setup in WooCommerce, from creating your property to validating purchase accuracy. By the end, you'll have clean, reliable data flowing into GA4 so you can make confident, data-backed decisions that actually move the needle on growth.
Before You Start: What You Need Ready
Before jumping into the GA4 setup in WooCommerce, make sure you have admin access to three critical platforms: your Google Analytics account, Google Tag Manager account, and WordPress admin panel. You'll need to create accounts if you don't already have them. Also, verify that your WooCommerce store is live and processing transactions. Testing with a staging site is fine initially, but final validation must happen in your production environment. Having these prerequisites sorted will make the setup process seamless and prevent unnecessary troubleshooting later.
Step 1: Create a GA4 Property & Web Data Stream
Create GA4 Property
Log into your Google Analytics account and navigate to Admin (bottom-left gear icon). Under the Property column, click "Create Property." Enter your property name (typically your store name), select your reporting time zone, and currency. Choose your industry category and business size. This information helps GA4 tailor its default reports to your needs. Click "Next" and complete the business objectives questions. While optional, these selections customize your GA4 interface with relevant reports right from the start.
Create Web Data Stream
After creating your property, you'll be prompted to set up a data stream. Select "Web" as your platform type. Enter your website URL (choose https:// from the dropdown if your site uses SSL, which most modern WooCommerce stores do) and provide a stream name. Enable "Enhanced measurement" to automatically track scrolls, outbound clicks, site search, video engagement, and file downloads. This gives you valuable behavioral data without additional configuration. Click "Create stream" and you'll see your Measurement ID (starts with G-XXXXXXXXXX). Copy this ID as you'll need it in the next steps. This data stream is what connects your WooCommerce store to your GA4 property.
Step 2: Install Google Tag Manager on WooCommerce
Why GTM Is the Recommended Method
Google Tag Manager is the gold standard for implementing GA4 setup in WooCommerce stores. Unlike direct code implementation or basic plugins, GTM gives you complete control over your tracking without touching code every time you need to make changes. You can add, modify, or remove tracking tags through a visual interface. More importantly, GTM lets you implement advanced ecommerce tracking with custom events, enhanced conversion tracking, and seamless integration with other marketing tools. For D2C brands managing multiple tracking pixels (Facebook, TikTok, Google Ads), GTM becomes essential for maintaining data accuracy and preventing tracking conflicts.
How to Add GTM to WooCommerce
First, create a Google Tag Manager account at tagmanager.google.com if you haven't already. Create a container for your website (Web platform). You'll receive a container ID starting with GTM-XXXXXXX. Copy this ID. Now, in your WordPress dashboard, navigate to Plugins > Add New and search for "Google Tag Manager for WordPress" (GTM4WP by Thomas Geiger). Install and activate this plugin. Go to Settings > Google Tag Manager and paste your container ID in the "Google Tag Manager ID" field. Set "Container code placement" to "ON" (unless you've manually added GTM code already, in which case keep it OFF to avoid duplicate tracking). Save the changes. GTM4WP can push WooCommerce ecommerce data to the data layer, which you can then map to GA4 events via GTM tags and triggers. Important note: always validate your tracking after plugin or theme updates, as changes to your checkout flow or theme code can sometimes break data layer pushes.
Step 3: Add GA4 Configuration Tag via GTM
GA4 Configuration Setup
Open your Google Tag Manager container. Navigate to Tags and click "New." Name your tag "GA4 Config - All Pages" or something similar. For tag configuration, select "Google tag" (this replaced the old "GA4 Configuration" tag and existing tags were auto-upgraded). Enter your Measurement ID (the G-XXXXXXXXXX from Step 1). Under "Configuration Settings," you can add custom parameters if needed, but for basic setup, leave this empty. For triggering, select "All Pages" as the trigger so GA4 fires on every page view. Click "Save." This Google tag establishes the connection between your WooCommerce store and GA4 property. Without this foundational tag, none of your ecommerce events will send data to GA4.
Verify in DebugView
Before publishing your GTM container, use Preview mode to test your setup. Click "Preview" in GTM and enter your WooCommerce store URL. A new tab opens with your site connected to GTM's debug console. Navigate through your store, add products to cart, and complete a test purchase. In GTM's preview panel, verify that your GA4 Config tag fires on all pages. Now, open your GA4 property and navigate to Admin > DebugView (under Property column). You should see your session appear in real-time, showing page views and any automatic events. If you don't see data in DebugView, check that your Measurement ID is correct and your browser doesn't have ad blockers preventing GA4. Once verified, return to GTM and click "Submit" to publish your container live.
Step 4: Set Up GA4 Ecommerce Events for WooCommerce
Essential Ecommerce Events to Track
The most critical ecommerce events for any WooCommerce store are view_item (product page views), add_to_cart, begin_checkout, and purchase. These four events map the complete customer journey from product discovery to transaction completion. Beyond these core events, consider tracking view_cart, remove_from_cart, view_item_list (category/collection pages), and select_item (product clicks). Each event provides granular insights into user behavior. For example, high view_item with low add_to_cart indicates product page optimization issues. High add_to_cart with low begin_checkout suggests cart page friction. Understanding these metrics helps you identify exactly where users drop off so you can fix funnel leaks systematically.
Event Parameters You Must Validate
Every ecommerce event must pass specific parameters to GA4 for accurate reporting. For purchase events, validate that transaction_id, value, currency, and items array are present. The items array should include item_id, item_name, price, and quantity for each product. Check that tax and shipping values are captured separately if you want to analyze these metrics. Use GTM's preview mode and examine the data layer to confirm these parameters exist. Missing or incorrect parameters lead to broken reports, inaccurate revenue attribution, and wasted ad spend. Take time to validate each event's parameters before considering your GA4 ecommerce tracking complete. Proper parameter structure is what transforms raw event data into actionable business intelligence.
Plugin vs Custom GTM Setup
You have two main approaches for implementing ecommerce tracking: using a specialized plugin or building custom GTM tags. The GTM4WP plugin (free version) can push basic ecommerce data to your data layer, including view_item, add_to_cart, and purchase events. However, you'll still need to create corresponding GTM tags and triggers to send this data to GA4 in the correct event format. The plugin doesn't automatically guarantee GA4's recommended event schema unless properly configured and validated. This approach works well for most WooCommerce stores and requires minimal technical expertise. If you need advanced tracking (enhanced purchase attribution, custom product dimensions, cross-domain tracking), you'll need either the GTM4WP Pro version or custom GTM implementation. Custom GTM setups give you complete flexibility but require understanding data layer structure and GA4 event schemas. For most stores, starting with GTM4WP and upgrading to custom tracking later as needs grow is the pragmatic approach.
Step 5: Configure Conversions & Attribution
Mark Key Events as Conversions
In GA4, not all events are marked as conversions by default. Navigate to Admin > Events in your GA4 property. Find your "purchase" event and toggle "Mark as conversion" (also referred to as key events in GA4's interface) to ON. This is critical as it allows GA4 to track and attribute conversions correctly in reports and advertising platforms. Beyond purchases, consider marking other micro-conversions as key events: add_to_cart (to measure product interest), begin_checkout (to track checkout initiation), or custom events like "newsletter_signup" or "contact_form_submit." Each marked conversion gives you additional attribution data points. Remember, Google Ads and other advertising platforms use these conversion events for campaign optimization. Without properly marked conversions, your ad algorithms won't optimize effectively, leading to wasted budget and poor ROAS.
Attribution Settings
GA4's default attribution model is "data-driven," which uses machine learning to assign conversion credit across touchpoints. For most WooCommerce stores, this is ideal as it accounts for complex customer journeys. However, you can customize attribution models under Admin > Attribution Settings. Review the "Lookback window" settings: the default is 30 days for click-through conversions and 1 day for view-through. Adjust these based on your typical sales cycle. If you sell high-consideration products (furniture, electronics), extend the lookback window. For impulse purchases (fashion, consumables), shorter windows work better. Understanding your attribution settings ensures accurate data for marketing performance analysis and budget allocation decisions.
Step 6: Validate Purchase Accuracy
Cross-Check Revenue
After a week of collecting data, compare GA4's reported revenue against your WooCommerce sales reports. Navigate to Reports > Monetization > Ecommerce purchases in GA4. Compare the total revenue, transaction count, and average order value against WooCommerce's Analytics dashboard. A small variance between the two is common due to factors like refunds, consent or ad blocker interference, attribution timing differences, and timezone settings. However, large gaps usually indicate missing or duplicated purchase events. If revenue is significantly lower in GA4, some purchase events aren't firing. If it's higher, you might have duplicate tracking implementations. Don't skip this validation step as broken analytics cost real money through bad decisions and wasted ad spend.
Check Transaction Integrity
Beyond total revenue, validate individual transaction details. In GA4, go to Explore and create a new exploration. Use "Item name" and "Item revenue" as dimensions and metrics. Verify that product names match your WooCommerce catalog and prices are correct. Check that transaction IDs aren't duplicating (each should be unique). Review a few recent orders in WooCommerce and find the corresponding transactions in GA4's DebugView or real-time reports. Confirm all product parameters, quantities, and order values match exactly. This granular validation catches subtle issues like incorrect currency codes, missing product categories, or problems with variable products. Establishing this audit routine early ensures your data stays clean as your store scales.
Step 7: Common GA4 WooCommerce Tracking Mistakes
The most frequent mistake is implementing multiple tracking methods simultaneously. Using both a GA4 plugin and GTM, or having hardcoded GA4 alongside a plugin, causes duplicate events and inflated metrics. Choose one method and stick with it. Second, many stores forget to exclude internal traffic, leading to polluted data from employees testing the site. Set up a data filter in GA4 to exclude your office IP address. Third, failing to test purchase events thoroughly before going live results in broken conversion tracking that goes unnoticed for weeks. Always complete test transactions in a staging environment and validate in DebugView before launching. Fourth, not documenting your tracking setup makes maintenance impossible when team members change. Create a simple tracking documentation outlining which events fire where and what parameters they include. Finally, implementing tracking but never using the data is the biggest waste. Schedule weekly data review sessions to actually analyze the insights you're collecting.
A Simple GA4 WooCommerce Setup Checklist (Copy-Paste)
Use this checklist to ensure you haven't missed any critical steps:
GA4 property created with correct timezone and currency
Web data stream created with Enhanced Measurement enabled
GTM container created and GTM4WP plugin installed
GA4 Configuration tag created in GTM and firing on all pages
Purchase event validated in DebugView with correct parameters
All core ecommerce events (view_item, add_to_cart, begin_checkout, purchase) firing correctly
Purchase event marked as conversion in GA4
Revenue and transaction count validated against WooCommerce reports
Internal traffic filtered out in GA4 settings
Documentation created for tracking setup
Team trained on using GA4 reports for decision-making
Run through this checklist quarterly to maintain tracking integrity as your store evolves. If you're running a Shopify store instead, check out our Shopify GA4 setup guide for platform-specific instructions.
Final Thoughts: Clean GA4 Setup Enables Better Growth Decisions
A properly configured GA4 setup in WooCommerce transforms how you run your business. Instead of guessing which marketing channels drive revenue, you'll know with certainty. Instead of wondering why checkout conversion dropped, you'll have the data to pinpoint the exact step causing friction. Clean analytics shifts you from reactive firefighting to proactive optimization. The setup process requires attention to detail and thorough validation, but the payoff compounds over time. Every business decision becomes data-informed: which products to promote, where to allocate ad budget, what site changes to prioritize. If this setup feels overwhelming or you want expert eyes on your implementation, consider a professional GA4 audit to ensure nothing falls through the cracks. Your future self, making confident decisions with reliable data, will thank you for investing the time to get this right.
Setting up GA4 on your WooCommerce store isn't optional anymore. It's the foundation for understanding what drives revenue, where users drop off, and which products actually convert. If you're still relying on gut feelings or incomplete data to make business decisions, you're leaving money on the table. The problem? Most WooCommerce stores have broken tracking or rely on plugins that track surface-level metrics without capturing the full customer journey. This guide walks you through a complete GA4 setup in WooCommerce, from creating your property to validating purchase accuracy. By the end, you'll have clean, reliable data flowing into GA4 so you can make confident, data-backed decisions that actually move the needle on growth.
Before You Start: What You Need Ready
Before jumping into the GA4 setup in WooCommerce, make sure you have admin access to three critical platforms: your Google Analytics account, Google Tag Manager account, and WordPress admin panel. You'll need to create accounts if you don't already have them. Also, verify that your WooCommerce store is live and processing transactions. Testing with a staging site is fine initially, but final validation must happen in your production environment. Having these prerequisites sorted will make the setup process seamless and prevent unnecessary troubleshooting later.
Step 1: Create a GA4 Property & Web Data Stream
Create GA4 Property
Log into your Google Analytics account and navigate to Admin (bottom-left gear icon). Under the Property column, click "Create Property." Enter your property name (typically your store name), select your reporting time zone, and currency. Choose your industry category and business size. This information helps GA4 tailor its default reports to your needs. Click "Next" and complete the business objectives questions. While optional, these selections customize your GA4 interface with relevant reports right from the start.
Create Web Data Stream
After creating your property, you'll be prompted to set up a data stream. Select "Web" as your platform type. Enter your website URL (choose https:// from the dropdown if your site uses SSL, which most modern WooCommerce stores do) and provide a stream name. Enable "Enhanced measurement" to automatically track scrolls, outbound clicks, site search, video engagement, and file downloads. This gives you valuable behavioral data without additional configuration. Click "Create stream" and you'll see your Measurement ID (starts with G-XXXXXXXXXX). Copy this ID as you'll need it in the next steps. This data stream is what connects your WooCommerce store to your GA4 property.
Step 2: Install Google Tag Manager on WooCommerce
Why GTM Is the Recommended Method
Google Tag Manager is the gold standard for implementing GA4 setup in WooCommerce stores. Unlike direct code implementation or basic plugins, GTM gives you complete control over your tracking without touching code every time you need to make changes. You can add, modify, or remove tracking tags through a visual interface. More importantly, GTM lets you implement advanced ecommerce tracking with custom events, enhanced conversion tracking, and seamless integration with other marketing tools. For D2C brands managing multiple tracking pixels (Facebook, TikTok, Google Ads), GTM becomes essential for maintaining data accuracy and preventing tracking conflicts.
How to Add GTM to WooCommerce
First, create a Google Tag Manager account at tagmanager.google.com if you haven't already. Create a container for your website (Web platform). You'll receive a container ID starting with GTM-XXXXXXX. Copy this ID. Now, in your WordPress dashboard, navigate to Plugins > Add New and search for "Google Tag Manager for WordPress" (GTM4WP by Thomas Geiger). Install and activate this plugin. Go to Settings > Google Tag Manager and paste your container ID in the "Google Tag Manager ID" field. Set "Container code placement" to "ON" (unless you've manually added GTM code already, in which case keep it OFF to avoid duplicate tracking). Save the changes. GTM4WP can push WooCommerce ecommerce data to the data layer, which you can then map to GA4 events via GTM tags and triggers. Important note: always validate your tracking after plugin or theme updates, as changes to your checkout flow or theme code can sometimes break data layer pushes.
Step 3: Add GA4 Configuration Tag via GTM
GA4 Configuration Setup
Open your Google Tag Manager container. Navigate to Tags and click "New." Name your tag "GA4 Config - All Pages" or something similar. For tag configuration, select "Google tag" (this replaced the old "GA4 Configuration" tag and existing tags were auto-upgraded). Enter your Measurement ID (the G-XXXXXXXXXX from Step 1). Under "Configuration Settings," you can add custom parameters if needed, but for basic setup, leave this empty. For triggering, select "All Pages" as the trigger so GA4 fires on every page view. Click "Save." This Google tag establishes the connection between your WooCommerce store and GA4 property. Without this foundational tag, none of your ecommerce events will send data to GA4.
Verify in DebugView
Before publishing your GTM container, use Preview mode to test your setup. Click "Preview" in GTM and enter your WooCommerce store URL. A new tab opens with your site connected to GTM's debug console. Navigate through your store, add products to cart, and complete a test purchase. In GTM's preview panel, verify that your GA4 Config tag fires on all pages. Now, open your GA4 property and navigate to Admin > DebugView (under Property column). You should see your session appear in real-time, showing page views and any automatic events. If you don't see data in DebugView, check that your Measurement ID is correct and your browser doesn't have ad blockers preventing GA4. Once verified, return to GTM and click "Submit" to publish your container live.
Step 4: Set Up GA4 Ecommerce Events for WooCommerce
Essential Ecommerce Events to Track
The most critical ecommerce events for any WooCommerce store are view_item (product page views), add_to_cart, begin_checkout, and purchase. These four events map the complete customer journey from product discovery to transaction completion. Beyond these core events, consider tracking view_cart, remove_from_cart, view_item_list (category/collection pages), and select_item (product clicks). Each event provides granular insights into user behavior. For example, high view_item with low add_to_cart indicates product page optimization issues. High add_to_cart with low begin_checkout suggests cart page friction. Understanding these metrics helps you identify exactly where users drop off so you can fix funnel leaks systematically.
Event Parameters You Must Validate
Every ecommerce event must pass specific parameters to GA4 for accurate reporting. For purchase events, validate that transaction_id, value, currency, and items array are present. The items array should include item_id, item_name, price, and quantity for each product. Check that tax and shipping values are captured separately if you want to analyze these metrics. Use GTM's preview mode and examine the data layer to confirm these parameters exist. Missing or incorrect parameters lead to broken reports, inaccurate revenue attribution, and wasted ad spend. Take time to validate each event's parameters before considering your GA4 ecommerce tracking complete. Proper parameter structure is what transforms raw event data into actionable business intelligence.
Plugin vs Custom GTM Setup
You have two main approaches for implementing ecommerce tracking: using a specialized plugin or building custom GTM tags. The GTM4WP plugin (free version) can push basic ecommerce data to your data layer, including view_item, add_to_cart, and purchase events. However, you'll still need to create corresponding GTM tags and triggers to send this data to GA4 in the correct event format. The plugin doesn't automatically guarantee GA4's recommended event schema unless properly configured and validated. This approach works well for most WooCommerce stores and requires minimal technical expertise. If you need advanced tracking (enhanced purchase attribution, custom product dimensions, cross-domain tracking), you'll need either the GTM4WP Pro version or custom GTM implementation. Custom GTM setups give you complete flexibility but require understanding data layer structure and GA4 event schemas. For most stores, starting with GTM4WP and upgrading to custom tracking later as needs grow is the pragmatic approach.
Step 5: Configure Conversions & Attribution
Mark Key Events as Conversions
In GA4, not all events are marked as conversions by default. Navigate to Admin > Events in your GA4 property. Find your "purchase" event and toggle "Mark as conversion" (also referred to as key events in GA4's interface) to ON. This is critical as it allows GA4 to track and attribute conversions correctly in reports and advertising platforms. Beyond purchases, consider marking other micro-conversions as key events: add_to_cart (to measure product interest), begin_checkout (to track checkout initiation), or custom events like "newsletter_signup" or "contact_form_submit." Each marked conversion gives you additional attribution data points. Remember, Google Ads and other advertising platforms use these conversion events for campaign optimization. Without properly marked conversions, your ad algorithms won't optimize effectively, leading to wasted budget and poor ROAS.
Attribution Settings
GA4's default attribution model is "data-driven," which uses machine learning to assign conversion credit across touchpoints. For most WooCommerce stores, this is ideal as it accounts for complex customer journeys. However, you can customize attribution models under Admin > Attribution Settings. Review the "Lookback window" settings: the default is 30 days for click-through conversions and 1 day for view-through. Adjust these based on your typical sales cycle. If you sell high-consideration products (furniture, electronics), extend the lookback window. For impulse purchases (fashion, consumables), shorter windows work better. Understanding your attribution settings ensures accurate data for marketing performance analysis and budget allocation decisions.
Step 6: Validate Purchase Accuracy
Cross-Check Revenue
After a week of collecting data, compare GA4's reported revenue against your WooCommerce sales reports. Navigate to Reports > Monetization > Ecommerce purchases in GA4. Compare the total revenue, transaction count, and average order value against WooCommerce's Analytics dashboard. A small variance between the two is common due to factors like refunds, consent or ad blocker interference, attribution timing differences, and timezone settings. However, large gaps usually indicate missing or duplicated purchase events. If revenue is significantly lower in GA4, some purchase events aren't firing. If it's higher, you might have duplicate tracking implementations. Don't skip this validation step as broken analytics cost real money through bad decisions and wasted ad spend.
Check Transaction Integrity
Beyond total revenue, validate individual transaction details. In GA4, go to Explore and create a new exploration. Use "Item name" and "Item revenue" as dimensions and metrics. Verify that product names match your WooCommerce catalog and prices are correct. Check that transaction IDs aren't duplicating (each should be unique). Review a few recent orders in WooCommerce and find the corresponding transactions in GA4's DebugView or real-time reports. Confirm all product parameters, quantities, and order values match exactly. This granular validation catches subtle issues like incorrect currency codes, missing product categories, or problems with variable products. Establishing this audit routine early ensures your data stays clean as your store scales.
Step 7: Common GA4 WooCommerce Tracking Mistakes
The most frequent mistake is implementing multiple tracking methods simultaneously. Using both a GA4 plugin and GTM, or having hardcoded GA4 alongside a plugin, causes duplicate events and inflated metrics. Choose one method and stick with it. Second, many stores forget to exclude internal traffic, leading to polluted data from employees testing the site. Set up a data filter in GA4 to exclude your office IP address. Third, failing to test purchase events thoroughly before going live results in broken conversion tracking that goes unnoticed for weeks. Always complete test transactions in a staging environment and validate in DebugView before launching. Fourth, not documenting your tracking setup makes maintenance impossible when team members change. Create a simple tracking documentation outlining which events fire where and what parameters they include. Finally, implementing tracking but never using the data is the biggest waste. Schedule weekly data review sessions to actually analyze the insights you're collecting.
A Simple GA4 WooCommerce Setup Checklist (Copy-Paste)
Use this checklist to ensure you haven't missed any critical steps:
GA4 property created with correct timezone and currency
Web data stream created with Enhanced Measurement enabled
GTM container created and GTM4WP plugin installed
GA4 Configuration tag created in GTM and firing on all pages
Purchase event validated in DebugView with correct parameters
All core ecommerce events (view_item, add_to_cart, begin_checkout, purchase) firing correctly
Purchase event marked as conversion in GA4
Revenue and transaction count validated against WooCommerce reports
Internal traffic filtered out in GA4 settings
Documentation created for tracking setup
Team trained on using GA4 reports for decision-making
Run through this checklist quarterly to maintain tracking integrity as your store evolves. If you're running a Shopify store instead, check out our Shopify GA4 setup guide for platform-specific instructions.
Final Thoughts: Clean GA4 Setup Enables Better Growth Decisions
A properly configured GA4 setup in WooCommerce transforms how you run your business. Instead of guessing which marketing channels drive revenue, you'll know with certainty. Instead of wondering why checkout conversion dropped, you'll have the data to pinpoint the exact step causing friction. Clean analytics shifts you from reactive firefighting to proactive optimization. The setup process requires attention to detail and thorough validation, but the payoff compounds over time. Every business decision becomes data-informed: which products to promote, where to allocate ad budget, what site changes to prioritize. If this setup feels overwhelming or you want expert eyes on your implementation, consider a professional GA4 audit to ensure nothing falls through the cracks. Your future self, making confident decisions with reliable data, will thank you for investing the time to get this right.