Ecommerce Tracking in GA4: Complete Setup Guide

How to set up ecommerce tracking in Google Analytics 4. From product views to purchases, track every step of your customer journey.

An online store owner noticed revenue dropped 15% in November, right before Black Friday. Traffic was actually up. The problem? Their checkout page had a JavaScript error on Safari that prevented the “Place Order” button from working. They only discovered this three weeks later because they had no ecommerce funnel tracking. Hundreds of customers hit the broken button, gave up, and left.

With proper ecommerce tracking, they would have seen the checkout completion rate crash on day one.

Why This Matters

Every step in the funnel leaks money. On average, 70% of online shopping carts are abandoned. But where exactly do people leave? Is it the product page? The cart? The shipping cost reveal? Ecommerce tracking breaks the journey into measurable steps so you can find and fix the leaks.

Product-level data changes everything. Instead of knowing “we sold $50K this month,” you know which products sell, which get viewed but not purchased, which get added to cart but abandoned, and which combinations people buy together.

Marketing attribution becomes real. When you connect ecommerce events to traffic sources, you can say “Google Ads drove $12K in revenue at a 4x ROAS” instead of “Google Ads sent us some clicks.” That is the difference between guessing and optimizing.

Seasonality and trends emerge. With months of ecommerce data, you spot patterns. Maybe Sundays have the highest average order value. Maybe email campaigns convert 3x better than social. These insights compound into real competitive advantages.

How to Do It

Step 1: Understand the GA4 ecommerce events.

GA4 uses a standard set of ecommerce events. Implement them in order of priority:

EventWhen to firePriority
view_itemProduct page viewedHigh
add_to_cartItem added to cartHigh
remove_from_cartItem removed from cartMedium
begin_checkoutCheckout startedHigh
add_shipping_infoShipping details enteredMedium
add_payment_infoPayment method enteredMedium
purchaseOrder completedCritical

Step 2: Push data to the data layer.

Each event needs product details pushed to the dataLayer before the tag fires. Here is an example for add_to_cart:

dataLayer.push({
  event: "add_to_cart",
  ecommerce: {
    currency: "USD",
    value: 29.99,
    items: [{
      item_id: "SKU-123",
      item_name: "Classic T-Shirt",
      item_category: "Apparel",
      price: 29.99,
      quantity: 1
    }]
  }
});

Step 3: Configure Google Tag Manager.

Create a GA4 Event tag for each ecommerce event. Use the built-in ecommerce data layer variables, which GTM recognizes automatically. Set the trigger to fire on the custom event name (like add_to_cart).

For the purchase event, make sure you include transaction_id, value, currency, and the items array. Missing any of these means GA4 will not properly attribute revenue.

Step 4: Use a platform plugin if available.

If you run Shopify, WooCommerce, Magento, or BigCommerce, do not build this from scratch. Use a plugin:

  • Shopify: Native GA4 integration in Online Store preferences
  • WooCommerce: GTM4WP plugin or MonsterInsights
  • Magento: Mageplaza or Amasty GA4 extensions

These handle the data layer pushes for all standard ecommerce events.

Step 5: Test everything in DebugView.

Enable GA4 DebugView and walk through a complete purchase on your site. Verify each event fires at the right moment with the correct product data. Check that the purchase event has the right revenue value. Testing one full transaction end to end catches 90% of implementation errors.

The Easier Way

Raw GA4 ecommerce reports require navigating monetization reports, applying segments, and comparing date ranges manually. With ClawAnalytics, the same data is available through questions:

  • “What is our cart-to-purchase conversion rate this month?”
  • “Which product categories have the highest average order value?”
  • “How does our checkout abandonment rate compare to last quarter?”

When your CEO asks “How is the store doing?” you can get the answer in 10 seconds instead of 10 minutes of clicking.

Quick Wins

  • Implement purchase first. If you only track one event, make it the purchase. Revenue data alone is transformative. Add the funnel events after.
  • Include transaction_id on every purchase. This prevents duplicate counting if a user refreshes the confirmation page or returns to it later.
  • Clear the data layer between events. Push { ecommerce: null } before each new ecommerce event to prevent stale data from leaking into subsequent events.
  • Set up a revenue alert. Configure a custom alert that notifies you if daily revenue drops below a threshold. This catches checkout bugs within hours instead of weeks.
  • Check mobile separately. Mobile conversion rates are typically 50% lower than desktop. If the gap is larger, investigate mobile UX issues in your checkout flow.

Check your analytics from anywhere

On your morning commute. At a coffee shop. In a meeting. Pull up your analytics on any device and get instant answers.

  • Web dashboard on desktop & mobile
  • Discord bot for team channels
  • Slack integration for your workspace
  • MCP server for AI agents (Claude, Cursor)
See your traffic in 60 seconds →
ClawAnalytics mobile chat showing engagement rate breakdown with charts

How ClawAnalytics helps

Skip the dashboards. Get answers in seconds.

🔗
1

Connect GA4

One-click OAuth. Read-only access. Takes 30 seconds to link your Google Analytics property.

ClawAnalytics connections page showing Google Analytics properties linked
💬
2

Ask questions

Type in plain English. No query language, no filters, no date pickers. Just ask what you want to know.

ClawAnalytics chat interface with natural language query
📊
3

Get answers with charts

Instant responses with visualizations. Share charts with your team or export the data.

ClawAnalytics showing chart response to analytics query

See it in action

Ask a question. Get a chart. That simple.

ClawAnalytics Chat
ClawAnalytics chat interface showing a natural language analytics query with chart response

Works on web, Discord, and Slack. Also available as an MCP server for AI agents.

Leonidas Maliokas
"I used to open Google Analytics 5 times a day and still miss things. Now I get a summary every morning and ask follow-ups when something looks off. Takes 10 seconds instead of 10 minutes."

Leonidas Maliokas

Founder, Elanra Studios

🎮 5 games monitored 💼 3 businesses

Simple, honest pricing

Start free. Upgrade when you're ready.

Free

Try it out

$0 /month
  • 5 websites
  • 30 questions/month
  • Web dashboard
  • No credit card
Start Free

Website

For small businesses

$9 /month
  • 5 websites connected
  • 100 questions/month
  • Daily morning summary
  • Web dashboard + Discord
Get Started

Business

For agencies and portfolios

$79 /month
  • Unlimited websites
  • 2,000 questions/month
  • Everything in Pro
  • ✅ API access
  • ✅ MCP integration
  • ⭐ Priority support
Get Started

Stop opening dashboards.
Start asking.

Connect Google Analytics in 30 seconds. Get answers from the dashboard or Discord. Start free — no credit card needed.

Try it free — ask your first question
30-second setup Free plan available Cancel anytime

Got questions?

What ecommerce events does GA4 track automatically?
GA4 does not track any ecommerce events automatically. You need to implement data layer pushes for each event like view_item, add_to_cart, begin_checkout, and purchase. Platforms like Shopify and WooCommerce have plugins that handle this for you.
Do I need Google Tag Manager for GA4 ecommerce tracking?
Technically no, but practically yes. You can hardcode gtag.js calls, but Google Tag Manager makes it far easier to manage ecommerce events, test them in preview mode, and update tracking without touching your site code.
Can ClawAnalytics help me understand my ecommerce funnel?
Absolutely. Once ecommerce events are flowing into GA4, you can ask ClawAnalytics things like 'What percentage of add-to-carts result in purchases?' or 'Which products have the highest cart abandonment rate?' It turns your ecommerce data into answers.

Related guides

More resources to help you get the most from your analytics.