1 May, 2025

How to Enable eCommerce Tracking in Google Analytics 4 (GA4)

Introduction

If you're running an online store, tracking product views, add-to-cart actions, and completed purchases is essential. With Google Analytics 4 (GA4), eCommerce tracking is more powerful and flexible than ever — but it requires proper setup.

In this guide, you'll learn how to enable eCommerce tracking in GA4, step-by-step, whether you're using Google Tag Manager (GTM) or gtag.js.


Step 1: Understand how GA4 handles eCommerce

Unlike Universal Analytics, GA4 does not require enabling eCommerce in the admin interface. Instead, it automatically processes eCommerce data when the correct events are sent to it.

So: sending the right events = enabling eCommerce tracking.


Step 2: Choose your implementation method

There are two main ways to implement eCommerce tracking in GA4:


✅ Option A: Using Google Tag Manager (GTM)

  1. Go to your GTM workspace.

  2. Create a new GA4 Event Tag.

  3. Set the Event Name to one of GA4’s standard eCommerce events, such as add_to_cart, purchase, view_item, etc.

  4. Add parameters under the Event Parameters section:

    • items (as a custom variable or a Data Layer variable)

    • value, currency, transaction_id for purchases

  5. Choose an appropriate trigger (e.g., "Add to Cart" button click).

  6. Save and publish your container.

Example Data Layer Push:

window.dataLayer.push({
  event: "add_to_cart",
  ecommerce: {
    items: [{
      item_id: "SKU_123",
      item_name: "Awesome T-shirt",
      price: 29.99,
      quantity: 1
    }]


✅ Option B: Using gtag.js

Insert the event code directly on your site when the action occurs.

Example for a purchase:

gtag("event", "purchase", {
  transaction_id: "T12345",
  currency: "USD",
  value: 59.98,
  items: [
    {
      item_id: "SKU_123",
      item_name: "Awesome T-shirt",
      price: 29.99,
      quantity: 2
    }
  ]


Step 3: Use the Right Events and Parameters

GA4 expects standard event names for eCommerce tracking. Here are the most common ones:

Event Name - When to Use

view_item - When a product detail page is viewed
add_to_cart - When a product is added to the cart
begin_checkout - When a user starts the checkout process
purchase -When a purchase is completed

Each event should include the items array with keys like:

  • item_id

  • item_name

  • price

  • quantity


Step 4: Test Your Setup

  1. Go to Admin > DebugView in GA4.

  2. Open your site with GTM debug mode or enable debug in gtag:

  1. Trigger the eCommerce actions (e.g., add to cart or complete a test purchase).

  2. Confirm that the events show up with the correct parameters.


Step 5: View Reports in GA4

Once events are properly sent, GA4 will automatically populate the Monetization reports:

  • Monetization > Overview

  • Monetization > Ecommerce purchases

It may take a few hours for the reports to show real data.


Final Tips

  • Use consistent and structured product data.

  • Map events correctly if you're using custom events via Admin > Events > Create Event.

  • Mark purchase or other important events as conversions in Admin > Conversions.


Conclusion

GA4’s eCommerce tracking is extremely flexible — but it won't work unless you send the right events with the right structure. Whether you’re using GTM or gtag.js, the key is to implement view_item, add_to_cart, and purchase properly.

Once set up, you’ll unlock valuable insights about your store’s performance, product popularity, and sales funnel.


Uplyt Bonus: View All Your eCommerce KPIs in One Page

Once your GA4 eCommerce tracking is active, you’ll also unlock access to the dedicated eCommerce section inside Uplyt.
There, you’ll find a clear dashboard with the most important KPIs per product:

  • Product views

  • Add to carts

  • Checkout starts

  • Units sold

  • Product revenue

All of this is updated automatically from your GA4 data, and simplified for you with actionable insights — whether you're a beginner or a seasoned marketer. Join Uplyt


Get ultimate task management secrets

Unlock the door to unparalleled productivity with our exclusive guide to the ultimate task.

Your gateway to smarter insights and faster decisions.

Start using Uplyt for free today and unlock powerful tools to understand, manage, and optimize your data with ease.

Your gateway to smarter insights and faster decisions.

Start using Uplyt for free today and unlock powerful tools to understand, manage, and optimize your data with ease.

Your gateway to smarter insights and faster decisions.

Start using Uplyt for free today and unlock powerful tools to understand, manage, and optimize your data with ease.

Your gateway to smarter insights and faster decisions.

Start using Uplyt for free today and unlock powerful tools to understand, manage, and optimize your data with ease.

Simplify Your Google Analytics Journey

© Copyright 2025. All Rights Reserved by Uplyt.io

English

Simplify Your Google Analytics Journey

© Copyright 2025. All Rights Reserved by Uplyt.io

English

Simplify Your Google Analytics Journey

© Copyright 2025. All Rights Reserved by Uplyt.io

English

Simplify Your Google Analytics Journey

© Copyright 2025. All Rights Reserved by Uplyt.io

English