If visitors to a physical store keep asking: "Where do I find the headphones?" you can put headphones out right in front of the entrance :). But wait, how does that resonate with your online store?
Enhanced E-commerce tracking in Google Analytics 4 can help you answer all of the questions above. You’ll be able to map your customers’ journey from the very first visit to a conversion event - typically a sale. For example, you can:
Note: This post was originally published in May 2017 and was completely updated in April 2024 for accuracy and comprehensiveness on marketing analytics.
GA4 and Universal Analytics differ in their approach to e-commerce tracking. GA4 uses different schemas for tracking, such as 'item_name' instead of 'name' in Universal Analytics. The article provides a detailed comparison table for these schemas. Let us see some differences here:
Below, we’ll explore how to set up Enhanced E-commerce in Google Analytics 4 using Google Tag Manager.
Before setting up Enhanced E-commerce tracking, decide what activities you want to get data for. These include
You can send data from your website to Google Analytics using various tools such as,
In our opinion, the best tool for getting E-commerce data to Google Analytics 4 is Google Tag Manager. It makes it easy to add and update tags and code snippets on the website without involving developers.
In this article we’ll be talking about this way to collect data. Let’s take a closer look at each step of Enhanced E-commerce Tracking.
Create a Google Analytics Account: If you don’t have one, go to the Google Analytics website and sign up. It’s like creating a profile for a new game.
Set Up a GA4 Property: Inside Google Analytics, create a new property. This is where all your website's data will be collected. It's like setting up a base camp for your treasure hunt.
Sign Up for Google Tag Manager: Go to the Google Tag Manager website and create an account. This is like getting a map and tools for your treasure hunt.
You'll get a GTM code snippet. Place this code in the and (as instructed) of your website's HTML.
Understand the Data Layer: This is a bit like a digital diary that keeps track of what happens on your site (like someone viewing a product).
Implement the Data Layer: This requires adding JavaScript code to your website. If you're not comfortable with coding, you might need a web developer's help. This code will update the Data Layer with information about the user's interactions.
Push Information to the Data Layer: For each E-commerce action (like viewing a product list or clicking on a product), you need to push relevant information to the Data Layer. This includes details like product name, ID, price, brand, category, etc.
Log into GTM: Go to your Google Tag Manager dashboard.
Create a New Variable: Click on 'Variables' > 'New.'
Set Up the Variable: Name your variable (e.g., 'GA4 E-commerce DataLayer') and select 'Data Layer Variable' as the type.
Specify the Data Layer Variable Name: Enter the name that matches the key in your Data Layer push. For example, 'E-commerce.items' if you're tracking E-commerce items. After setting up the Data Layer variable, you'll create tags and triggers in GTM to send this data to GA4.
Creating a Data Stream: Navigate to 'Admin' → ‘Property Setting’ → ‘Data collection and modification’ → 'Data Streams' and select your web stream.
Enable E-commerce Settings: In the stream details, turn on 'Enhanced Measurement' and ensure that 'E-commerce' is enabled.
Setting Up E-commerce Events: List events like 'view_item', 'add_to_cart', 'begin_checkout', etc. Go to 'Events' in Google Analytics 4 and mark these events as 'Conversion' if necessary.
For each E-commerce event, create a new tag.
Configuration Tag: Select your GA4 Configuration Tag. Create a new tag for Google Analytics 4 E-commerce. Choose ‘Google Analytics: GA4 Configuration’. Enter your Measurement ID from Google Analytics 4 (found in your GA4 property under Data Streams).
Set Up Triggers: Create triggers that fire these tags. For instance, a trigger for 'add_to_cart' might be a click on the 'Add to Cart' button. Choose ‘All Pages’.
Create Tags for E-commerce Events: For each E-commerce event, create a new tag. For example ‘GA4 E-commerce’.
Tag Type: Choose 'GA4 Event'.
Configuration Tag: Pick your GA4 Configuration Tag. Choose the 'GA4 E-commerce | page view' tag that we've established.
Event Name: Enter the corresponding event name (e.g., 'add_to_cart'). Create new tags for different E-commerce events like view_item, add_to_cart, begin_checkout, etc.
Alternatively, you can utilize a variable that dynamically transmits the type of E-commerce action to our event tag. This allows you to employ a singular tag for sending various E-commerce events such as 'add to cart,' 'purchase,' and others to GA4.
Event Parameters: Add relevant parameters like 'currency', 'value', 'items', etc. We have the ability to create custom events using the following icon.
Proceed to select 'More settings', enable the 'Send E-commerce data' option, and keep the Data layer selected. This ensures automatic retrieval of E-commerce details from the data layer, transmitting them alongside our event to Google Analytics 4.
Set Up Triggers: Create triggers that fire these tags. For instance, a trigger for 'add_to_cart' might be a click on the 'Add to Cart' button. Go to Trigger Configuration→ Custom Event. Enter the data layer event name → enable the ‘User Regex Matching’ option so that ‘_’ will be considered as regular expressions. Google has a list of recommended E-commerce events separated by ‘_,’ and we can enter them all in custom event names. As a final step, ‘save’ the trigger and ‘save’ the tag as well.
Preview Mode: Use GTM's preview mode to test your tags. Select the "Preview" option located in the top-right corner of the Google Tag Manager interface. This activates the Preview mode, allowing you to inspect how tags fire on your site in a test environment. Open your website in a fresh browser tab. The Preview mode will display debug information, showing you which tags are fired and allowing you to confirm that they are working as expected. We can use ‘Debug view’ in GA4 to preview the reports.
Check-in GA4: Verify that events are being recorded in GA4's real-time report. Go to the "Reports" segment and choose "Realtime" to access live data. Perform actions on your website that trigger the events you've set up in GTM (e.g., clicking a button or making a purchase).
In the GA4 Real-Time report, you should see these events being recorded almost instantly. Verify that the events match your expectations and that data is flowing correctly from your website to GA4.
After implementing Enhanced E-commerce via Google Analytics 4 (GA4) and Google Tag Manager (GTM), delve into a variety of funnel reports that deliver crucial insights into customer behavior and assess the efficiency of your E-commerce infrastructure. These funnels are crucial for understanding how users interact with your site, from initial engagement to final purchase. Here are the types of funnels you can expect to see:
Overview of User Journey: Tracks how users move through the shopping process, from viewing products to completing a purchase.
Stages: Typically includes stages like 'Product View', 'Add to Cart', 'Checkout Initiation', and 'Transaction'.
Insights: Helps identify where customers drop off in the shopping process, allowing for targeted improvements.
Detailed Checkout Process: Analyzes user progression through the checkout stages.
Stages: Can include 'Billing and Shipping Information', 'Payment Information', 'Review Order', and 'Purchase'.
Insights: Useful for pinpointing issues in the checkout process that may be causing cart abandonment.
Product Interactions: Examines how users interact with specific products.
Stages: Includes 'Product Views', 'Add to Cart', and 'Purchases'.
Insights: Identifies popular products or those with high drop-off rates, guiding inventory and marketing strategies.
Repeat Purchases and Engagement: Focuses on customer retention and repeat purchases.
Stages: Involves 'First Purchase', 'Second Purchase', and subsequent purchases.
Insights: Highlights the effectiveness of loyalty programs and customer engagement strategies.
Multi-Channel Attribution: Tracks the various paths customers take before conversion.
Stages: Includes different touchpoints like organic search, paid ads, social media, etc.
Insights: Offers a comprehensive view of how different marketing channels contribute to conversions.
Cart and Checkout Abandonment: Focuses on where and why customers abandon their carts or checkout process.
Stages: Identifies points like 'Added to Cart' but not 'Checked Out', or 'Checked Out' but not 'Purchased'.
Insights: Crucial for understanding barriers in the purchasing process and for devising strategies to reduce abandonment.
Product List Interactions: Analyzes how users interact with product lists or categories.
Stages: Includes 'List Views', 'Product Clicks', 'Product Detail Views', etc.
Insights: Useful for optimizing product placements and category layouts.
Promotion Effectiveness: Assesses the impact of marketing campaigns and promotions.
Stages: Tracks user interaction with promotional content, leading to purchases.
Insights: Helps in evaluating the ROI of marketing campaigns and in planning future promotions.
Post-Purchase Behavior: Focuses on post-purchase activities like refunds and returns.
Stages: Tracks 'Purchases,' 'Returns Initiated,' and 'Refunds Processed.'
Insights: Aids in understanding product satisfaction and the effectiveness of return policies.
Additional Purchases: Analyzes customer behavior in response to cross-sell and up-sell strategies.
Stages: Includes initial purchase followed by additional product recommendations and subsequent purchases.
Insights: Helps in optimizing product recommendations and increasing average order value.
These funnels in Google Analytics 4, powered by Enhanced E-commerce tracking, provide a wealth of data that can be used to optimize your E-commerce strategy, increase conversions and revenue, and ultimately improve user experience. Remember, the specific funnels and their configurations can vary based on how you set up Enhanced E-commerce tracking and the unique aspects of your E-commerce business.
Part of the orders placed on the website might not be completed. Your customers might return their purchases or simply not pick them up. What can you do, considering that you can’t change the data already sent to Google Analytics 4 while refunds and cancellations distort the statistics?
In such cases, you can send refund information to Google Analytics 4. This will not affect the revenue data received before, but you’ll be able to take into account the amount of refunds and their number in the reports.
The refund data can be sent to Google Analytics 4 in two ways:
Proper showcasing helps increase sales. For example, buyers most often pay attention to the shelves at their eye level. Therefore, if there are products you want to sell first, it’s better to place them on such shelves.
How does that translate to your online store? How do you know which "showcases" and "shelves" on the website have the most products sold? Use the Product List Performance report to measure the performance of merchandising blocks on the website. The report is available in the Monetisation → Goals group of reports.
The report shows what blocks are viewed most often, products in what blocks are most often clicked on or added to shopping carts, and what product lists have the highest conversion rates and contribute to sales. You have the option to personalize the report by selecting 'Edit Comparisons,' and you can also share the report as needed.
It’s important to pay attention to how Product Attribution works, in other words, how to correctly send data with the dataLayer. This will help see correct information for each product block and accurately attribute value from product lists that users interacted with before making a purchase.
It’s not necessary to send the list attribute (list) with every E-commerce activity. For example, a user visits a product page A, sees a product B in the "Often bought together" list, clicks on it, and makes a purchase — all the shopping activities in one session. In this case, it’s enough to specify the list attribute for the first action, i.e., the first interaction with the list. Google Analytics 4 will then associate the list attribute to all the funnel steps in the user’s journey to buying product B. More information about Product Attribution can be found in the Google Analytics 4 Help.
Thanks for reading! We’ve prepared some more useful information for afterward :) Enter your email address, and we’ll send a detailed guide to getting offline data (such as data about order fulfillment and purchases made over the phone) to Google Analytics 4 via the Measurement Protocol.
To troubleshoot Enhanced E-commerce Tracking issues, first ensure that Enhanced E-commerce is enabled in Google Analytics settings. Verify the correct implementation of tracking codes on all relevant pages and check that e-commerce data is accurately pushed to the Data Layer. Use Google Analytics 4 real-time reports and browser developer tools to inspect network requests and identify any discrepancies or errors in data collection and reporting.
To set up E-commerce tracking in GA4:
- Enable Enhanced E-commerce by creating custom events for E-commerce actions.
- Configure these events with relevant parameters for accurate data capture.
- Monitor and analyze E-commerce data in GA4 to optimize your online store's performance.
- GA4 is vital for E-commerce due to its advanced tracking capabilities and integration with Google tools.
- Enable Enhanced Measurement tracking by toggling on the "E-commerce" option in your web data stream settings.
These steps will help you effectively track and analyze E-commerce performance in GA4.
To enable Enhanced Measurement tracking in GA4, go to your GA4 property, navigate to "Data Streams," select your web data stream, and click on "Enhanced Measurement" under the "Configuration" section. Toggle on the "E-commerce" option to start tracking E-commerce events automatically.
GA4 is crucial for E-commerce because it offers advanced tracking capabilities like Enhanced E-commerce, cross-platform user tracking, and better integration with other Google tools. It provides deeper insights into user behavior, helps optimize marketing efforts, and ultimately leads to improved sales and revenue in the competitive E-commerce landscape.
The main difference between standard E-commerce tracking and Enhanced E-commerce tracking in GA4 is the level of detail and flexibility. Enhanced E-commerce provides granular insights into shopping behavior, such as product impressions, clicks, promotions, and more, allowing you to analyze and optimize your E-commerce website's performance more effectively.
To track E-commerce data in GA4, you'll need to create custom events for each E-commerce action you want to track, such as product views, cart additions, and purchases. Configure these events with relevant parameters like "item_id," "item_name," and "value" to capture E-commerce data accurately.
To enable Enhanced E-commerce in Google Analytics 4 (GA4), you need to create custom events for E-commerce actions like "View Item," "Add to Cart," "Initiate Checkout," and "Purchase," and configure these events with relevant parameters. Enhanced E-commerce provides more detailed insights into user interactions and product performance on your website compared to standard tracking.