Menu

How to Set Up GA4 Ecommerce Tracking
How to Set Up GA4 Ecommerce Tracking

How to Set Up GA4 Ecommerce Tracking (Without Data Loss) | A Complete Step-by-Step Guide

Learn how to correctly implement GA4 Ecommerce tracking to avoid data loss. Discover how to track events like purchases, add-to-cart, and checkout with Google’s recommended event names.

Ricardo Cristofolini

Senior Implementation Specialist, Data Solutions

I’m passionate about what I do. If you meet my manager or co-workers, they would say I’m a team player, engaged and always excited to learn something new. Like everyone else I have some flaws. However I’m not afraid to work around those to bring the best in myself and for the company

Table of Contents:

  • What Are Ecommerce Events in GA4?

  • 6 Key Tips for Accurate GA4 Ecommerce Tracking

  • Avoiding Duplicate or Missing Data with CMS Platforms

  • Updating Your Data Layer for GA4

  • Must-Have Parameters for Ecommerce Events

  • GA4 Event Limits to Know

  • Final Thoughts

When we talk about analytics, one of the first things that comes to mind is tracking what users do on a website. Tracking user interactions can be grouped into two main categories:

  1. General Events: These include things like button clicks, filling out forms, watching videos, subscribing to newsletters, and interacting with menus. Essentially, these events capture user actions that are not specifically related to products or Ecommerce.

  2. Ecommerce Events: These focus on interactions with products, like viewing a product, adding it to a cart, or completing a purchase.

Both types of tracking are critical, but Ecommerce events play a unique role in helping businesses measure product and sales performance. In this blog, we’ll focus on setting up Ecommerce tracking in Google Analytics 4 (GA4), so your reports show accurate data. Think of this as your GA4 setup guide for Ecommerce.

What Are Ecommerce Events?

GA4 provides a predefined list of Enhanced Ecommerce tracking events that cover most of the important actions customers might take on your site. Here’s the list of Google’s default Ecommerce events:

  • View Promotion

  • Select Promotion

  • View Item List

  • Select Item

  • View Item

  • Add to Cart

  • Add to Wishlist

  • Remove From Cart

  • View Cart

  • Begin Checkout

  • Add Shipping Info

  • Add Payment Info

  • Purchase

  • Refund

While this list might seem comprehensive, you don’t need to implement every event—only the ones relevant to your business. For example, a small business without a wishlist feature can skip the “Add to Wishlist” event. However, accurately setting up the events you choose is crucial to avoid common issues like data loss or inaccurate tracking.

Tips for Setting Up Ecommerce Tracking in GA4

1. Stick to Google’s Default Event Names

GA4’s Ecommerce reports are built around specific event names. If you use different names or create custom Ecommerce events, GA4 will treat them as custom events. This means:

  • The data won’t appear in your Ecommerce reports.

  • GA4 won’t calculate key metrics like revenue or automatically populate dimensions like product category.

Following Google’s event naming conventions is one of the most important tagging best practices for GA4, as it ensures consistency across reports.

2. Watch for Automatic Ecommerce Tracking in CMS Platforms

If you use a website builder or content management system (CMS) like Shopify, you may find that some Ecommerce events are tracked automatically. This feature is designed to simplify tracking for non-technical users. However, it can lead to two common issues:

  • DuplicateTracking: If your CMS tracks certain events by default, like “Add to Cart” or “Purchase,” and you also set up these events manually, you may end up with duplicate data.

  • Incomplete Tracking: Some CMS platforms only track a basic set of events. For instance, Shopify typically tracks “View Item”, “Add to Cart”, “Begin Checkout”, “Add Payment Info”, and “Purchase”. Other important events like “Add Shipping Info” or “View Cart” may not be included.

If your CMS automatically tracks events, review the setup carefully to ensure that all relevant events are tracked correctly and there’s no duplication.

3. Update Your Data Layer to Match GA4's Event Model

GA4 uses a different data model than Universal Analytics (UA). In UA, the Data Layer was organized into categories like Action, Label, Dimensions, and Metrics. GA4 simplifies this by using just Event Names and Parameters.

It’s important to highlight that currently this only applies to GTM. If we look into other Tag Management systems such as Tealium or Ensighten, they would have their version of the Data Layer. In other words, some modification would have to happen in the Data Layer and/or tag mapping structure, but not necessarily to the GA4 Model. But this is a conversation for another article - Stay tuned.

If your website still uses a UA Data Layer, you may miss out on critical GA4 events like “Add Shipping Info” or “Begin Checkout”. Make sure your Data Layer is updated to match GA4’s structure to ensure all Ecommerce actions are captured.

4. Monitor Templates and Plugin Updates

