Is this the reason "Added to Cart" isn't showing in analytics?

  • 24 March 2021
  • 1 reply

Badge +2

Hi everyone,

Hope you're having a great week.

Yesterday I started optimizing one of my client's email marketing.

However, when trying to add the “Added to Cart” snippet on Shopify, I can't get it to show in the analytics tab.

I followed the tutorial to a tee, my client's theme doesn't have an ID, but rather a class button.

This is the snippet I put on the “product.liquid” section:

And I don't know if this is relevant, put there's another snippet before this one as well (unrelated to Klaviyo)

If you could help me figure out what is happening I'd be forever grateful. Thank you and kind regards,



Best answer by caroline 26 March 2021, 17:13

View original

1 reply

Userlevel 5
Badge +8

Hi @Agencia SENA,

It looks like the classes associated with that button on your client’s site are add-to-cart, btn--full, btn, and btn--tertiary. As a result, I would recommend changing the selector in the snippet to “document.querySelector(‘.add-to-cart’)” rather than “document.querySelector(‘.add_to_cart’)”