After installing Google Tag Manager for your Magento 2 store, now time to add User-defined variables into GTM.
We prepare User-defined variables for next step: Configure Google Analytics eCommerce Tracking.

User-defined variables

Mageplaza GTM adds dataLayer information for Product Page, Category, Checkout page, and Checkout Success Page. Let's take action for this step-by-step guide to add a user-defined variable for your Magento 2 store.

How to add a user-defined variables:

add a user-defined variables

Here is the list of user-defined variables:

Product Page catalog_product_view

ecommerce.currencyCode
ecommerce.detail.products.id
ecommerce.detail.products.name
ecommerce.detail.products.sku
ecommerce.detail.products.price
ecommerce.detail.products.brand
ecommerce.detail.products.variant (Color)
ecommerce.detail.products.attribute_set_id
ecommerce.detail.products.attribute_set_name
ecommerce.detail.products.category
ecommerce.detail.products.category_path


Category view: catalog_category_view

ecommerce.currencyCode
ecommerce.impressions
ecommerce.impressions.products.id
ecommerce.impressions.products.name
ecommerce.impressions.products.sku
ecommerce.impressions.products.price
ecommerce.impressions.products.brand
ecommerce.impressions.products.variant (Color)
ecommerce.impressions.products.category_path


Checkout page: /checkout/index and /checkout/cart

event
ecommerce.checkout.hasItems
ecommerce.checkout.hasCoupon
ecommerce.checkout.coupon
ecommerce.checkout.total

ecommerce.products
ecommerce.products.id
ecommerce.products.name
ecommerce.products.sku
ecommerce.products.price
ecommerce.products.brand
ecommerce.products.variant (Color)
ecommerce.products.quantity
ecommerce.products.attribute_set_id
ecommerce.products.attribute_set_name


Checkout success page: /checkout/onepage/success/

ecommerce.purchase.actionField.coupon
ecommerce.purchase.actionField.id
ecommerce.purchase.actionField.affiliation
ecommerce.purchase.actionField.order_id
ecommerce.purchase.actionField.subtotal
ecommerce.purchase.actionField.shipping
ecommerce.purchase.actionField.tax
ecommerce.purchase.actionField.total
ecommerce.purchase.actionField.discount
ecommerce.purchase.products.id
ecommerce.purchase.products.name
ecommerce.purchase.products.sku
ecommerce.purchase.products.price
ecommerce.purchase.products.brand
ecommerce.purchase.products.variant (Color)
ecommerce.purchase.products.quantity
ecommerce.purchase.products.attribute_set_id
ecommerce.purchase.products.attribute_set_name
Was this article helpful?
Cancel
Thank you!