Intro
To track events JavaScript snippet needs to be added to all of your pages.
You can send all except order events in via snippet, you can find events references in the dedicated events section.
Info
Ensure the contact is identified before sending events by invoking the identifyContact function. Additional details are available in this section. Without identification, events will not be transmitted to Omnisend.
$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 - to add products into emails right from the store, without the need to manually copy paste anything.
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 |
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.