Tracking SDKEvents
product_view
Someone opened a product page.
Send this when a visitor lands on a product page, and again if they switch variant on the same page.
trackbee.track('product_view', {
product_id: '8472019',
variant_id: '4410228',
price: '29.99',
currency: 'EUR',
product_title: 'Field Jacket',
variant_title: 'Olive / M',
product_type: 'Outerwear',
product_url: 'https://example.com/products/field-jacket',
image_url: 'https://cdn.example.com/field-jacket-olive.jpg',
vendor: 'Northbound',
sku: 'NB-FJ-OLV-M',
});Fields
| Field | Type | Required |
|---|---|---|
product_id | string or number | yes |
variant_id | string or number | yes |
price | price | yes |
currency | string | no |
product_title | string | no |
variant_title | string | no |
product_type | string | no |
product_url | string | no |
image_url | string | no |
vendor | string | no |
sku | string | no |
price is the unit price of the variant being viewed, as a non-negative number or a string like '29.99'. See value rules.
currency is an ISO code like EUR or USD. Pass it whenever you know it. Without it the amount arrives without a unit.
The minimum
trackbee.track('product_view', {
product_id: '8472019',
variant_id: '4410228',
price: '29.99',
});That works, but send the optional fields when you have them. They are what makes a product recognizable in reports and in the audiences your ad platforms build.
If the product has no variants
Pass the product ID for both. A platform that models everything as a product with one variant still needs something in variant_id.