Skip to main content
Solved

Where do I find the Raw Product Viewed Handles and Syntax? [Raw Integrations - Raw HTML / CSS]

  • August 17, 2022
  • 1 reply
  • 72 views

Forum|alt.badge.img+2

I have success in past with Shopify integration, but I’m looking for a RAw Handle / Syntax for the Viewed Product event to fire into Klavito.
I am not having success reverse engineering the provided Product Viewed snippets.

 

How to create an "Added to Cart" event for Shopify

https://help.klaviyo.com/hc/en-us/articles/115001396711-How-to-create-an-Added-to-Cart-event-for-Shopify

 

Guide to Creating an "Added to Cart" Event for BigCommerce

https://help.klaviyo.com/hc/en-us/articles/360024310292-Guide-to-Creating-an-Added-to-Cart-Event-for-BigCommerce


What I’d like to fire specifically is for example

 

website.com/products/red-widget

Red Widget

REDWIDIT-01P

$50

/product-images/red-widget.webp

 

website.com/products/red-widget

Blue Widget

BLUEWIDIT-01P

$125

/product-images/blue-widget.webp

 

Thank you.

Best answer by David To

Hello @SmartyPants,

Welcome to the Klaviyo Community! 

Since it sounds like you’re trying to come up with your own custom viewed product event, if you haven’t already, I would recommend taking a look at our Integrate a platform without a pre-built Klaviyo integration developer guide. Not only does it go over how to connect your own custom site with Klaviyo, but it also goes over and include a number of example metrics and their suggested code snippets - which you can certainly adjust to however you want to customize them. For example, the default viewed product event code we provide and suggest would be:

<script type="text/javascript">
var _learnq = _learnq || [];
var item = {
"ProductName": "Winnie the Pooh",
"ProductID": "1111",
"SKU": "WINNIEPOOH",
"Categories": ["Fiction", "Children"],
"ImageURL": "http://www.example.com/path/to/product/image.png",
"URL": "http://www.example.com/path/to/product",
"Brand": "Kids Books",
"Price": 9.99,
"CompareAtPrice": 14.99
};
_learnq.push(["track", "Viewed Product", item]);
</script>

We also have an extensive network of Klaviyo Partners who can provide more hands-on assistance if you need further help in terms of development or marketing help!

Have a great day!

David

1 reply

David To
Klaviyo Employee
Forum|alt.badge.img+60
  • Klaviyo Employee
  • 2455 replies
  • Answer
  • August 17, 2022

Hello @SmartyPants,

Welcome to the Klaviyo Community! 

Since it sounds like you’re trying to come up with your own custom viewed product event, if you haven’t already, I would recommend taking a look at our Integrate a platform without a pre-built Klaviyo integration developer guide. Not only does it go over how to connect your own custom site with Klaviyo, but it also goes over and include a number of example metrics and their suggested code snippets - which you can certainly adjust to however you want to customize them. For example, the default viewed product event code we provide and suggest would be:

<script type="text/javascript">
var _learnq = _learnq || [];
var item = {
"ProductName": "Winnie the Pooh",
"ProductID": "1111",
"SKU": "WINNIEPOOH",
"Categories": ["Fiction", "Children"],
"ImageURL": "http://www.example.com/path/to/product/image.png",
"URL": "http://www.example.com/path/to/product",
"Brand": "Kids Books",
"Price": 9.99,
"CompareAtPrice": 14.99
};
_learnq.push(["track", "Viewed Product", item]);
</script>

We also have an extensive network of Klaviyo Partners who can provide more hands-on assistance if you need further help in terms of development or marketing help!

Have a great day!

David