How to Set up and Track Enhanced E-commerce in Google Tag Manager

Author:

Setting up and tracking Enhanced E-commerce in Google Tag Manager (GTM) allows you to gain deeper insights into user interactions with your e-commerce store. Enhanced E-commerce provides detailed information on product impressions, clicks, purchases, and other e-commerce activities. Here’s a comprehensive step-by-step tutorial to help you implement Enhanced E-commerce tracking using GTM and Google Analytics.

 1. Enable Enhanced E-commerce in Google Analytics

1.1 Enable Enhanced E-commerce Reporting

  1. Log in to Google Analytics:
    • Open Google Analytics and select the property you want to configure.
  2. Navigate to Admin:
    • Click on the Admin tab at the bottom left of the sidebar.
  3. Enable Enhanced E-commerce:
    • In the View column, click on Ecommerce Settings.
    • Toggle Enable Ecommerce to ON.
    • Toggle Enable Enhanced Ecommerce Reporting to ON.
    • Click Save.

 2. Set Up GTM for Enhanced E-commerce

2.1 Create a Data Layer

  1. Add Data Layer to Your Website:
    • You need to add a Data Layer to your website’s code. This Data Layer will contain the Enhanced E-commerce data you want to track.
  1. Implement Data Layer for Specific E-commerce Events:
    • For various e-commerce events (e.g., product impressions, product clicks, purchases), you need to push corresponding data to the Data Layer.

2.2 Set Up Triggers for E-commerce Events

  1. Create Triggers:
    • In GTM, go to Triggers and create new triggers for each e-commerce event you want to track (e.g., product impressions, product clicks, purchases).

Example of a trigger for product impressions:

  • Trigger Configuration:
    • Trigger Type: Custom Event
    • Event Name: productImpression

Example of a trigger for purchases:

  • Trigger Configuration:
    • Trigger Type: Custom Event
    • Event Name: purchase

 3. Create Tags for Enhanced E-commerce in GTM

3.1 Create a Universal Analytics Tag

  1. Create a New Tag:
    • In GTM, go to Tags and click New.
  2. Configure Tag:
    • Click on Tag Configuration and select Google Analytics: Universal Analytics.
  3. Set Tag Type and Track Type:
    • Tag Type: Universal Analytics
    • Track Type: Event
  4. Configure Event Tracking Parameters:
    • Category: Ecommerce
    • Action: {{Event}}
    • Label: {{Event}}
  5. Enable Enhanced E-commerce Features:
    • Check the box for Enable Enhanced Ecommerce Features.
    • Set Use Data Layer to True.
  6. Set Google Analytics Settings Variable:
    • Select or create a Google Analytics Settings Variable with your tracking ID.
  7. Set Trigger:
    • Choose the appropriate trigger created earlier (e.g., productImpression, purchase).
  8. Save and Publish the Tag:
    • Save the tag and publish the container.

 4. Validate and Test the Implementation

4.1 Use GTM Preview Mode

  1. Enter Preview Mode:
    • In GTM, click on Preview to enter the debug mode.
  2. Test Your Website:
    • Navigate your website and perform actions like viewing products, adding products to the cart, and completing purchases.
    • Ensure that the Data Layer is populated correctly and the appropriate tags are fired.

4.2 Verify Data in Google Analytics

  1. Check Real-Time Reports:
    • In Google Analytics, go to Real-Time > Events to verify that events are being recorded correctly.
  2. Check E-commerce Reports:
    • Go to Conversions > Ecommerce > Overview to verify that e-commerce data is being tracked correctly.

 5. Implement Additional E-commerce Features

5.1 Track Product Detail Views

  1. Push Data to the Data Layer:
    • When a user views a product detail page, push the product data to the Data Layer.
  1. Create Trigger and Tag:
    • Create a custom event trigger for productDetailView.
    • Create a Universal Analytics tag and set it to fire on the productDetailView event.

5.2 Track Add to Cart Events

  1. Push Data to the Data Layer:
    • When a user adds a product to the cart, push the product data to the Data Layer.
  1. Create Trigger and Tag:
    • Create a custom event trigger for addToCart.
    • Create a Universal Analytics tag and set it to fire on the addToCart event.

 6. Advanced E-commerce Tracking

6.1 Track Checkout Steps

  1. Push Checkout Data to the Data Layer:
    • When a user progresses through the checkout process, push the checkout data to the Data Layer.
  1. Create Trigger and Tag:
    • Create a custom event trigger for checkout.
    • Create a Universal Analytics tag and set it to fire on the checkout event.

6.2 Track Promotions and Coupon Use

  1. Push Promotion Data to the Data Layer:
    • When a promotion is viewed or clicked, push the promotion data to the Data Layer.
  1. Create Trigger and Tag:
    • Create custom event triggers for promotionView and promotionClick.
    • Create Universal Analytics tags and set them to fire on these events.

By following this detailed tutorial, you can effectively set up and track Enhanced E-commerce in Google Tag Manager. This setup provides you with comprehensive insights into user interactions with your e-commerce store, enabling you to make data-driven decisions to optimize your online business. Regularly test and validate your implementation to ensure data accuracy and compliance with best practices.