Jon Dramond Jon Dramond
Reading Time: < 1 minute

If you operate an ecommerce platform, then being able to track purchases, customer journeys and other metrics is crucial to driving sales and pushing your business forward.

Developers and marketeers typically use platforms like Google Analytics to monitor transactions and other associated elements that make up the customer journey, with a granular level of data available.

By setting up enhanced e-commerce, you can gain an even greater insight into your audience and their behaviours, and establish a benchmark and framework for delivering improvements in the future.

This includes when customers added items to their cart, when they started the check-out process and when they completed a purchase.

You can also monitor activity around abandoned carts and use the insight to reduce the frequency of incomplete customer journeys, increasing the sales conversion rate and ultimately provide a boost to your bottom line.

Advanced ecommerce works seamlessly with Magento 2 to help you establish a robust and intelligent platform.

Get a Google Tag Manager account

The first step is to ensure you have an active Google Tag Manager account.

The Tag Manager allows you to keep a handle on active tags and code snippets attached to campaign events and lets you add and track tags to your site in order to gain an insight into audience behaviours.

You can also personalise, retarget or implement new search engine marketing initiatives, as Tag Manager will directly transfer data to your Analytics account to produce a clear picture of how well your site and its products are performing.

Naturally, Tag Manager is a key prerequisite for setting up advance e-commerce and it is relatively straightforward to configure your account and Magento store to create your first tag.

You can then set up your Universal Analytics / Analytics 4 account.

Set up Enhanced Ecommerce

To begin setting up Enhanced E-Commerce, you first sign into your Analytics account and then create a new property with the following configuration:

StatusĀ  – ON

Related Products – ON

Enable Enhanced Ecommerce Reporting – ON

Checkout Labelling – (not required)

When you the options have been set you can click Submit.

Build your tags and triggers

The next step is to create the tags and triggers that will respond in the right way to events and track the correct behaviours.

Sign in to Google Tag Manager and create the following triggers:

Name: AddToCart
Event type: Custom Event
Filter [Leave blank]

Name: Checkout
Event type: Custom Event
Filter: [Leave blank]

Name: Checkout only
Event type: Page View
Filter: Page URL matches RegEx /checkout/.*

Name: CheckoutOption
Event type: Custom Event
Filter: [Leave blank]

Name: gtm.dom
Event type: Custom Event
Filter: [Leave blank]

Name: ProductClick
Event type: Custom Event
Filter: [Leave blank]

Name: PromotionClick
Event type: Custom Event
Filter: [Leave blank]

Name: RemoveFromCart
Event type: Custom Event
Filter: [Leave blank]

Universal Analytics Tags

Name: Add to cart tracking
Type: Universal Analytics
Firing Triggers: AddToCart

Name: Checkout option tracking
Type: Universal Analytics
Firing Triggers: CheckoutOption

Name: Checkout tracking
Type: Universal Analytics
Firing Triggers: Checkout

Name: Pageview tracking
Type: Universal Analytics
Firing Triggers: gtm.dom

Name: Product click tracking
Type: Universal Analytics
Firing Triggers: ProductClick

Name: Promo click tracking
Type: Universal Analytics
Firing Triggers: PromotionClick

Name: Remove from cart tracking
Type: Universal Analytics
Firing Triggers: RemoveFromCart

Basic Tag Configuration

Setting: Product
Value: Google Analytics

Setting: Tag Type
Value: Universal Analytics

Setting: Tracking ID
Value: UA-XXX (Input your tracking ID)

Setting: Enhanced Ecommerce Features
Value: True

Setting: Use data layer
Value: True

Setting: Use Debug version
Value: True

Add individual tracking configurations

The next task is adding the individual tracking configurations. Enter the following Add to Cart tacking settings:

Setting: Track Type
Value: Event

Setting: Category
Value: Ecommerce

Setting: Action
Value: Add to Cart

Setting: Trigger
Value: Add to Cart

Next, set the Checkout option tracking options:

Setting: Track Type
Value: Event

Setting: Category
Value: Checkout Option

Setting: Action
Value: Checkout Option

Setting: Trigger
Value: CheckoutOption

Then add the following Product Click tracking configuration:

Setting: Track Type
Value: Event

Setting: Category
Value: Ecommerce

Setting: Action
Value: Product Click

Setting: Trigger
Value: ProductClick

The next job is to complete the following Promotion Click tracking settings:

Setting: Track Type
Value: Event

Setting: Category
Value: Ecommerce

Setting: Action
Value: Promotion Click

Setting: Trigger
Value: PromotionClick

Finally, ensure the Remove from Cart tracking is configured:

Setting: Track Type
Value: Event

Setting: Category
Value: Ecommerce

Setting: Action
Value: Remove from Cart

Setting: Trigger
Value: RemoveFromCart

Once you have completed these steps, you should be in a position to first preview the changes you have made and verify that the tags are working the way they should be.

After you have verified these settings you can publish and begin enjoying the advantages of Advanced Commerce tracking on Magento 2 through Enhanced E-Commerce.