How to Enable Enhanced Ecommerce in Google Analytics
If you're running an online store, standard Google Analytics reports only tell you half the story - how people get to your site. To understand the other half - what they actually do with your products - you need to enable Enhanced Ecommerce tracking. This guide will walk you through exactly how to set it up for both Universal Analytics and Google Analytics 4, so you can stop guessing and start seeing what truly drives your sales.
What is Enhanced Ecommerce Tracking?
Enhanced Ecommerce is a feature within Google Analytics that gives you incredibly detailed insights into your customers' shopping behavior. While standard tracking can show you page views and traffic sources, Enhanced Ecommerce goes much deeper. It transforms your analytics platform into a powerful business intelligence tool dedicated to your online store's performance.
Once enabled, it unlocks a new set of reports that track the entire customer journey, from seeing a product to making a purchase. You can move beyond basic metrics like "sessions" and start analyzing reports that directly impact your bottom line:
- Sales Performance Report: See revenue, tax, shipping costs, and quantities sold, allowing you to easily track which days and promotions generate the most income.
- Product Performance Report: Identify your best-selling products. You can also see metrics like "cart-to-detail rate" (how often a product is added to the cart after being viewed) and "buy-to-detail rate" (how often it's purchased after being viewed).
- Shopping Behavior Report: Visualize your sales funnel, from product impressions and adds-to-cart all the way through to final transaction. This report quickly highlights where you might be losing potential customers.
- Checkout Behavior Report: See a step-by-step breakdown of your checkout process. You can instantly spot which stage (like shipping or payment) has the highest drop-off rate and focus your efforts on improving that specific step.
Universal Analytics vs. Google Analytics 4: What You Need to Know
Before you get started, it's important to know which version of Google Analytics you're using. The setup process is slightly different for each.
- Universal Analytics (UA): This is the older version, often identified by tracking IDs that start with "UA-". It has a dedicated "Enhanced Ecommerce" section that needs to be manually enabled.
- Google Analytics 4: This is the current and default version of Google Analytics. Its IDs start with "G-". GA4 uses an event-based model and doesn't have a simple on/off switch, it automatically recognizes and processes ecommerce data if it's sent in the correct format.
Many websites still use UA alongside GA4, so we’ll cover the setup for both. The most reliable and flexible way to implement tracking for either version is with Google Tag Manager (GTM), so our guide will focus on that method.
How to Set Up Enhanced Ecommerce in Universal Analytics (UA)
Setting up UA Enhanced Ecommerce involves two main parts: turning on the feature in your Google Analytics account and then sending the necessary shopping data from your website to GA, usually via Google Tag Manager.
Step 1: Enable Reporting in Google Analytics
First, you need to tell Google Analytics that you're ready to start receiving ecommerce data. This is a simple toggle switch in your account settings.
- Navigate to the Admin section of your Google Analytics account (the gear icon in the bottom-left).
- In the far-right "View" column, select the reporting view you want to use.
- Click on Ecommerce Settings.
- Turn the toggle for Enable Ecommerce to ON.
- Once enabled, the toggle for Enable Enhanced Ecommerce Reporting will appear. Turn that ON as well.
- You can optionally add checkout funnel step labels here, like "Shipping," "Payment," and "Review."
- Click Save.
With this step complete, your GA account is listening for the data. Now, you need to send it.
Step 2: Prepare Your Website with a Data Layer
This is the most technical part of the process. For Google Tag Manager to see what’s happening on your site (like a product view or an add to cart), your website needs to push that information into a special JavaScript object called the Data Layer. Think of the Data Layer as a message courier that holds transactional data on the page for GTM to pick up.
Your developer will need to add code that triggers these pushes. For example, when a customer successfully completes a purchase, your site's confirmation page should push transaction details to the data layer. Here’s what the code for a purchase might look like:
window.dataLayer = window.dataLayer || [],
dataLayer.push({
'event': 'purchase',
'ecommerce': {
'purchase': {
'actionField': {
'id': 'T12345', // Transaction ID. Required.
'affiliation': 'Online Store',
'revenue': '35.43', // Total transaction value (incl. tax and shipping)
'tax':'4.90',
'shipping': '5.99',
'coupon': 'SUMMER_SALE'
},
'products': [{ // List of products purchased.
'name': 'Triblend T-Shirt, Green', // Product name. Required.
'id': '12345', // Product SKU. Required.
'price': '15.25',
'brand': 'Google',
'category': 'Apparel',
'variant': 'Gray',
'quantity': 1
},
{
'name': 'Donut Mug',
'id': '67890',
'price': '9.29',
'brand': 'Google',
'category': 'Home Goods',
'variant': 'Blue',
'quantity': 1
}]
}
}
}),You’ll need similar dataLayer.push events for other actions like addToCart, removeFromCart, and productClick.
Step 3: Configure Tags and Triggers in Google Tag Manager
Once the Data Layer is in place, you can configure GTM to read that information and send it to Google Analytics.
- Create a Trigger: In GTM, triggers tell tags when to fire. For a purchase, you'll create a "Custom Event" trigger that listens for the
'purchase'event name you defined in the Data Layer code. - Create a Universal Analytics Tag:
Since the tag fires on the purchase event, GTM automatically looks for the ecommerce object in the Data Layer at that moment and passes its contents to Analytics. You'll set up similar tag-and-trigger pairs for other shopping actions.
How to Set Up Ecommerce Tracking in Google Analytics 4
The philosophy for GA4 is similar - your website needs to send specifically formatted ecommerce data - but the structure is a bit different. GA4 uses its own set of recommended event names.
Step 1: Check for GA4 Events (No On/Off Switch)
Unlike UA, there's no setting to enable in the GA4 admin panel. If GA4 receives an ecommerce event structured correctly (like purchase, add_to_cart, or view_item), it will automatically populate its built-in ecommerce reports. Your only job is to provide the data.
Step 2: Implement the GA4 Data Layer on Your Website
Just like with UA, you need a Data Layer. The structure for GA4 events and parameters is slightly different and more aligned with its event-based model. For example, here's what the GA4 version of a purchase event looks like:
window.dataLayer = window.dataLayer || [],
dataLayer.push({
'event': 'purchase',
'ecommerce': {
'transaction_id': 'T_12345',
'value': 35.43,
'tax': 4.90,
'shipping': 5.99,
'currency': 'USD',
'coupon': 'SUMMER_SALE',
'items': [
{
'item_id': 'SKU_12345',
'item_name': 'Triblend T-Shirt',
'affiliation': 'Google Merchandise Store',
'coupon': 'SUMMER_FUN',
'currency': 'USD',
'discount': 2.22,
'index': 0,
'item_brand': 'Google',
'item_category': 'Apparel',
'item_variant': 'Green',
'prlist_id': 'P_12345',
'prlist_name': 'Summer Sale',
'price': 15.25,
'quantity': 1
}]
}
}),You’ll notice the items array and top-level parameters like transaction_id and value. This format must be followed for GA4 to interpret the data correctly.
Step 3: Set up a GA4 Event Tag in Google Tag Manager
In GTM, setting up a GA4 tag relies on Event Parameters to capture and send the ecommerce data.
- Create a Trigger: Just as with UA, create a "Custom Event" trigger for the
'purchase'event name. - Create a Google Analytics: GA4 Event Tag:
Repeat this process for other recommended GA4 events like add_to_cart and view_item, creating a unique tag for each with the corresponding event name and trigger.
Using E-commerce Plugins for Shopify and WooCommerce
If you're using a popular e-commerce platform, you probably don't need to write any code. Many platforms have built-in integrations or plugins that set up the entire Data Layer for you.
- Shopify: You can simply paste your Google Analytics tracking ID directly into Shopify's admin area (under Online Store > Preferences > Google Analytics). Shopify automatically generates the necessary Data Layer for GA4 standard ecommerce actions.
- WooCommerce (WordPress): Using a plugin like GTM4WP (Google Tag Manager for WordPress) is the easiest path. After installing and setting up the plugin, just check a box in its settings to enable ecommerce tracking, and it will inject the properly formatted Data Layer for all user actions on your store. This leaves you to just set up the tags in GTM.
How to Verify Your Setup
Setting up your tracking is only half the battle. You need to make sure it's working properly. The absolute best tool for this is GTM’s Preview Mode.
Click the "Preview" button in GTM, enter your website URL, and perform some test actions, like adding an item to your cart and starting the checkout process. As you click around your live site, you'll see a detailed event stream in the GTM Preview tab. You can click on events like add_to_cart in the timeline and inspect the "Data Layer" tab to confirm your product details (item_name, price, quantity, etc.) are being correctly pushed. You can also see which tags fired and what data they sent out.
You can also use the Realtime reports in Google Analytics. When in Preview Mode, actions you take should appear in real-time reports under the Events or Conversions cards. This gives you instant confirmation that Analytics is receiving the data GTM is sending.
Final Thoughts
Setting up Enhanced Ecommerce (UA) or the recommended ecommerce events truly brings your store's data to life. It transforms Google Analytics from a simple traffic monitor into an indispensable tool for understanding what your customers want, how they shop, and where you can optimize their experience to increase revenue.
As you get comfortable analyzing your store's performance in GA, you'll soon realize it's just one piece of your data puzzle. At Graphed , we help you connect all your marketing and sales data - from Shopify and Google Analytics to social ad platforms like Facebook - into one unified view. Instead of dealing with code or complex BI tools, you can simply ask questions in plain English, like "Show me a dashboard of my marketing funnel from Facebook Ads clicks to Shopify purchases," and instantly get the answers you need in real time.
Related Articles
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.
How to Create a Photo Album in Meta Business Suite
How to create a photo album in Meta Business Suite — step-by-step guide to organizing Facebook and Instagram photos into albums for your business page.