I have a custom-built e-commerce website, so I can't use built-in integration solutions. I've created the 'Viewed Product' tracking on the client side, with guidance from the Klaviyo article: “Integrate a platform without a pre-built Klaviyo integration” that can be found here:
https://developers.klaviyo.com/en/v1-2/docs/guide-to-integrating-a-platform-without-a-pre-built-klaviyo-integration
I have this in the header of my website:
<script type="text/javascript" async="" src="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=xxxxx"></script>
and this in the body of my product page:
<script>
var _learnq = _learnq || _];
var item = {
"ProductName": "Color Bracelet",
"ProductID": "25100",
"SKU": "10210",
"Categories": 21"therapy","bracelets"]],
"ImageURL": "https://www.imageurl.com",
"URL": "https://www.websiteurl.com?productid=25100",
"Brand": "",
"Price": 19.95,
};
_learnq.push("track", "Viewed Product", item]);
</script>
I can't find any errors, yet I'm not receiving any data on the Klaviyo Analytics Dashboard. Can anyone help me figure out what the issue is?
I'm also uncertain about which page in Klaviyo analytics displays the data for the 'Viewed Product' events. According to the documentation when navigating to Analytics > Metrics and then Filter by API - then it should have a metric name called “Viewed Product” - but I can only find one called “Active on Site”
Thanks in advance for your help