Skip to main content
Solved

Add to Cart event using Shopify Prestige Theme not working

  • 26 June 2024
  • 3 replies
  • 71 views

Hey folks,

I wanted to create a new flow for Browse Abandonment using the add to cart metric. After doing all the steps multiple times provided in this article (https://help.klaviyo.com/hc/en-us/articles/115001396711) I realized that the Prestige Theme may have some issues when it comes to implementation. 

I’ve tried the snippets 1 and 3 over and over again (snippet 2 will not work because there is no ID in my button code) and here is the code of my add to cart button:

<div class="v-stack gap-4">
<buy-buttons class="buy-buttons " template="" form="product-form-8311865475338-template--19401582575882__main">
<button type="submit" class="button w-full">Add to cart</button>
</buy-buttons>
</div>

I was putting the snippets into my theme.liquid file and into a custom liquid block on my default product page. I only used one code at a time and checked the implementation in the klaviyo dashboard. The activity with my email will be shown but there is no new added to cart metric that I need for my flow. In fact it is completely missing. I was using “button w-full”, “button” and “w-full” for the class name in snippet 3 but nothing worked.

All the steps for a successful integration with shopify were already made and the onsite tracking works perfect. 

Is there any problem with the Prestige Theme or did I just miss something out? 

And how do I activate the add to cart metric in my case?

Thank you very much for your attention!

3 replies

Userlevel 5
Badge +26

Hello @Jay-Dee  You can use this

var className=document.querySelector("#product-form-main-855881121836-template--16152014258220__main > div > buy-buttons > button");

Badge

Hey @Maxbuzz,

Ty for your quick reply!

Unfortunately is the number string only addressing the add to cart button of only one individual product page. This one will not work out.

Badge

I have an update: 

After removing the Shopify integration in Klaviyo and activating it again the snippet 3 solution seems to work out. I put the code in my theme.liquid and used “button w-full” for the name of the class. 

If someone using the Prestige Theme has similar problems, just re-activate the whole intergation. 

This thread can be closed.

Reply