Skip to main content
Fallback chains ensure customers always see recommendations, even when the primary block doesn’t return enough products.

How fallback chains work

When a block doesn’t meet its minimum products safeguard, the system automatically tries fallback blocks in order:
  1. Primary block is evaluated first
  2. If results are below minimum, try Fallback 1
  3. If Fallback 1 also doesn’t meet minimum, try Fallback 2
  4. Continue until a block meets the minimum or all fallbacks are exhausted

Fallback modes

Each entry in the fallback chain can be configured with one of two modes:
  • Replace (default): The fallback block’s results replace the primary block’s results entirely if the fallback meets the minimum products requirement. This is the original behavior.
  • Fill: The fallback block’s products are appended to the existing results (deduplicated by product ID). This lets you “top up” a partially filled block instead of replacing its results. The system respects the maximum products safeguard when merging, and totalResults in the response accounts for deduplication across all sources.
Fill mode is useful when the primary block returns some relevant results but not enough to meet the minimum. Instead of discarding those results, fill mode supplements them with products from the fallback.

Configuring fallback chains

Fallback chains are configured as an ordered list of block IDs, each with an optional fallback mode. Important considerations:
  • Fallback blocks must be active
  • Fallback blocks should have the same anchor type as the primary block
  • Avoid circular references
  • Fallback blocks can have their own fallback chains
  • The system prevents infinite loops by tracking visited blocks
  • You can mix replace and fill modes in the same chain

Best practices

Strategy diversity: Use different strategy types in your fallback chain to maximize coverage.
Primary: Interaction-based (requires behavioral data)
Fallback 1: Similarity-based (requires embeddings)
Fallback 2: Manual collection (always has products)
Progressive relaxation: Start with highly personalized strategies and fall back to broader recommendations.
Primary: "Frequently Bought Together" (highly specific)
Fallback 1: "Customers Also Viewed" (broader)
Fallback 2: "Best Sellers in Category" (broadest)
Fill mode for supplementing results: Use fill mode when you want to keep the primary block’s results and top them up with additional products.
Primary: "Frequently Bought Together" (may return 2-3 products)
Fallback 1 (fill): "Similar Products" — appends products to reach the minimum
Fallback 2 (replace): "Best Sellers" — used entirely if combined results are still insufficient
Anchor type consistency: Ensure fallback blocks use the same anchor type to maintain context.
Product anchor primary → Product anchor fallbacks
Cart anchor primary → Cart anchor fallbacks
Minimum products alignment: Set appropriate minimums for each block in the chain.
Primary: minimum_products = 4
Fallback 1: minimum_products = 2
Fallback 2: minimum_products = 1 (always shows something)

See also