Configuring e-commerce tracking with Google Tag Manager (GTM) allows you to track important e-commerce events, such as purchases, product impressions, and cart interactions, in your Google Analytics account. Here’s a step-by-step guide on how to set it up:
Table of Contents
Toggle1. Enable E-commerce in Google Analytics
Before setting up e-commerce tracking in GTM, make sure e-commerce tracking is enabled in your Google Analytics property settings.
- Sign in to your Google Analytics account.
- Go to the Admin section.
- Under the View column, click on E-commerce Settings.
- Toggle the Enable E-commerce option to ON.
- Optionally, enable Enhanced E-commerce Settings if you want to track additional data like product impressions and promotions.
- Save your changes.
2. Set Up Data Layer
- To track e-commerce events with GTM, you need to have the relevant data available in the data layer. Ensure that your website’s developer has implemented the necessary data layer variables for e-commerce events such as product details, transaction information, and user interactions.
3. Create Triggers
Create triggers in GTM to fire tags when specific e-commerce events occur on your website. Common triggers for e-commerce tracking include:
- Product Clicked: Fires when a user clicks on a product.
- Add to Cart: Fires when a product is added to the shopping cart.
- Remove from Cart: Fires when a product is removed from the shopping cart.
- Checkout Started: Fires when the user starts the checkout process.
- Purchase Completed: Fires when a purchase is completed.
4. Set Up Tags
For each e-commerce event you want to track, create corresponding tags in GTM. These tags will send data to Google Analytics.
- Google Analytics Pageview Tag: This tag should be set up to fire on all pages of your website to track pageviews.
- Google Analytics Event Tags: Create event tags for each e-commerce event you want to track (e.g., product clicked, add to cart, purchase completed). Configure these tags to send the appropriate data to Google Analytics, including e-commerce data when relevant.
- Google Analytics Enhanced E-commerce Tags: If you’ve enabled Enhanced E-commerce, set up additional tags to track product impressions, promotions, and other enhanced e-commerce data.
5. Configure Variables
- Configure variables in GTM to capture data from the data layer and pass it to your tags. This includes variables for product details, transaction information, and any other data you want to track.
6. Test and Debug
- Once you’ve set up your e-commerce tracking in GTM, use the preview mode to test your implementation. Verify that the tags fire correctly and that the data is being sent to Google Analytics as expected.
7. Publish Changes
- Once you’ve tested your e-commerce tracking setup and confirmed that it’s working correctly, publish your changes in GTM to make them live on your website.
By following these steps, you can configure e-commerce tracking with Google Tag Manager and start collecting valuable data about user interactions and transactions on your website.