If you rely on templates or plugins to manage tracking, be aware that these tools are created by third-party developers and are not always kept up to date. For example, the GTM4wp plugin had to make significant updates after the UA sunset to map UA events to GA4 events:

  • gtm4wp.orderCompletedEEC became purchase.

  • gtm4wp.addProductToCartEEC became add_to_cart.

If plugins or templates are outdated, your tracking setup might break. Tools like GTM4wp simplify GTM Ecommerce configuration, but always test changes in GA4 DebugView to avoid broken or duplicated event tracking.

5. Include Mandatory GA4 Parameters for Enhanced Ecommerce Events

For GA4 to recognize Ecommerce events, certain parameters must be included. Without these, your events won’t appear in GA4 reports. Here are some examples:

  • For a Purchase Event:

    • currency (e.g., “USD”)

    • value (total transaction value)

    • transaction_id (unique order ID)

    • items (an array of purchased products)

  • For Individual Items in the Items Array:

    • item_id (a unique product identifier)

    • item_name (the product name)

These event parameters in GA4—like currency, value, and itemsare required for events to populate correctly in reports. Adding optional parameters, like affiliation, discount, or quantity, can also improve the quality of your reports. While not mandatory, these details provide deeper insights into customer behaviour and product performance. Read more on how to handle discounted product pricing within GA4, ensuring accurate revenue tracking.

6. Understand GA4’s Limits

GA4 has limits on the number of custom dimensions and metrics you can create:

  • Standard Properties: Fewer dimensions and metrics are available.

  • 360 Properties: Higher limits, designed for enterprise users.

If you exceed these limits, the extra data won’t appear in GA4 reports, but it will still be available in BigQuery if your GA4 property is connected to it. Plan your tracking setup carefully to stay within these limits while capturing all necessary data. Read more about Key Differences between GA 360 & GA4 Standard

Conclusion

Implementing GA4 for online stores requires careful planning, but the payoff is accurate and actionable data on what drives sales. By sticking to Google’s predefined event names, ensuring your Data Layer is updated, and watching for potential issues with CMS platforms or plugins, you can create accurate and insightful Ecommerce reports.

Need help setting up GA4 Ecommerce tracking? Contact us to make sure your data is working for you!

How to Set Up GA4 Ecommerce Tracking

How to Set Up GA4 Ecommerce Tracking (Without Data Loss) | A Complete Step-by-Step Guide

Learn how to correctly implement GA4 Ecommerce tracking to avoid data loss. Discover how to track events like purchases, add-to-cart, and checkout with Google’s recommended event names.

Ricardo Cristofolini

Senior Implementation Specialist, Data Solutions

I’m passionate about what I do. If you meet my manager or co-workers, they would say I’m a team player, engaged and always excited to learn something new. Like everyone else I have some flaws. However I’m not afraid to work around those to bring the best in myself and for the company

Table of Contents:

  • What Are Ecommerce Events in GA4?

  • 6 Key Tips for Accurate GA4 Ecommerce Tracking

  • Avoiding Duplicate or Missing Data with CMS Platforms

  • Updating Your Data Layer for GA4

  • Must-Have Parameters for Ecommerce Events

  • GA4 Event Limits to Know

  • Final Thoughts

When we talk about analytics, one of the first things that comes to mind is tracking what users do on a website. Tracking user interactions can be grouped into two main categories:

  1. General Events: These include things like button clicks, filling out forms, watching videos, subscribing to newsletters, and interacting with menus. Essentially, these events capture user actions that are not specifically related to products or Ecommerce.

  2. Ecommerce Events: These focus on interactions with products, like viewing a product, adding it to a cart, or completing a purchase.

Both types of tracking are critical, but Ecommerce events play a unique role in helping businesses measure product and sales performance. In this blog, we’ll focus on setting up Ecommerce tracking in Google Analytics 4 (GA4), so your reports show accurate data. Think of this as your GA4 setup guide for Ecommerce.

What Are Ecommerce Events?

GA4 provides a predefined list of Enhanced Ecommerce tracking events that cover most of the important actions customers might take on your site. Here’s the list of Google’s default Ecommerce events:

  • View Promotion

  • Select Promotion

  • View Item List

  • Select Item

  • View Item

  • Add to Cart

  • Add to Wishlist

  • Remove From Cart

  • View Cart

  • Begin Checkout

  • Add Shipping Info

  • Add Payment Info

  • Purchase

  • Refund

While this list might seem comprehensive, you don’t need to implement every event—only the ones relevant to your business. For example, a small business without a wishlist feature can skip the “Add to Wishlist” event. However, accurately setting up the events you choose is crucial to avoid common issues like data loss or inaccurate tracking.

