woocommerce / woocommerce-google-analytics-integration

WordPress plugin: Provides the integration between WooCommerce and Google Analytics.
http://wordpress.org/plugins/woocommerce-google-analytics-integration/
172 stars 69 forks source link

v2.0.0 - Some events not being tracked in Empty Cart #389

Open puntope opened 7 months ago

puntope commented 7 months ago

Describe the bug:

In the Cart Empty page when clicking to Add To Cart a fatal error is shown.

https://github.com/woocommerce/woocommerce-google-analytics-integration/assets/5908855/5b325b33-461c-4497-a7ee-22a061495dce

⚠️ Aditionally, other events like "view_item_list", "select_content" are not being triggered.

Steps to reproduce:

  1. Go to Cart page without any item in the cart
  2. ⚠️ See the products, but "view_item_list" is not triggered
  3. Click on "Add to cart" in the products shown.
  4. ⚠️ See the error in the console
  5. ⚠️ "add_to_cart" event is not being tracked.
  6. Click on the product image
  7. ⚠️ "select_content" is not triggered.

Expected behavior:

  1. Go to Cart page without any item in the cart
  2. See the products, but "view_item_list" is triggered
  3. Click on "Add to cart" in the products shown.
  4. "add_to_cart" event is being tracked.
  5. Click on the product image
  6. "select_content" is triggered.
mikkamp commented 7 months ago

The fatal error should no longer be reproducible after #386 Since in add_to_cart it will return an empty list if the product was not found.

That still doesn't take away from the problem that those products aren't found, and hence the other events can't be tracked, but that would have a lower priority.