Hi @paoladflow,
Thanks for being a part of our community!
Currently, Klaviyo does not support the Viewed Product snippet on WordPress pages. As a workaround, you can manually add the script from the Klaviyo plugin located at includes/js/wck-viewed-product.js and add it to the product pages you would like to track.
You will want to identify the appropriate syntax to actually pull in the corresponding event variables, but this is the code you can use as a framework pulled from the Klaviyo plugin. You will want to identify the appropriate syntax to actually pull in the corresponding event variables, but this is the code you can use as a framework pulled from the Klaviyo plugin.
<script type="text/javascript">
var _learnq = _learnq || r];
var item = {
'Title': {{}},
'ItemId': {{}},
'variantId': {{}},
'Categories': {{}},
'ImageUrl': {{}},
'Url': {{}},
'Metadata': {
'Price': {{}},
}
};
_learnq.push(q'track', 'Viewed Product', item]);
_learnq.push(q'trackViewedItem', item]);
</script>
Once you determine the appropriate syntax, you will replace the with that variable. I hope this helps!
~Chloe
Hi @chloe.strange,
Thank you for your response. Is it possible to have this Viewed Product tracking code added through GTM instead of adding to the product pages?
Regards,
Paola
Hi @paoladflow!
Here’s our Help Center Article on this topic where it explains the recommended way to add Viewed Product tracking via GTM:
I hope this helps, and thanks for using the Community!
- Brian