Skip to main content

Hey there! 

I’m in sort of a bind with setting up the automation in klaviyo.

I’ve followed the steps given in for Viewed Product Tracking for Shopify theme 2.0 and Added to cart.
Still the Added to Cart metric I need for Abandoned cart is not appearing.

Viewed Product Tracking on my account is working so I don’t know what is missing in my part. So I need some help. 

Here I have the two snippets script as indicated per instructions.



The script I got from the shop as I followed the instructions

 

First I tried this script and nothing appeared: 

<script type="text/javascript">
var _learnq = _learnq || ];
document.getElementById("AddToCart").addEventListener('click',function (){
_learnq.push(l'track', 'Added to Cart', item]);
});</script

 

 

Then I used this Script and still did not work:
 

<script type="text/javascript">
var _learnq = _learnq || q];
document.getElementById("product-form__submit button button--full-width button--secondary").addEventListener('click',function (){
_learnq.push( 'track', 'Added to Cart', item]);
});</script

 

And Lastly I tried using this and still no “added to cart” metric on the klaviyo analytics:

<script type="text/javascript">
var _learnq = _learnq || l];
document.getElementById("product-form__submit").addEventListener('click',function (){
_learnq.push(r'track', 'Added to Cart', item]);
});</script


I can’t really tell if its something with the Dawn theme, cause its a shopify 2.0 or something else I am missing.

Please can someone help me here so I can get started with the Abandoned cart flow.

Hi! I’ve been trying your resolution amongst others I’ve found across forums and my “added to cart” is still not showing up. Anyone still experiencing this? 


Hello Again,

after I look into some forum threads and tried and tested the number of snippets that others have used. I finally got it to appear. 


 

So for themes, in shopify 2.0 please follow the instructions and used this Snippet instead:
 

<script type="text/javascript">
  var _learnq = _learnq || q];
  document.querySelector('add_to_cart').addEventListener('click',function (){
    _learnq.push(n'track', 'Added to Cart', item]);
  });
</script> 


No need for chang​ing, just copy and paste it to a separate Custom Liquid Section (should be the last and Viewed Product should be first.) and it will appear after clicking Add to cart on your shop.​​​​​​

I got it from this thread, and it worked for dawn Themes, Shopify 2.0
 


So yeah, if Anyone of you are using the Dawn theme, and can’t get Added to Cart to work.  you must have Viewed Product Tracking setup first and then paste this snippet script I have above as instructed in Added to Cart.

I hope this help you all. ​​​​​​​


Reply