-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add To Cart Tracking support for Products (Beta) Block #2028
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @puntope, for fixing this, it works as expected 👍 . It took me some time to figure out why the hook experimental__woocommerce_blocks--cart-add-item
doesn't work with "Products Beta."
I noticed that in Products Beta, the "Add to the cart" button is rendered in the backend:
On the other hand, "All products" are rendered using React, and the hook experimental__woocommerce_blocks--cart-add-item
is attached in the click event:
So, do you think that a similar issue could be affecting the google-analytics extension?
* Products (Beta) block doesn't trigger addAction events. Also it's not being queried by the previous query selector | ||
* because we added :not( .wc-block-components-product-button__button ) to prevent tracking duplicates with | ||
* other blocks that yes trigger addAction events. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we can mention that Products (Beta) is rendered in the backend, which means the addAction(experimental__woocommerce_blocks--cart-add-item ...)
won't work.
I think the "yes" could be omitted here: other blocks that ->yes<- trigger addAction events
Yes, Google Analytics has the same issue. And all the plugins relying on that hook using Products (Beta) but this PR only achieves the fix for GLA |
Changes proposed in this Pull Request:
Closes #2020
This PR adds a fix for triggering the Add To Cart event when it takes place on Products (Beta) Block.
Detailed test instructions:
Additional details:
Changelog entry