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.

📘

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:

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

PropertyTypeMandatoryDescription
$productIDstringYesProduct ID
$variantIDstringYesProduct's variant ID
$currencystring(3)YesCurrency ISO 4217 code
$priceintegerYesProduct price in cents
$oldPriceintegerNoOld product price in cents
$titlestringYesProduct title
$descriptionstringNoProduct description. We'll strip it to 30 words.
$imageUrlstringYesLink to product's image
$productUrlstringYesLink to product's page
$vendorstringNoProduct'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.