"Add to Cart" - ID Snippet. Varying codes on product page.

  • 28 February 2022
  • 1 reply

Badge +2


I’m working on creating the Abandoned cart flow sequence and followed all the steps outlined. But, came across this bump with the ID’s on the shopify product page (all the IDs are unique and Klaviyo is unable to register it). 


After adding the ‘Product Tracking Script’ and the ‘Add To Cart’ snippet (for ID), in that order, I inserted the ID code from the product page. But, each product page has a unique code. 

Below are two examples; 



Below, I inserted the code;


I tried by copying the code from the ID section and pasting it into ‘product.liquid template’, but Klaviyo doesn’t register it. I also tried it without the unique numbers from the ID, it still wouldn’t register the ‘Added to cart’ in analytics.  


Can you help me with this? 


Best answer by David To 1 March 2022, 17:03

View original

1 reply

Userlevel 7
Badge +60

Hello @Tyson,

Welcome to the Klaviyo Community!

If you haven’t already, I would suggest taking a look at the following Community post which I think would help in getting your Add to Cart code installed:


Similar to the solutions found in these other posts, since your button is using a class notation, you’ll want to use the instructions found in the Alternate Snippet for "Add to Cart" Button without a Button ID section of the Guide to Creating an "Added to Cart" Event for Shopify Help Center article. Using this alternate installation method of leveraging the button’s class will alleviate the issue of your buttons all having unique IDs as I’ve detailed in the below Community post:

I hope this helps!