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.
Table of Contents
Toggle1. Enable Enhanced E-commerce in Google Analytics
1.1 Enable Enhanced E-commerce Reporting
- Log in to Google Analytics:
- Open Google Analytics and select the property you want to configure.
- Navigate to Admin:
- Click on the
Admintab at the bottom left of the sidebar.
- Click on the
- Enable Enhanced E-commerce:
- In the
Viewcolumn, click onEcommerce Settings. - Toggle
Enable EcommercetoON. - Toggle
Enable Enhanced Ecommerce ReportingtoON. - Click
Save.
- In the
2. Set Up GTM for Enhanced E-commerce
2.1 Create a Data Layer
- 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.
- 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
- Create Triggers:
- In GTM, go to
Triggersand create new triggers for each e-commerce event you want to track (e.g., product impressions, product clicks, purchases).
- In GTM, go to
Example of a trigger for product impressions:
- Trigger Configuration:
- Trigger Type:
Custom Event - Event Name:
productImpression
- Trigger Type:
Example of a trigger for purchases:
- Trigger Configuration:
- Trigger Type:
Custom Event - Event Name:
purchase
- Trigger Type:
3. Create Tags for Enhanced E-commerce in GTM
3.1 Create a Universal Analytics Tag
- Create a New Tag:
- In GTM, go to
Tagsand clickNew.
- In GTM, go to
- Configure Tag:
- Click on
Tag Configurationand selectGoogle Analytics: Universal Analytics.
- Click on
- Set Tag Type and Track Type:
- Tag Type:
Universal Analytics - Track Type:
Event
- Tag Type:
- Configure Event Tracking Parameters:
- Category:
Ecommerce - Action:
{{Event}} - Label:
{{Event}}
- Category:
- Enable Enhanced E-commerce Features:
- Check the box for
Enable Enhanced Ecommerce Features. - Set
Use Data LayertoTrue.
- Check the box for
- Set Google Analytics Settings Variable:
- Select or create a Google Analytics Settings Variable with your tracking ID.
- Set Trigger:
- Choose the appropriate trigger created earlier (e.g.,
productImpression,purchase).
- Choose the appropriate trigger created earlier (e.g.,
- Save and Publish the Tag:
- Save the tag and publish the container.
4. Validate and Test the Implementation
4.1 Use GTM Preview Mode
- Enter Preview Mode:
- In GTM, click on
Previewto enter the debug mode.
- In GTM, click on
- 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
- Check Real-Time Reports:
- In Google Analytics, go to
Real-Time>Eventsto verify that events are being recorded correctly.
- In Google Analytics, go to
- Check E-commerce Reports:
- Go to
Conversions>Ecommerce>Overviewto verify that e-commerce data is being tracked correctly.
- Go to
5. Implement Additional E-commerce Features
5.1 Track Product Detail Views
- Push Data to the Data Layer:
- When a user views a product detail page, push the product data to the Data Layer.
- Create Trigger and Tag:
- Create a custom event trigger for
productDetailView. - Create a Universal Analytics tag and set it to fire on the
productDetailViewevent.
- Create a custom event trigger for
5.2 Track Add to Cart Events
- Push Data to the Data Layer:
- When a user adds a product to the cart, push the product data to the Data Layer.
- Create Trigger and Tag:
- Create a custom event trigger for
addToCart. - Create a Universal Analytics tag and set it to fire on the
addToCartevent.
- Create a custom event trigger for
6. Advanced E-commerce Tracking
6.1 Track Checkout Steps
- Push Checkout Data to the Data Layer:
- When a user progresses through the checkout process, push the checkout data to the Data Layer.
- Create Trigger and Tag:
- Create a custom event trigger for
checkout. - Create a Universal Analytics tag and set it to fire on the
checkoutevent.
- Create a custom event trigger for
6.2 Track Promotions and Coupon Use
- Push Promotion Data to the Data Layer:
- When a promotion is viewed or clicked, push the promotion data to the Data Layer.
- Create Trigger and Tag:
- Create custom event triggers for
promotionViewandpromotionClick. - Create Universal Analytics tags and set them to fire on these events.
- Create custom event triggers for
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.
