-
-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Description
The view_cart event is being triggered on every page, not just the cart page or when the minicart is collapsed.
To Reproduce
Steps to reproduce the behavior:
- Install Yireo_GoogleTagManager2 on a Magento 2 store using the Hyvä Theme.
- Use the Ajax Add To Cart UI Component to add products to the cart.
- Observe the
view_cartevent in the browser’s GTM preview/debug mode.
Expected behavior
The view_cart event should only fire when the cart is actually viewed, not on every page.
Actual behavior
The view_cart event fires on all pages, regardless of whether the cart is viewed or not.
Environment
- Magento 2 version: 2.4.8-p2
- Yireo_GoogleTagManager2 version: 3.10.0
- Theme: Hyvä
- Other relevant modules: Ajax Add To Cart UI Component
Suggested solution (if any)
Consider restricting the view_cart event to only trigger on actual cart page views or when a user opens the mini-cart, rather than listening globally for cart updates.
Metadata
Metadata
Assignees
Labels
No labels