How can I fix the 'Added to Cart' trigger event issue in Klaviyo?

How can I fix the 'Added to Cart' trigger event issue in Klaviyo?

Lywinsalva
Visitor
2 0 0

Hello,

I use Klaviyo on my store reigncane.com, and I have been trying to add the Abandoned Cart email flow, specifically the one with the trigger event “Added to Cart”. Note: I attached photos at the bottom showing my store's theme.liquid with the different code snippets I inserted. 

I have gone through the steps to add the “Added to Cart” event in Shopify as this Klaviyo help article describes. It is my understanding that the code for my website’s Add to Cart button is:

 

<button type="submit" name="add" id="AddToCart-product-template" class="btn btn--full product-form__cart-submit btn--secondary-accent">

              <span id="AddToCartText-product-template">

                

                  Add to Cart

                

              </span>

            </button>

 

Here is a link to a product page on gofirepits.com so that you can verify/check that I’ve correctly identified the Add to Cart button’s code. My website is built using the Venture theme and does not have custom liquid blocks in theme customization (I checked as the article described), so I copied the code snippet as per the instructions (Snippet 2 with appropriate edits) into the theme.liquid file. To see if it worked properly, I went back to the Klaviyo admin and refreshed the page, but the option “This flow requires setting up a special "Added to Cart" metric” still had a red x next to it, and the option “Create Flow” remained unavailable. I double checked to make sure I inserted the code snippet correctly, and also set a timer for one minute to give time for Klaviyo and Shopify to update and sync, then refreshed again, but the issue remained the same. I also tried this for Snippet 1 and Snippet 3, and followed the same steps of refreshing the Klaviyo admin, waiting one minute, and refreshing it again, but got the same results as with Snippet 2.

Please help me with how to solve this issue.

Thank you!


Below: This shows how the code looked when I added Snippet 1 into theme.liquid (lines 146-182).

Lywinsalva_0-1706993058598.png

 

 

Below: This shows how the code looked when I added Snippet 2 into theme.liquid (lines 146-152; this snippet should be the correct one).

Lywinsalva_1-1706993058769.png

 

 

Below: This shows how the code looked when I added Snippet 3 into theme.liquid (lines 146-156).

Lywinsalva_2-1706993058851.png

 

 

Reply 1 (1)

Osama_96
Shopify Partner
1 0 0

is it fixed? or are you still having problems? pls if you fixed let me know how. I am also stuck