Enhanced Ecommerce Tracking in Google Analytics provides a comprehensive view of the customer journey, from product impressions to purchases. This module will guide you through setting up and utilizing Enhanced Ecommerce Tracking to gain deeper insights into your ecommerce performance.
Key Concepts
-
Enhanced Ecommerce Overview:
- Enhanced Ecommerce provides detailed data on user interactions with products on your site.
- It includes data on product impressions, clicks, views, add-to-cart actions, and transactions.
-
Benefits of Enhanced Ecommerce:
- Detailed insights into the shopping behavior of users.
- Ability to track the performance of individual products and categories.
- Enhanced reporting on the checkout process and drop-off points.
-
Components of Enhanced Ecommerce:
- Product Impressions: Tracking when a product is viewed.
- Product Clicks: Tracking when a product is clicked.
- Product Detail Views: Tracking when a product detail page is viewed.
- Add/Remove from Cart: Tracking when a product is added or removed from the cart.
- Checkout Process: Tracking each step of the checkout process.
- Transactions: Tracking completed purchases.
Setting Up Enhanced Ecommerce Tracking
Step 1: Enable Enhanced Ecommerce in Google Analytics
-
Navigate to Admin:
- Go to your Google Analytics account.
- Click on the Admin tab.
-
Enable Enhanced Ecommerce:
- In the View column, click on Ecommerce Settings.
- Toggle the Enable Enhanced Ecommerce Reporting switch to ON.
- Click Next Step and then Submit.
Step 2: Implement Enhanced Ecommerce Tracking Code
Enhanced Ecommerce tracking requires additional code to be added to your website. This can be done using Google Tag Manager (GTM) or directly in your site's code.
Using Google Tag Manager
-
Create a New Tag:
- Go to your GTM account.
- Click on Tags and then New.
-
Configure Tag:
- Choose Tag Type as Google Analytics: Universal Analytics.
- Set Track Type to Event.
- Fill in the necessary fields (Category, Action, Label, Value).
-
Enable Enhanced Ecommerce:
- Check the box for Enable Enhanced Ecommerce Features.
- Add the necessary Ecommerce data layer variables.
-
Trigger the Tag:
- Set up triggers for the tag based on user interactions (e.g., product impressions, clicks, add-to-cart).
-
Publish the Container:
- Save the tag and publish the container.
Direct Implementation
- Add Data Layer Code:
- Add the following code to your website's pages where you want to track ecommerce interactions:
<script> dataLayer.push({ 'event': 'eec.impression', 'ecommerce': { 'currencyCode': 'USD', // Local currency 'impressions': [ { 'id': 'P12345', // Product ID 'name': 'Triblend Android T-Shirt', // Product Name 'category': 'Apparel', // Product Category 'brand': 'Google', // Product Brand 'variant': 'Gray', // Product Variant 'list': 'Search Results', // Product List 'position': 1, // Product Position 'price': '15.25' // Product Price } // Additional products can be added here ] } }); </script>
- Track Product Clicks:
- Add the following code to track when a product is clicked:
<script> dataLayer.push({ 'event': 'eec.productClick', 'ecommerce': { 'click': { 'actionField': {'list': 'Search Results'}, // List where the product was clicked 'products': [{ 'name': 'Triblend Android T-Shirt', // Product Name 'id': 'P12345', // Product ID 'price': '15.25', // Product Price 'brand': 'Google', // Product Brand 'category': 'Apparel', // Product Category 'variant': 'Gray', // Product Variant 'position': 1 // Product Position }] } } }); </script>
- Track Add to Cart:
- Add the following code to track when a product is added to the cart:
<script> dataLayer.push({ 'event': 'eec.addToCart', 'ecommerce': { 'currencyCode': 'USD', 'add': { 'products': [{ 'name': 'Triblend Android T-Shirt', 'id': 'P12345', 'price': '15.25', 'brand': 'Google', 'category': 'Apparel', 'variant': 'Gray', 'quantity': 1 }] } } }); </script>
- Track Transactions:
- Add the following code to track completed transactions:
<script> dataLayer.push({ 'event': 'eec.purchase', 'ecommerce': { 'purchase': { 'actionField': { 'id': 'T12345', // Transaction ID 'affiliation': 'Online Store', // Store or affiliation 'revenue': '35.43', // Total transaction value 'tax': '4.90', // Tax amount 'shipping': '5.99', // Shipping cost 'coupon': 'SUMMER_SALE' // Applied coupon }, 'products': [{ 'name': 'Triblend Android T-Shirt', 'id': 'P12345', 'price': '15.25', 'brand': 'Google', 'category': 'Apparel', 'variant': 'Gray', 'quantity': 1, 'coupon': '' // Applied coupon for the product }] } } }); </script>
Practical Exercise
Exercise: Implement Enhanced Ecommerce Tracking for Product Impressions
- Objective: Track product impressions on the homepage of an ecommerce site.
- Steps:
- Add the data layer code for product impressions to the homepage.
- Ensure the code includes at least three products with different IDs, names, categories, and prices.
- Solution:
<script> dataLayer.push({ 'event': 'eec.impression', 'ecommerce': { 'currencyCode': 'USD', 'impressions': [ { 'id': 'P12345', 'name': 'Triblend Android T-Shirt', 'category': 'Apparel', 'brand': 'Google', 'variant': 'Gray', 'list': 'Homepage', 'position': 1, 'price': '15.25' }, { 'id': 'P67890', 'name': 'Organic Cotton T-Shirt', 'category': 'Apparel', 'brand': 'Google', 'variant': 'Blue', 'list': 'Homepage', 'position': 2, 'price': '20.00' }, { 'id': 'P54321', 'name': 'Polyester T-Shirt', 'category': 'Apparel', 'brand': 'Google', 'variant': 'Red', 'list': 'Homepage', 'position': 3, 'price': '10.00' } ] } }); </script>
Common Mistakes and Tips
-
Mistake: Forgetting to enable Enhanced Ecommerce in Google Analytics.
- Tip: Always double-check that Enhanced Ecommerce is enabled in the Ecommerce Settings of your Google Analytics view.
-
Mistake: Incorrectly formatted data layer code.
- Tip: Validate your data layer code using the Google Tag Assistant Chrome extension to ensure it is correctly formatted and firing as expected.
-
Mistake: Not setting up triggers correctly in Google Tag Manager.
- Tip: Test your triggers thoroughly in GTM's Preview mode before publishing.
Conclusion
Enhanced Ecommerce Tracking provides powerful insights into your ecommerce site's performance. By setting up and utilizing Enhanced Ecommerce, you can track detailed user interactions and optimize your site for better conversions. In the next module, we will explore how to set up and track custom dimensions and metrics to further enhance your data analysis capabilities.
Google Analytics Course
Module 1: Introduction to Google Analytics
- What is Google Analytics?
- Setting Up a Google Analytics Account
- Understanding the Google Analytics Interface
- Basic Terminology and Concepts
Module 2: Tracking and Reporting
- Setting Up Tracking Code
- Understanding Real-Time Reports
- Audience Reports
- Acquisition Reports
- Behavior Reports
- Conversion Reports
Module 3: Advanced Tracking and Customization
- Setting Up Goals
- Event Tracking
- Enhanced Ecommerce Tracking
- Custom Dimensions and Metrics
- Using Filters
- Setting Up Custom Alerts
Module 4: Data Analysis and Interpretation
Module 5: Integration and Automation
- Integrating Google Analytics with Google Ads
- Integrating Google Analytics with Search Console
- Automating Reports with Google Data Studio
- Using Google Tag Manager
Module 6: Advanced Techniques and Best Practices
- Advanced Segmentation Techniques
- Custom Reporting
- Advanced Attribution Modeling
- Data Sampling and Accuracy
- Best Practices for Data Privacy and Compliance