Need Help?

viewed product

This event is triggered automatically on all websites with the included snippet, except for single-page applications (SPAs).

Unlocked Features

  • Product abandonment workflow: Enables you to automate actions when a product is viewed but not purchased. See the Product abandonment guide for more information.
  • Contact segmentation: Enables targeted communication by categorizing contacts based on specific criteria.

Supported Endpoints

EndpointeventVersionorigin
track (JavaScript API)v4api

We recommend to send this event via JavaScript API

Note: The viewed product event will be captured only for identified contacts. Contact is identified if:

  • Customer clicked on a campaign email and landed on your website
  • Customer submitted Omnisend Form
  • Using the omnisend.identifyContact function

Example event

Below is an example event provided for testing. You can send this through the available endpoints to evaluate automation, segmentation, or any other custom functionalities.

JavaScript API:


omnisend.push([
  "track",
  "viewed product",
  {
  "origin": "api",
  "eventID": "f3f61bc6-07b8-4645-92d8-189d882dbcb1",
  "eventVersion": "v4",
  "eventTime": "2021-07-01T00:00:00Z",
  "properties": {
    "page": {
      "title": "Example Store - Log Product",
      "url": "example.com/product/1"
    },
    "product": {
      "categories": [
        {
          "id": "2131",
          "title": "The best product"
        }
      ],
      "currency": "EUR",
      "id": "232423",
      "imageUrl": "https://example.com/product/232423-image.jpg",
      "oldPrice": "4099",
      "price": "2099",
      "title": "The best product",
      "status": "inStock",
      "url": "https://example.com/product/232423"
    },
    "userInfo": {
      "city": "Vilnius",
      "country": "Lithuania",
      "device": "mobile",
      "language": "en",
      "os": "ios",
      "sessionId": "o9KSwgfgjPDhih-20240131002519"
    },
    "utm": {
      "campaign": "Summer_sale Campaign",
      "medium": "Facebook_Mobile_Feed",
      "source": "Facebook_Ads"
    }
  },
  "contact": {
    "id": "67447b7d5c1cd54488ec24d9",
    "email": "[email protected]",
    "phone": "+443031237300",
    "firstName": "Vanessa",
    "lastName": "Kensington",
    "birthdate": "1997-05-28",
    "gender": "f",
    "address": "9709 Highland Rd.",
    "city": "New York",
    "state": "NY",
    "postalCode": "08723",
    "country": "United States",
    "customProperties": {
      "favoriteColors": [
        "red",
        "blue"
      ],
      "vipStatus": true,
      "vipStatusDate": "2023-06-27T10:48:36Z",
      "vipPoints": 100.59,
      "friendlyTitle": "Miss Vanessa"
    },
    "tags": [
      "vip",
      "form:a12546asdwq"
    ],
    "optIns": [
      {
        "channel": "email",
        "createdAt": "2023-06-27T10:48:36Z",
        "source": "form:omnisend-form:5d5cf027865hed74f4078q44:26"
      }
    ],
    "optOuts": [
      {
        "channel": "sms",
        "createdAt": "2023-06-27T10:48:36Z",
        "reason": "unsubscribed via email",
        "source": "email link"
      }
    ],
    "consents": [
      {
        "channel": "email",
        "createdAt": "2023-06-27T10:48:36Z",
        "ip": "73.240.147.113",
        "source": "form:omnisend-form:5d5cf027865hed74f4078q44:26",
        "userAgent": "Mozilla/5.0"
      }
    ]
  }
}
]);
  
  • eventName. Either "viewed product"
  • eventID. This is a unique identifier for the event (UUID v4). If you don't have a unique identifier, you can leave it empty.
  • origin. Use api
  • eventVersion. v4
  • properties.
  • eventTime. Optional. If not provided current date is used
  • contact. Optional. The contact object allows you to send additional details about the contact identified using the omnisend.identifyContact JavaScript function. NOTE: When using contact, ensure you provide at least one of the following values: id, email and/or phone. All other contact information is OPTIONAL.

Property explanation & expected types

Value PathDescriptionExampleType
pagePage-object
page.titleTitleExample Store - Log Productstring
page.urlUrlexample.com/product/1string
productProduct-object
product.categoriesCategories-array of objects
product.categories.idId2131string
product.categories.titleTitleThe best productstring
product.currencyCurrency code in ISO 4217 formatEURstring
product.descriptionDescription-string
product.idId232423string
product.imageUrlImage Urlhttps://example.com/product/232423-image.jpgstring
product.oldPriceValue in cents. Please refer to _oldPrice4099number
product.priceValue in cents. Please refer to _price2099number
product.titleTitleThe best productstring
product.statusProduct status at the time of the event. Default values: 'inStock', 'outOfStock', 'notAvailable'inStockstring
product.urlURL to product pagehttps://example.com/product/232423string
userInfoUser Info-object
userInfo.cityCity name. Property is resolved from IP address.Vilniusstring
userInfo.countryCountry name. Property is resolved from IP address.Lithuaniastring
userInfo.deviceDevice name. Property is resolved from user agent.mobilestring
userInfo.languageUser selected language. Property is resolved from user agent.enstring
userInfo.osUser operation system. Property is resolved from user agent.iosstring
userInfo.sessionIdUser browser session. Can be used to detect events from the same browser session.o9KSwgfgjPDhih-20240131002519string
utmWill be only prefilled if user opened site from shared campaign link-object
utm.campaignMarketing campaign name. Summer_sale Campaignstring
utm.mediumFrom what medium user opened site. i.e 'social'Facebook_Mobile_Feedstring
utm.sourceFrom what source user opened site. i.e 'facebook'Facebook_Adsstring