Intro
To track events JavaScript snippet needs to be added to all of your pages.
We have predefined events and their properties - please use them as requested. You'll notice $ sign in front of predefined event or property names, i.e. $productViewed.
$pageViewed event
$pageViewed event is used for Live View Website Tracking.
To track page views, use JavaScript code line:
omnisend.push(["track", "$pageViewed"]);
Note 1: this code line is added to the default snippet code, so don't duplicate it.
Note 2: to use this functionality please use the newest JavaScript snippet code.
$productViewed event
Fire $productViewed event when a user views a product. This event is used for:
- Live View Website Tracking - to track product page views
- Product Abandonment automation - to use automated Product Abandonment workflow you also need to post products using Backend API.
- Product Picker
omnisend.push([
"track",
"$productViewed",
{
$productID: "prod666",
$variantID: "prod666_1",
$currency: "USD",
$price: 6666, //price in cents (integer)
$title: "Container",
$imageUrl: "http://www.example.com/images/products/prod-666.png",
$productUrl: "http://www.example.com/products/prod-666",
},
]);
Properties
Property | Type | Mandatory | Description |
---|---|---|---|
$productID | string | Yes | Product ID |
$variantID | string | Yes | Product's variant ID |
$currency | string(3) | Yes | Currency ISO 4217 code |
$price | integer | Yes | Product price in cents |
$oldPrice | integer | No | Old product price in cents |
$title | string | Yes | Product title |
$description | string | No | Product description. We'll strip it to 30 words. |
$imageUrl | string | Yes | Link to product's image |
$productUrl | string | Yes | Link to product's page |
$vendor | string | No | Product's vendor |
callbacks | Object | No | Object with onSuccess and onError functions. |
Example of $productViewed event code:
<script type="text/javascript">
omnisend.push(["track", "$productViewed",{
$productID:"prod666",
$variantID: "prod666_1",
$currency: "USD",
$price: 6666, //price in cents (integer)
$oldPrice: 6999, //old price in cents (integer)
$title:"Container",
$description:"",
$imageUrl: "http://www.example.com/images/products/prod-666.png",
$productUrl:"http://www.example.com/products/prod-666",
$vendor: "vendor"
}]);
</script>
Note: to use this functionality please use the newest JavaScript snippet code.