Solved

I cannot get the Viewed Product Tracking or Add to Cart Snippet to work in the Prestige theme in Shopify

  • 22 March 2023
  • 1 reply
  • 114 views

Badge

Please help! I have read through the article, watched You Tube videos, watched a Loom video and I cannot get the Viewed Product Tracking or the Add to Cart snippet to work in my Prestige Shopify theme

icon

Best answer by chloe.strange 22 March 2023, 21:21

View original

1 reply

Userlevel 5
Badge +28

Hi@LMBaker

Thanks for being a part of our community! I’m sorry you’re having an issue with viewed product and add to cart. I wanted to share a little more context on what is tracked. 

By enabling basic web tracking on your website, you can collect helpful information around browsing activity that can be leveraged to take your owned marketing and business analytics to the next level. When you add Klaviyo's web tracking snippet(s) to your site, we only track the browsing activity of "known browsers" — i.e. browsers that have visited and engaged at least once before. Klaviyo will not track anonymous browsers. 

There are three key ways Klaviyo will be able to identify a site visitor for web tracking purposes:

  • If someone has, at some point, clicked through a Klaviyo email to your website
  • If someone has, at some point, subscribed/opted-in through a Klaviyo form
  • If someone has, at some point, logged into your site and you have identify tracking installed

As a result, until you start sending emails with Klaviyo and growing your lists, you probably won't see a lot of tracked web activity. Over time, Klaviyo will identify more and more of your contact-base and your web tracking data will become more comprehensive. 

Here is an add to cart snippet for the Prestige theme that should help:

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

The snippet will need to be triggered once to create the metric. You can also check out our article on troubleshooting viewed product tracking as a reference. I hope this helps!

~Chloe

 

Reply