Hello,
So i’ve tried second and third method from this doc as the first one wasn’t working. Both second/third worked with default cart drawer. However, when i installed upcart app for add to cart drawer which disables the default drawer, the add to cart event isn’t triggering in klaviyo.
Doc link: https://help.klaviyo.com/hc/en-us/articles/115001396711
This is the script i’m using on main-product.liquid in my dawn 12 theme:
<script type="text/javascript">
var _learnq = _learnq || [];
var classname = document.getElementsByClassName("product-form__submit");
var addToCart = function() {
_learnq.push(['track', 'Added to Cart', item]);
}; for (var i = 0; i < classname.length; i++) {
classname[i].addEventListener('click', addToCart, false);
}
</script>
It’s working fine with default shopify drawer but not with upcart drawer.
I also read another post related to this topic but that said to change the endpoint in the script from /cart/add.js
to /cart/add.js?upcart=1
but i can’t seem to find these endpoints in my script.
Best answer by StefanUE
View original