ACP2E-5176: Ecommerce events sent to Google Analytics 4 through Google Tag Manager use Universal Analytics format and omit checkout events

The ACP2E-5176 patch fixes the issue where ecommerce events sent to Google Analytics 4 through Google Tag Manager use the Universal Analytics format and omit several checkout events. This patch is available when the Quality Patches Tool (QPT) 1.1.86 is installed. The patch ID is ACP2E-5176. Please note that this issue is scheduled to be fixed in Adobe Commerce 2.4.10.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) 2.4.8-p5

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.4.7 - 2.4.9
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.

Issue

Ecommerce events sent to Google Analytics 4 through Google Tag Manager use the Universal Analytics format and omit several checkout events.

Steps to reproduce:

  1. In the Admin panel, go to Stores > Settings > Configuration > Sales > Google API.
  2. Expand Google Analytics and make sure Enable is set to No.
  3. Expand Google GTag > Google Analytics4, clear Use system value, set Enable to Yes and Account type to Google Analytics4, enter a test Measurement ID (for example, G-12345678), and click Save Config.
  4. Go to System > Tools > Cache Management and click Flush Magento Cache.
  5. On the Storefront, watch the events pushed to window.dataLayer with the browser developer tools console or an analytics debugger extension.
  6. Open a product page and click Add to Cart.
  7. Open the shopping cart page, click Proceed to Checkout, fill in the shipping address, select a shipping method, click Next, and select a payment method.

Expected results:

  1. Add to Cart sends an add_to_cart event in the GA4 ecommerce format, with the product in the items list.
  2. The view_cart, begin_checkout, add_shipping_info, and add_payment_info events are sent in the GA4 ecommerce format.

Actual results:

  1. Add to Cart pushes an addToCart event in the Universal Analytics format, with the product under ecommerce.add.products.
  2. No view_cart, begin_checkout, add_shipping_info, or add_payment_info event is sent.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

To learn more about Quality Patches Tool, refer to:

recommendation-more-help
commerce-operations-help-tools