Tips for Setting Up Ecommerce Tracking in GA4

1. Stick to Google’s Default Event Names

GA4’s Ecommerce reports are built around specific event names. If you use different names or create custom Ecommerce events, GA4 will treat them as custom events. This means:

  • The data won’t appear in your Ecommerce reports.

  • GA4 won’t calculate key metrics like revenue or automatically populate dimensions like product category.

Following Google’s event naming conventions is one of the most important tagging best practices for GA4, as it ensures consistency across reports.

2. Watch for Automatic Ecommerce Tracking in CMS Platforms

If you use a website builder or content management system (CMS) like Shopify, you may find that some Ecommerce events are tracked automatically. This feature is designed to simplify tracking for non-technical users. However, it can lead to two common issues:

  • DuplicateTracking: If your CMS tracks certain events by default, like “Add to Cart” or “Purchase,” and you also set up these events manually, you may end up with duplicate data.

  • Incomplete Tracking: Some CMS platforms only track a basic set of events. For instance, Shopify typically tracks “View Item”, “Add to Cart”, “Begin Checkout”, “Add Payment Info”, and “Purchase”. Other important events like “Add Shipping Info” or “View Cart” may not be included.

If your CMS automatically tracks events, review the setup carefully to ensure that all relevant events are tracked correctly and there’s no duplication.

3. Update Your Data Layer to Match GA4's Event Model

GA4 uses a different data model than Universal Analytics (UA). In UA, the Data Layer was organized into categories like Action, Label, Dimensions, and Metrics. GA4 simplifies this by using just Event Names and Parameters.

It’s important to highlight that currently this only applies to GTM. If we look into other Tag Management systems such as Tealium or Ensighten, they would have their version of the Data Layer. In other words, some modification would have to happen in the Data Layer and/or tag mapping structure, but not necessarily to the GA4 Model. But this is a conversation for another article - Stay tuned.

If your website still uses a UA Data Layer, you may miss out on critical GA4 events like “Add Shipping Info” or “Begin Checkout”. Make sure your Data Layer is updated to match GA4’s structure to ensure all Ecommerce actions are captured.

4. Monitor Templates and Plugin Updates

If you rely on templates or plugins to manage tracking, be aware that these tools are created by third-party developers and are not always kept up to date. For example, the GTM4wp plugin had to make significant updates after the UA sunset to map UA events to GA4 events:

  • gtm4wp.orderCompletedEEC became purchase.

  • gtm4wp.addProductToCartEEC became add_to_cart.

If plugins or templates are outdated, your tracking setup might break. Tools like GTM4wp simplify GTM Ecommerce configuration, but always test changes in GA4 DebugView to avoid broken or duplicated event tracking.

5. Include Mandatory GA4 Parameters for Enhanced Ecommerce Events

For GA4 to recognize Ecommerce events, certain parameters must be included. Without these, your events won’t appear in GA4 reports. Here are some examples:

  • For a Purchase Event:

    • currency (e.g., “USD”)

    • value (total transaction value)

    • transaction_id (unique order ID)

    • items (an array of purchased products)

  • For Individual Items in the Items Array:

    • item_id (a unique product identifier)

    • item_name (the product name)

These event parameters in GA4—like currency, value, and itemsare required for events to populate correctly in reports. Adding optional parameters, like affiliation, discount, or quantity, can also improve the quality of your reports. While not mandatory, these details provide deeper insights into customer behaviour and product performance. Read more on how to handle discounted product pricing within GA4, ensuring accurate revenue tracking.

6. Understand GA4’s Limits

GA4 has limits on the number of custom dimensions and metrics you can create:

  • Standard Properties: Fewer dimensions and metrics are available.

  • 360 Properties: Higher limits, designed for enterprise users.

If you exceed these limits, the extra data won’t appear in GA4 reports, but it will still be available in BigQuery if your GA4 property is connected to it. Plan your tracking setup carefully to stay within these limits while capturing all necessary data. Read more about Key Differences between GA 360 & GA4 Standard

Conclusion

Implementing GA4 for online stores requires careful planning, but the payoff is accurate and actionable data on what drives sales. By sticking to Google’s predefined event names, ensuring your Data Layer is updated, and watching for potential issues with CMS platforms or plugins, you can create accurate and insightful Ecommerce reports.

Need help setting up GA4 Ecommerce tracking? Contact us to make sure your data is working for you!

Sign Up For Our Newsletter

Napkyn Inc.
204-78 George Street, Ottawa, Ontario, K1N 5W1, Canada

Napkyn US
6 East 32nd Street, 9th Floor, New York, NY 10016, USA

212-247-0800 | info@napkyn.com