Solved

"added to cart" metric not showing in metrics

  • 18 April 2022
  • 3 replies
  • 188 views

Badge +2

I don’t see the Add to cart metric available. 

 

However, I know why, I don’t have a product.liquid, for some reason I have product.json.

I have included a snippet of all the templates and sections on available when I search “product”.

 

Really need help with this please

icon

Best answer by alex.hong 18 April 2022, 23:08

View original

3 replies

Userlevel 7
Badge +58

Hi there @stretchnow,

Welcome to the Community. 

I believe this was covered in our Shopify integration HC article, but let me go over it here as well.
Shopify 2.0 was introduced to allow developers more freedom to edit code in JSON instead of Liquid template theme files within Shopify. The main difference you'll face after upgrading to Shopify 2.0 is that most of the features now rely on JSON templates. Shopify has created this guide, which provides step by step instructions for converting a Liquid template into a JSON template, and moving any required Liquid code into sections that you can include in the new JSON template. 

That said, Klaviyo's Viewed Product snippet and Added to Cart snippets were designed to be installed within Shopify's product.liquid theme files. If you navigate to your Shopify admin > Online Store > Edit Code, you should now see a product.json template instead. 

Click on the product.json template and refer to the name you see listed within sections > main > type:

?name=Img+1.png

*Please note that the names within your “sections” may vary, and there may be multiple sections. You need to find the section referring to "main".

In this example, the name is product-template. Then locate that title within the Sections folder: 

?name=Img+2.png

In this example, it is the product-template.liquid section file that we would open up, and search for the characters schema

?name=Img+3.png

Then, you can proceed to insert the Viewed Product snippet and Add to Cart snippet (if desired) directly above the schema line and click Save. 

 

All the best,

Alex

Badge

Quick question guys, first thing first, thanks for this whole explanation, it’s great. With the View products metrics installed on integration, is it still necessary to add the product view HTML above the add to cart one or not? 

Userlevel 7
Badge +58

Hello @Vingostarr,

Correct me if I misunderstand, but if your viewed product metric is already tracking and successfully integrated then there would be no other setup required correct?
Please let me know if that is what you’re asking.

 

Alex

Reply