Klaviyo Script for Add to Cart Trigger Flow

Highlighted
Excursionist
19 0 10

Hi,

 

I'm trying to add Klaviyo's code for creating a custom true Abandoned Cart email flow. I've followed their instructions here. But with no success. I believe I have to use the alternate script for the add to cart button with a class notation. I'm using the Atlantic theme. I have not heard back from Klaviyo support. Any help would be appreciated.

 

Thank you.

0 Likes
Highlighted
Shopify Expert
229 28 36

it should work, maybe there is a line of the code on your product.liquid, that is blocking that code... could you paste your product.liquid code in here or if you want we could have a deeper look for you. Just write us at info@webmefy.com and we would love to help you.

We help you achieve your Goals! Visit us on: Webmefy.com
0 Likes
Highlighted
New Member
1 0 0

Im also having this issue 

 

Followed instructions exactly as explained on klaviyos site

 

Here is what is in my product.liquid

Ive bolded the snippet i had to change in order to reflect my the "class" from the button on my site

(below this product.liquid is the code from 'inspect" that i got off the add to cart button.)

 

{% section 'product-template' %}
{% section 'related-products' %}
{% section 'recently-viewed-products' %}

<script src=https://widget.sezzle.com/v1/javascript/price-widget/initial?uuid=7f6f8fd1-cc1b-4968-a366-a8b8ac21e7...>

<script src="https://widget.sezzle.com/v1/javascript/price-widget?uuid=7f6f8fd1-cc1b-4968-a366-a8b8ac21e753"></sc...>

<script text="text/javascript">
var _learnq = _learnq || [];

var item = {
Name: {{ product.title|json }},
ProductID: {{ product.id|json }},
Categories: {{ product.collections|map:'title'|json }},
ImageURL: "https:{{ product.featured_image.src|img_url:'grande' }}",
URL: "{{ shop.secure_url }}{{ product.url }}",
Brand: {{ product.vendor|json }},
Price: {{ product.price|money|json }},
CompareAtPrice: {{ product.compare_at_price_max|money|json }}
};

_learnq.push(['track', 'Viewed Product', item]);
_learnq.push(['trackViewedItem', {
Title: item.Name,
ItemId: item.ProductID,
Categories: item.Categories,
ImageUrl: item.ImageURL,
Url: item.URL,
Metadata: {
Brand: item.Brand,
Price: item.Price,
CompareAtPrice: item.CompareAtPrice
}
}]);
</script>

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

 

FROM INSPECT:

<button type="submit" class="ProductForm__AddToCart Button Button--full Button--secondary" data-action="add-to-cart"><span>Add to cart</span></button>

 

 

Please let me know if im missing something?

Theme is prestige 

0 Likes
Highlighted
Shopify Expert
229 28 36

Hey Ruben,

 

just answer to your mail. Let me know if that helps, so we can post the answer here too! :)

We help you achieve your Goals! Visit us on: Webmefy.com
0 Likes
Highlighted
New Member
1 0 0

I'm having the same issue as both people above can you help me?

0 Likes