Product viewed
Record when a user views a product.
This event tracks when a user views a product in an online store.
Track this event whenever a user opens a product page, views a product detail, or interacts with a product.
Implementation
Here is an example of how to track this event:
import croct from '@croct/plug';croct.track('productViewed', {product: {productId: '12345',name: 'Black iPhone 12',displayPrice: 899.99}});
Input properties
These are the supported properties:
- productobject
The product being viewed.
- productIdstring
The ID that uniquely identifies the product on your store. For example, "3108" or "CD4371".
The value must be between 1 and 50 characters long.
- sku(optional)string
The SKU of the product. For example, "IPH-GRE-64", "153-169-172-182887".
The value must be between 1 and 50 characters long.
- namestring
The name of the product. For example, "iPhone" or "Nike Air Max".
The value must be between 1 and 200 characters long.
- category(optional)string
The category of the product. For example, "Smartphones" or "Running shoes".
The value must be between 1 and 100 characters long.
- brand(optional)string
The brand of the product. For example, "Apple" or "Nike".
The value must be between 1 and 100 characters long.
- variant(optional)string
The variant of the product, such as size, color and style. For example, "Black", "M", "XL".
The value must be between 1 and 50 characters long.
- displayPricenumber
The price of the product displayed in the store. For example, 899.99.
The value must be non-negative.
- originalPrice(optional)number
The regular price of the product before any discounts. For example, 999.99.
The value must be non-negative.
- url(optional)string
The URL of the product page.
- imageUrl(optional)string
The URL of the product image.
- productId
Processed properties
This event has no processed properties.
Payload examples
Below are some payload examples for this event:
{"product": {"productId": "12345","name": "Black iPhone 12","displayPrice": 899.99}}