viewed product
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
Endpoint | eventVersion | origin |
---|---|---|
track (JavaScript API) | v4 | api |
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": {
"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"
}
},
"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. - The following properties are automatically collected without the need to send them: UTM (campaign, medium, source); Page(title, url); User Info(city, country, device, language, os, sessionId)
Property explanation & expected types
Value Path | Description | Example | Type |
---|---|---|---|
product | Product | - | object |
product.categories | Categories | - | array of objects |
product.categories.id | Id | 2131 | string |
product.categories.title | Title | The best product | string |
product.currency | Currency code in ISO 4217 format | EUR | string |
product.description | Description | - | string |
product.id | Id | 232423 | string |
product.imageUrl | Image Url | https://example.com/product/232423-image.jpg | string |
product.oldPrice | Value in cents. Please refer to _oldPrice | 4099 | number |
product.price | Value in cents. Please refer to _price | 2099 | number |
product.title | Title | The best product | string |
product.status | Product status at the time of the event. Default values: 'inStock', 'outOfStock', 'notAvailable' | inStock | string |
product.url | URL to product page | https://example.com/product/232423 | string |