Google Analytics 3 / Universal Analytics – Enhanced Ecommerce tracking – How to setup?
WARNING!
Universal Analytics was turned down by Google. It is not recommended to setup this ecommerce tracking on new WooCommerce sites. Setup Google Analytics 4 ecommerce tracking instead. If you are on Google Analytics 360 and wants to keep using Universal Analytics tags in Google Tag Manager, this page will be updated to use an easier way to use ecommerce data.
Step 0: pre-setup checks
Before you get started please review the following checklist to ensure everything is setup properly on your side:
Please note that you can not use both standard/classic ecommerce and enhanced ecommerce in your Analytics views. You can activate both tracking code in GTM4WP options to make sure you can use both tracking codes if you are using multiple Google Analytics tracking IDs on your site.
For a specific Google Analytics tracking ID, you should only use either standard OR enhanced ecommerce. The recommended tracking code is the enhanced version, standard ecommerce tracking is deprecated and will be removed later in 2021.
Enabling Enhanced Ecommerce preserves you existing ecommerce data in your Analytics views. Transactions and product data collected using the standard ecommerce tracking will be available in your new reports as well.
Please note that since WooCommerce does not have any internal promotion system by default, this plugin does not utilize Internal Promotion tracking of Enhanced Ecommerce. This can change in future versions.
If you are using a Google Tag Manager variable of type “Google Analytics” to keep GA settings in one place, do NOT turn on enhanced ecommerce in this GTM variable.
Step 1: enable enhanced ecommerce in plugin settings
- Open plugin settings page in your WordPress admin area located under Settings / Google Tag Manager
- Click on the Integration tab
- Click on the WooCommerce sub-tab
- Check the box next to the label Track enhanced e-commerce
- Enter the number of products to track in a single batch on pages with product lists. 10 should be a good start.
- Click Save changes at the bottom of the screen
Step 2: check the tag type of your Google Analytics main pageview tag
- Open your Google Analytics pageview tag in Google Tag Manager
- Check the value of Tag Type
- If you see Google Analytics: Classic, you have to upgrade your Google Tag Manager setup to use “Google Analytics: Universal Analytics” tags.
- If you see Google Analytics: Universal Analytics, you are ready to move on
Step 3: deactivate your transaction tag
If you are already using standard ecommerce tracking in your Google Tag Manager container, you should already have a tag with “Track Type” set to “Transaction”. If you haven’t setup standard ecommerce tracking yet, you can skip this step.
- Open your Google Analytics tag where the “Track Type” field is set to “Transaction”
- Delete the tag from your Google Tag Manager container
Step 4: enable Enhanced Ecommerce in your Google Analytics pageview tag
If you are a new plugin user installing v1.13+ then this step is no longer required.
If you are migrating v1.11 / v1.12 ⇒ v1.13 then please deactivate the enhanced ecommerce option in your Google Analytics Page View tag:
- Uncheck the “Use Data Layer” checkbox
- Set “Enable Enhanced Ecommerce Features” to false
- If you haven’t overridden any other settings in the “More Settings “section, please uncheck the “Enable overriding settings in this tag” checkbox
- Save the changes in your Google Analytics Page View tag
If you are using a Google Tag Manager variable of type “Google Analytics” to keep GA settings in one place, do NOT turn on enhanced ecommerce in this variable. You will track interactions that are not part of ecommerce tracking. Turning this on could cause to collect the same ecommerce action multiple times.
(screenshot outdated and removed)
Instead, leave enhanced ecommerce off in your Google Analytics Settings variable and use the override feature in your tags.
Open your Google Analytics pageview tagEnable overriding settingsScroll down to the More settings sectionClick on More settings if this section is closed upSelect “True” in the Ecommerce features sectionCheck Use data layerSave your tag
(screenshot outdated and removed)
Enabling this will activate tracking of the following ecommerce actions:
Product detail pageCheckout funnel first stepTransaction/order tracking
Step 5: setup tracking ecommerce interactions
- Create a new trigger in your Google Tag Manager container
- Select the trigger type: Custom Event
- Add the following event name value: gtm4wp.productClickEEC|gtm4wp.addProductToCartEEC|gtm4wp.removeFromCartEEC|gtm4wp.checkoutOptionEEC|gtm4wp.checkoutStepEEC|gtm4wp.changeDetailViewEEC|gtm4wp.orderCompletedEEC
- Turn on the Use regex matching checkbox
- Name the trigger as you wish (for example: ‘Event – Ecommerce Events’)
- Save the new trigger
Then:
- Create a new tag
- Tag Type should be Google Analytics: Universal Analytics
- Track Type should be Event
- Set values to Event Category, Event Action and optionally Event Label
- My suggestions:
- Event Category = Ecommerce helper
- Event Action = {{Event}}
- Event Label can stay empty: many people want to add product name into this parameter but this is not needed, ecommerce reports will be much more useful
- Select your Google Analytics settings variable (just like in your pageview tag)
- Enable overriding settings
- Scroll down to the More settings section
- Click on More settings if this section is closed up
- Select “True” in the Ecommerce features section
- Check Use data layer
- Add the previously created ecommerce event trigger
- Save your new tag
Enabling this will activate tracking of the following ecommerce actions:
- Product list clicks
- Add to cart
- Remove from cart
- Product detail views on variable product pages
- Checkout steps after the first step
- Selecting checkout options (shipping method and payment method)
Step 6: setup product impression tracking
Steps are the same as in Step 5 but with a different event name and a slightly modified Google Analytics event tag.
- Create a new trigger in your Google Tag Manager setup
- Select the trigger type: Custom Event
- Add the following event name value: gtm4wp.productImpressionEEC
- Name the trigger as you wish (for example: ‘Event – Ecommerce Product Impressions’)
- Save the new trigger
- Create a new tag
- Tag Type should be Google Analytics: Universal Analytics
- Track Type should be Event
- Set values to Event Category, Event Action and optionally Event Label
- My suggestions:
- Event Category = Ecommerce helper
- Event Action = {{Event}}
- Set Non-Interaction Hit to true – this will ensure that this tag does not mess with your bounce rate
- Select your Google Analytics settings variable (just like in your pageview tag)Scroll down to the More settings section
- Enable overriding settings
- Scroll down to the More settings section
- Click on More settings if this section is closed up
- Select “True” in the Ecommerce features section
- Check Use data layer
- Add the previously created ecommerce product impression trigger
- Save your new tag
All done!
At this point you setup everything to track enhanced ecommerce in your WooCommerce store. Enjoy! 🙂