E-commerce event tracking in GA4 relies on a well-structured data layer. This is typically populated by your e-commerce platform or custom code.
• Use the GA4 e-commerce schema for consistency.
• For platforms like WooCommerce, Magento, Shopify, or Shopware, use official plugins or extensions to inject the correct data layer.
To send e-commerce details to GA4, you need to create variables that extract values from the data layer:
view_item_list
select_item
view_item
add_to_cart
remove_from_chart
view_cart
add_to_wishlist
start_checkout
add_shipping_info
add_payment_info
purchase
refund
view_promotion
select_promotion