Skip to main content

Tracking Recommendations Products Shown

This event tracks when recommendation products are displayed to users for analytics and personalization tracking.

interface Product {
l: string; // Product label/name
c: string; // Currency
u: string; // Product URL
p: string; // Price
p_min?: string; // Minimum price
p_max?: string; // Maximum price
p_c?: string; // Compare at price
p_min_c?: string; // Minimum compare at price
p_max_c?: string; // Maximum compare at price
d?: string; // Description
t: string; // Thumbnail image URL
t2?: string; // Secondary thumbnail URL
f?: number; // Featured flag
s?: string; // Variant selector
sku: string; // SKU identifier
p_spl?: number; // Price split flag
c_date?: number; // Creation date timestamp
id: string; // Product ID
skus?: any[]; // Array of SKUs
v_c?: number; // Variant count
iso?: boolean; // ISO flag
vra?: any[]; // Variations array
att?: any[]; // Attributes array
}

interface RecommendationsProductsShownEventData {
products: Product[]; // Required - Array of recommended products that were shown
widget_id?: string; // Optional - Identifier for the recommendation widget
sourceProductID?: string; // Optional - The source product ID (usually current product page)
}

// Example of sending a Recommendations Products Shown event
window.FastSimonSDK.event({
eventName: window.FastSimonEventName.RecommendationsProductsShown,
data: {
products: [
{
"l": "Classic Running Shoes",
"c": "USD",
"u": "/products/fastsimon-demo-site-classic-running-shoes-blue-132131",
"p": "89.99",
"p_min": "",
"p_max": "",
"p_c": "0.00",
"p_min_c": "0.00",
"p_max_c": "0.00",
"d": "Comfortable running shoes perfect for daily workouts. Features breathable mesh upper and cushioned sole for optimal performance and comfort during your runs.",
"t": "https://fastsimon-demo-site.myshopify.com/files/running-shoes-blue.jpg",
"t2": "https://assets.instantsearchplus.com/thumbs/fastsimon-demo-site/a6e46466-e4f9-499b-a7b1-013d5976701b",
"f": 0,
"s": "9891167699248::49924203217200",
"sku": "DEMO-SHOES-001-8.5",
"p_spl": 0,
"c_date": 1751897237,
"id": "9891167699248",
"skus": [/* list of SKUs */],
"v_c": 13,
"iso": false,
"vra": [/* variations list */],
"att": [/* attributes list */]
}
],
widget_id: "related-products-widget", // Optional
sourceProductID: "product-page-id-123" // Optional
}
});

When to Use

Use this event to report when recommendation products are displayed to users:

  • Product Page Recommendations: When related/similar products are shown
  • Upsell/Cross-sell Widgets: When recommendation widgets render products
  • Cart Recommendations: When products are recommended in cart/checkout
  • Category Page Recommendations: When recommended products appear on collection pages

Best Practices

  1. Call after products are actually visible: Only report when products are rendered and visible to users
  2. Include complete product data: Ensure all required product properties are present
  3. Use meaningful widget_id: Helps distinguish different recommendation contexts
  4. Report empty products validation: The SDK will automatically log an error if an empty products array is passed