Open A-Fitz opened 3 days ago
Hi @A-Fitz
Thank you for the report and all the code details! Because of the closed source of QuadLayers Direct Checkout for WooCommerce Pro Plugin, it's hard for us to help with compatibility.
And given the details you provided, if https://github.com/woocommerce/woocommerce-google-analytics-integration/pull/386 didn't fix the problem,
This means the global product
is not available, and they fire the added_to_cart
event in a different way than WooCommerce core does—without the crucial product ID set as the button's value or data attribute.
Then we do not know what product was added to the cart and cannot track the event correctly to Google Analytics.
That's why I suggest reaching out to QuadLayers support and asking them for compatibility with the WooCommerce added_to_cart
event. And send all the needed attributes exactly in the way you proposed in the Additional details.
Please let us know how that works out or if the extension would fail to track the event despite the product ID being set & sent or the product
variable being available.
Describe the bug:
Your plugin expects that the added_to_cart event will come with a button parameter. The QuadLayers Direct Checkout for WooCommerce Pro Plugin does not supply such a parameter upon use of its AJAX originated button, causing the Google Analytics Integration tracking to fail.
Very similar to #382.
Your plugin's code, classic.js L52 v2.1.8:
QuadLayers Direct Checkout for WooCommerce Pro Plugin code, qlwcdc-pro.js L113 v3.0.2 (code not available in public source control):
Steps to reproduce:
Expected behavior:
The add_to_cart event is triggered and succeeds as usual
Actual behavior:
Failure to track action and interruption of the Direct Checkout plugin. Console error: "Google Analytics for WooCommerce: Could not read product ID from the button given in
added_to_cart
event. Check whether WooCommerce Core events or elements are malformed by other extensions."Additional details:
As a workaround, the Direct Checkout plugin can be manually edited like so: