Product viewed

Record when a user views a product.

This event tracks when a user views a product in an online store.

Croct's mascot neutral
When should I track this event?

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:

example.js
123456789
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:

product
object

The product being viewed.

productId
string

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.

name
string

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.

displayPrice
number

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.

Processed properties

This event has no processed properties.

Payload examples

Below are some payload examples for this event:

1234567
{
"product": {
"productId": "12345",
"name": "Black iPhone 12",
"displayPrice": 899.99
}
}