GA4 ecommerce tracking for WooCommerce gives you detailed reporting on product performance, checkout behaviour, and revenue attribution. When set up correctly, GA4 shows you which traffic sources drive the most purchases, where customers drop off in your checkout funnel, and which products have the highest and lowest conversion rates. Here is how to get it working.
Prerequisites
- A GA4 property with your GA4 Measurement ID (G-XXXXXXXXX)
- Google Tag Manager installed on your WooCommerce store (recommended via GTM4WP plugin)
- WooCommerce ecommerce dataLayer events enabled in GTM4WP
Step 1: Enable WooCommerce DataLayer Events in GTM4WP
Install the GTM4WP plugin if not already installed. In WordPress Admin, go to Settings → Google Tag Manager. In the eCommerce section, enable WooCommerce integration. This causes GTM4WP to push GA4-formatted ecommerce data to the dataLayer for all WooCommerce events: view_item, add_to_cart, begin_checkout, purchase, and more.
Step 2: Create the GA4 Configuration Tag in GTM
In GTM, create a new tag:
- Tag type: Google Analytics: GA4 Configuration
- Measurement ID: your G-XXXXXXXXX
- Trigger: All Pages
This is the base tag that loads GA4 and initiates tracking across all pages.
Step 3: Create GA4 Event Tags for WooCommerce Events
Create separate GA4 Event tags for each ecommerce event. GTM4WP pushes these events to the dataLayer with GA4-compatible naming and structure.
Purchase Event Tag
- Tag type: Google Analytics: GA4 Event
- Configuration tag: your GA4 Config tag
- Event name: purchase
- Event parameters: add ecommerce parameters reading from the dataLayer (value, currency, transaction_id, items)
- Trigger: Custom Event trigger, event name: woocommerce_purchase (the event name GTM4WP pushes on order confirmation)
Add to Cart Event Tag
- Event name: add_to_cart
- Trigger: Custom Event trigger, event name: woocommerce_add_to_cart
- Parameters: value, currency, items (product name, ID, price, quantity)
Begin Checkout Event Tag
- Event name: begin_checkout
- Trigger: Custom Event trigger, event name: woocommerce_begin_checkout
View Item Event Tag
- Event name: view_item
- Trigger: Custom Event trigger, event name: woocommerce_view_item
Step 4: Create DataLayer Variables
For each event parameter (value, currency, transaction_id, items), create a GTM DataLayer Variable pointing to the correct path in the dataLayer. GTM4WP uses the standard GA4 ecommerce schema:
- ecommerce.value
- ecommerce.currency
- ecommerce.transaction_id
- ecommerce.items
Create one variable per path, then reference those variables in your GA4 event tags.
Step 5: Verify in GTM Preview Mode
In GTM Preview mode, navigate to a product page, add to cart, go through checkout, and complete a test purchase. In the Tag Assistant panel, verify:
- view_item tag fires on product page with correct product data
- add_to_cart tag fires with correct product ID and price
- purchase tag fires on order confirmation with correct order total, currency, and items
Check the Variables tab to confirm all dataLayer variables are reading the right values.
Step 6: Verify in GA4 DebugView
In GA4, go to Admin → DebugView. With GTM Preview mode active, your GA4 events appear in DebugView in near real-time. Confirm the purchase event appears with the correct value and currency after your test order.
WooCommerce GA4 Plugin Alternative
If GTM setup feels complex, several WordPress plugins handle GA4 ecommerce tracking directly:
- MonsterInsights: popular GA4 plugin for WordPress/WooCommerce with ecommerce tracking included in the Pro version
- ExactMetrics: similar functionality, focused on GA4 integration
- GA4 for WooCommerce (various): search the WordPress plugin directory for options
Plugin solutions are simpler to set up but offer less control over what data is sent and when. GTM is recommended for stores that need precise control over their tracking implementation.
Book your free audit here and we will assess your WooCommerce GA4 tracking and identify any gaps in your ecommerce reporting.