Loading tutorials…
Loading tutorials…
GA4 on WooCommerce looks simple until you check Realtime and see only PageView firing — no view_item, no purchase, no value. Enhanced ecommerce on Woo requires either GTM4WP with the right toggles or a paid plugin. Here is the full setup.
Who this is forWooCommerce owners who installed GA4 via 'just paste the measurement ID' and now have a property full of PageView events but zero ecommerce data. Or owners migrating from Universal Analytics who need real ecommerce events working before UA data ages out.
What you'll need
Step 1
Three valid paths: (a) GTM4WP free plugin → events flow to GA4 via GTM. (b) "Google Listings & Ads" official plugin → quick but limited. (c) Paid plugin like "GA Google Analytics" or "Analytify Pro." Recommendation: GTM4WP.
Option A — GTM4WP (free plugin by Thomas Geiger). Installs GTM on WooCommerce + pushes all enhanced ecommerce events (view_item, add_to_cart, begin_checkout, purchase) to the data layer. You then use GTM to forward those events to GA4. Most flexible, most documented, free.
Option B — "Google for WooCommerce" official plugin (by WooCommerce/Google). Quick setup, handles GA4 measurement ID + basic ecommerce events. Less flexible — limited control over event parameters and harder to add custom events. Good for stores that only need GA4 (not Meta, TikTok, etc.).
Option C — paid plugin (Analytify Pro, MonsterInsights Pro). Easy admin UI showing reports inside WordPress. Costs $99-299/year. Adds bloat — installs a separate WordPress dashboard plus phones home to vendor APIs.
Recommendation: GTM4WP. The 30-minute extra setup pays back in flexibility for years. This tutorial walks Option A.
Step 2
GA4 Admin → Create property → Web → enter your domain. Copy the Measurement ID (G-XXXXXXXXXX). You will use this in GTM.
Open Google Analytics → Admin (gear icon). Click "+ Create" → Property.
Property name: your business name. Reporting time zone: match your business. Currency: match your WooCommerce store currency.
Click Next, fill business details. Click Create.
In the next screen, choose "Web" as the platform. Enter your store URL (https://yourdomain.com) and a stream name (e.g., "Production Web").
Critical: turn ON "Enhanced measurement" (default). This auto-tracks page_view, scroll, outbound_click, video_engagement, etc. You will manually add ecommerce events on top.
Copy the Measurement ID (G-XXXXXXXXXX). Save it for the next steps.
Step 3
WordPress Admin → Plugins → Add New → search "GTM4WP" → install + activate. Then add your GTM container ID in settings.
If you do not have a GTM container yet, create one at tagmanager.google.com → Create Account → Container (Web). Copy the GTM-XXXXXXX ID.
In WordPress Admin → Plugins → Add New, search "GTM4WP" (Google Tag Manager for WordPress). Author: Thomas Geiger. Install + activate.
Go to Settings → Google Tag Manager. Paste your GTM container ID (GTM-XXXXXXX).
Under "Container code placement," choose "Custom (use functions described in documentation)." This is the most reliable for modern themes that may strip raw script tags.
Under "Integration" tab, enable: "Enhanced Ecommerce (UA)" AND "Track classic ecommerce" — yes, both toggles, even though GA4 is the goal. The legacy names emit events that GTM4WP then maps to GA4-compatible names.
Under "WooCommerce integration," enable: view_item, add_to_cart, remove_from_cart, view_cart, begin_checkout, add_payment_info, add_shipping_info, purchase. This is the full ecommerce funnel.
Save. GTM4WP now pushes a rich data layer on every WooCommerce page. Next, you configure GTM to forward to GA4.
Step 4
In GTM, create one GA4 Configuration tag (fires on All Pages) and one GA4 Event tag per ecommerce event (purchase, view_item, etc.).
Open GTM → your container → Tags → New.
Tag 1 — GA4 Configuration: Tag Type = "Google Analytics: GA4 Configuration." Measurement ID = your G-XXXXXXXXXX. Trigger = All Pages. Save. This is the base GA4 install.
Tag 2 — Purchase event: Tag Type = "Google Analytics: GA4 Event." Configuration Tag = (the one you just created). Event Name = "purchase." Event Parameters: transaction_id={{DLV - transactionId}}, value={{DLV - transactionTotal}}, currency={{DLV - transactionCurrency}}, items={{DLV - transactionProducts}}. Trigger = Custom Event "gtm4wp.orderCompletedEEC" (the data-layer event GTM4WP pushes).
Create matching tags for: view_item, add_to_cart, begin_checkout, add_payment_info. Each maps a GTM4WP event name to the GA4 event name with the right parameters.
Create the data-layer variables in GTM → Variables → New → Data Layer Variable. Variable name = "DLV - transactionId", Data Layer Variable Name = "ecommerce.transaction_id" (or whatever GTM4WP pushes — check the docs).
Submit + publish the GTM container. Events should start firing within 5 minutes.
Step 5
GA4 → Reports → Realtime. Browse your store, add to cart, complete a test purchase. All events should appear within 60 seconds with correct parameters.
Open GA4 → Reports → Realtime. Then in a separate browser (or incognito), walk through your store.
Visit home → product page → add to cart → checkout → complete a $1 test purchase.
In GA4 Realtime, you should see in order: page_view → view_item (with item_id matching the product) → add_to_cart (with value) → begin_checkout → purchase (with transaction_id + value).
If any event is missing, use GA4 DebugView (Admin → DebugView) for deeper inspection. DebugView requires the GA Debugger Chrome extension OR appending ?debug_mode=true to your URLs.
In DebugView, every event shows its parameters. Confirm purchase has transaction_id, value, currency, and items array — all populated, not null.
Wait 24-48 hours for the events to appear in standard reports (Reports → Engagement → Events). Realtime is for testing only.
Step 6
GA4 Admin → Events → toggle "Mark as key event" for "purchase." Without this, Google Ads cannot import it as a conversion.
Wait for at least one purchase event to appear in GA4 (Realtime or Events report).
GA4 Admin → Events. Find "purchase" in the list. Toggle "Mark as key event" ON.
Repeat for any other event that represents a real business outcome (lead, contact_form_submit, etc.).
Key events are GA4's replacement for "conversions." They are what Google Ads imports, what builds funnels and audiences, and what shows up in standard reports as "conversions."
If you skip this step, your Google Ads → Goals → Conversions → Import GA4 dialog will be empty. The integration silently fails.
Step 7
If your checkout, blog, or thank-you page lives on a different domain (subdomain is fine, separate domain needs config), set up cross-domain tracking in the GA4 data stream.
GA4 → Admin → Data Streams → click your stream → "Configure tag settings" → "Configure your domains."
Add every domain involved in a typical session. Common Woo cases: main site is yourdomain.com, checkout is checkout.yourdomain.com (sub-domain — usually handled automatically), or PayPal/external payment redirect needs the redirect target excluded so the GA session does not break.
GA4 automatically handles subdomains (anything.yourdomain.com) without config. You only need cross-domain config for truly different domains.
If you use Stripe-hosted checkout, PayPal popup, or similar external flows, those create a session break — GA4 sees the return as "Direct / None" instead of the original source. The fix is enabling "Referral exclusion" via GTM (advanced) or accepting some attribution loss.
Common mistakes
Installing GA4 via gtag.js paste AND via plugin
What goes wrong: Every event fires twice. PageView counts are 2x in GA4. Average engagement time looks meaningfully better than reality. Bid-strategy decisions based on inflated numbers underperform.
How to avoid: Pick one install path. If GTM4WP, remove any gtag.js snippet from theme functions or header.php. If the official Google plugin, do not also install GTM4WP.
Not marking purchase as a Key Event
What goes wrong: Google Ads → Import GA4 conversions dialog is empty. You think GA4-Google-Ads integration is broken when actually it's working — the events just are not marked as key events yet.
How to avoid: GA4 Admin → Events → toggle "Mark as key event" for purchase. Wait 24 hours for the change to propagate to Google Ads import.
Missing items array on purchase event
What goes wrong: Purchase event fires with value but no items. GA4 product-level reports (Reports → Monetization → Ecommerce purchases) show zero. You can't see which products drive revenue.
How to avoid: In GTM, ensure the items parameter maps to the data-layer array (DLV - transactionProducts or similar). Inspect in DebugView — the items field should be a non-empty array.
Wrong currency mismatch
What goes wrong: GA4 property currency is USD but WooCommerce store is EUR. Every purchase value is interpreted by GA4 as USD, inflating reported revenue by ~10% (or whatever the exchange rate is). ROAS reports are wrong.
How to avoid: GA4 Admin → Property Settings → Currency → match WooCommerce currency. Also confirm the data layer pushes the right currency code (EUR not USD) for purchase events.
Test orders polluting production GA4
What goes wrong: You run 30 test purchases during setup. Your GA4 Purchase count and revenue both include $30 of fake transactions. Reports look wrong for the first month.
How to avoid: Use GA4 internal traffic filters: Admin → Data Streams → Configure tag settings → Define internal traffic. Add your IP. Then Data Settings → Data Filters → enable "Internal Traffic." Or run test purchases with a query param like ?test=true and exclude that in a filter.
Skipping data-layer validation
What goes wrong: Events fire but with empty parameters (purchase with value=0). GA4 has no idea what revenue each transaction was. Reports show purchase count but $0 revenue.
How to avoid: Use GTM Preview mode. Click through a real purchase. Inspect the data layer in the GTM preview pane. Every event should have its parameters populated with real values. Fix any empty parameters at the GTM4WP integration settings.
Recap
Done — what's next
How to install the Meta Pixel on WooCommerce (with Conversions API)
Read the next tutorial
Hand it off
GA4 + GTM + WooCommerce ecommerce events is one of the most-broken installs in DIY ecommerce. A specialist will install GA4, configure all enhanced ecommerce events, validate in DebugView, and mark Key Events in one session — typically $200-400 at $14-16/hr.
See specialist rates
Because you installed GA4 with just the Measurement ID — not the enhanced ecommerce data layer. WooCommerce does not push ecommerce events by default. You need GTM4WP (or a similar plugin) to emit add_to_cart, begin_checkout, purchase events, and then GTM tags to forward them to GA4.
GTM4WP for flexibility — works with GA4, Meta, TikTok, custom events. Official Google plugin for simplicity if GA4 is your only analytics destination. Never both — they double-fire events.
Five usual causes: (1) test orders included in GA4 — exclude via filters. (2) Refunds not tracked — GA4 needs a refund event fired separately. (3) Currency mismatch. (4) Sampling on high-traffic stores — GA4 free tier samples once you hit thresholds. (5) Sessions that broke during external checkout (PayPal/Stripe popup) lose their attribution.
WooCommerce does not auto-fire a refund event. Add a tag in GTM that fires on the woocommerce_order_refunded action via a custom event in GTM4WP. Tag type = GA4 Event, Event name = 'refund', parameters = transaction_id + value. This is a manual config most stores skip.
Universal Analytics stopped processing data on July 1, 2024. Any UA install since then is collecting nothing. You must migrate to GA4. The data from old UA is read-only in the UA interface and will be deleted on July 1, 2027 — export historical reports before then.
GA4 Admin → DebugView. It shows every event firing from your debug-mode device in real time with all parameters. Install the GA Debugger Chrome extension or append ?debug_mode=true to URLs to enable. Use this when Realtime says an event fires but you suspect parameters are wrong — DebugView shows the actual parameter values.
WooCommerce
Most Woo owners install the Meta Pixel via the official plugin, see 'Connected,' and assume iOS shoppers are tracked. They are not. Without server-side Conversions API + event_id deduplication, you lose 30-50% of attribution. Here is the full setup.
WooCommerce
Klaviyo on WooCommerce is the highest-ROAS email setup in ecommerce. But the default plugin install syncs orders only — not browse, cart, or product views. Without those, your abandoned cart and browse-abandonment flows fire on incomplete data. Here is the full integration.
WooCommerce
Customer says 'checkout did not work.' You test and it seems fine. The order is stuck in 'Pending payment' or never created at all. This is the diagnostic sequence Woo specialists run — payment, webhook, plugin conflict, theme override, Blocks vs Classic.
WooCommerce
DIY WooCommerce is a great idea — until your plugin count crosses 30, your checkout breaks intermittently, and PageSpeed sits at 35. This is the honest framework: when the cost of self-managing exceeds the cost of hiring, and how to tell which side you're on.
Google Analytics 4
Ecommerce tracking in GA4 isn't optional — it's the foundation of every revenue report, ROAS calculation, and ad-platform optimization decision. Done right it pays back forever. Done wrong it produces numbers that everyone in the org argues about for months.