Hello!
We have a custom integration that we are attempting to plug Klaviyo into. We are using GTM for this. We’ve been able to get ‘viewed product’ to fire but only on GTM Debugger
Site is made in Next JS & Azure
Here is our viewed product snippet
<!-- Klaviyo Viewed Product Script -->
<script type="text/javascript">
var item = {
"ProductName":document.querySelector('.ProductComponent_productName__2AuMo').innerText,
"SKU": document.querySelector('.ProductComponent_productInfoRow__5FcoG h4').innerText,
"ImageURL": document.querySelector('.Slider_sliderImage__iRN_K').getAttribute('src'),
"URL": window.location.href,
"Price": document.querySelector('.Price_priceLarge__2OtPj').innerText.replace('$', ''), // Removing the dollar sign from the price
};
klaviyo.push(["track", "Viewed Product", item]);
</script>
We have changed the trigger a few times seeing if this was the issue. We tried, DOM Load, /product page view, etc