Presets (default algorithms)
What you will find here ?
How dynamic contextual rules and algorithms work within AB Tasty’s Recommendations & Merchandising platform. It covers the six main “starting points” available when building a strategy, along with a full reference of available algorithms.
Dynamic contextual rules use real-time contextual variables (page type, category, viewed/bought items, recency, frequency, etc.) to return relevant, up-to-date product sets for each user or page.

Items sorted by
Definition Returns products based on a chosen property or performance metric (e.g., sales, recency, margin, page views, purchased quantities). These are typically “Top X Products” strategies ordered by KPI and timeframe.
Logic The rule aggregates catalog and event data (page views, purchases, revenue, quantities) over a defined period, ranks the products, and returns the highest-scoring ones.
Input variable
Global or category scope (categoryId, page_type)
categoryId = “Shoes”
Algorithm
Aggregates metrics over X days
pageviews_last_7_days, revenues_last_30_days, trend, etc.
Output
Ranked list of best-performing products
Top 50 bestsellers last 30 days
Dynamic
Auto-updates as data evolves (daily/hourly refresh)
—
Use cases
Top sellers of the last 30 days
Newest arrivals (sorted by creation date)
Trending products (based on sales velocity ratio)
Most relevant products (weighted by conversion × recency × stock)
Items associated to
Definition Returns products most often purchased or viewed together with the current product (“complementary logic”). Built on co-occurrence and TF-IDF weighting to detect statistically meaningful associations.
Logic
Input variable
Current product ID (productId) or basket IDs (cart_items)
"SKU12345"
Algorithm
TF-IDF based co-occurrence analysis
“Bought together”, “Viewed together”
Output
Complementary product set
Printer → Ink cartridges
Dynamic
Real-time refresh with new behavioral data
—
Use cases
Frequently bought together
Cross-sell bundles (e.g., accessories, consumables)
Cart-based add-ons (threshold fillers or impulse buys)
Items similar to
Definition Returns products that share strong affinities with the current one — acting as alternatives within the same universe. Built using co-occurrence + TF-IDF weighting, attribute-based matching, or embedding similarity (semantic / visual).
Logic
Input variable
Current product attributes (productId, categoryId)
"SKU7890"
Algorithm
Similarity scoring model
“Similar products”, “Semantic”, “Visual”
Output
List of substitute or style-related products
“Another Oxford shirt in blue”
Dynamic
Updates as catalog and user signals change
—
Use cases
Alternative products on PDP (prevent exit)
Style discovery (same color / material / collection)
Niche promotion (long-tail visibility for new SKUs)
Items from recommendation
Definition Reuses the output of an existing recommendation rule. Used to compose multi-layered or conditional strategies.
Logic
Input variable
Output of a previous strategy
“Top sellers in category”
Algorithm
Sequential chaining / composition
Apply filter stock > 0 on previous output
Output
Filtered or refined set of recommended products
Top sellers with stock > 0 & margin > 20%
Use cases
Composed strategies: combine multiple rules in sequence
Fallbacks: use another recommendation if the first returns too few products
Manual selection
Definition A fixed curated list of products chosen by a merchandiser. Ideal for campaign or editorial content that should not change dynamically.
Input variable
Product IDs manually selected
[“SKU111”, “SKU222”, “SKU333”]
Algorithm
None (static list)
—
Output
Always the same set until edited
“Christmas collection”
Dynamic
Manual only
—
Use cases
Seasonal campaigns (e.g., Christmas, Black Friday)
Editorial picks (lookbooks / content curation)
Hero products for brand priorities or high margin
Products from variable
Definition Returns products based on a dynamic contextual variable from the page or user session. Typical examples: current category, basket content, recently viewed items, or user profile segments.
Input variable
Dynamic contextual variable
categoryId, user_recent_basket, last_viewed_products
Algorithm
Variable-driven lookup rule
“Best sellers in current category”
Output
Contextual set of products linked to that variable
Personalized continuity
Dynamic
Automatically adjusts to user context
—
Use cases
Category best sellers (using
categoryId)Recently viewed products (using
last_viewed_products)Basket-based rules (using
user_recent_basket)“Because you viewed…” personalization
Appendix — All Available Algorithms (from Petit Bateau CSV)
pageviews_last_7_days
7-day page views
Products with the most views over the last 7 days.
pageviews_last_14_days
14-day page views
Products with the most views over the last 14 days.
pageviews_last_30_days
30-day page views
Products with the most views over the last 30 days.
trend
Trend ratio
Ratio of page views between the last and previous period (velocity indicator).
revenues_last_30_days
30-day revenue
Products generating the highest revenue over the last 30 days.
revenues_last_14_days
14-day revenue
Products generating the highest revenue over the last 14 days.
revenues_last_7_days
7-day revenue
Products generating the highest revenue over the last 7 days.
quantities_purchased_last_7_days
7-day purchased quantities
Products with the highest number of units sold in the last 7 days.
quantities_purchased_last_14_days
14-day purchased quantities
Products with the highest number of units sold in the last 14 days.
quantities_purchased_last_30_days
30-day purchased quantities
Products with the highest number of units sold in the last 30 days.
(If your CSV contains additional specialized variants, e.g., “margin_last_30_days”, they can be added under the same pattern.)
Data Flow & Dynamic Variable Usage
Dynamic contextual variables (see dedicated glossary) drive these recommendation rules:
page_typedetermines which rule is triggered (homepage vs PDP vs cart).viewed_items,bought_items,cart_itemsfeed “associated” and “similar” rules.recency,frequency, andmonetaryscore freshness and priority.categoryId,productId, anduser_recent_basketdefine the contextual scope for “products from variable”.
Flow overview:
User Event (Tag) → Contextual Variables updated → Rule Evaluation (Algo) → Filtered Product List → Display on Site / Feed Analytics.
Let’s deep dive into the three core algorithms powering AB Tasty Recommendations & Merchandising
Each of them plays a unique role in how products are ranked and displayed - from behavioral patterns to semantic understanding.
Co-occurrence
Behavioral
Orders, sessions, views
Identify products often bought/viewed together
“Frequently bought together”
TF-IDF
Statistical weighting
Co-occurrence + global frequency
Reduce bias from generic products
“Next book in a series” instead of “Gift card”
Semantic
Contextual (NLP)
Product text, attributes, metadata
Find products similar in meaning or style
“Other running shoes”
How dynamic rules and algorithms work within AB Tasty’s Recommendations & Merchandising platform?
It covers the six main “starting points” available when building a strategy, along with a full reference of available algorithms.
Dynamic contextual rules use real-time contextual variables (page type, category, viewed/bought items, recency, frequency, etc.) to return relevant, up-to-date product sets for each user or page.
1️⃣ Items sorted by
Definition Returns products based on a chosen property or performance metric (e.g., sales, recency, margin, page views, purchased quantities). These are typically “Top X Products” strategies ordered by KPI and timeframe.
Logic The rule aggregates catalog and event data (page views, purchases, revenue, quantities) over a defined period, ranks the products, and returns the highest-scoring ones.
Input variable
Global or category scope (categoryId, page_type)
categoryId = “Shoes”
Algorithm
Aggregates metrics over X days
pageviews_last_7_days, revenues_last_30_days, trend, etc.
Output
Ranked list of best-performing products
Top 50 bestsellers last 30 days
Dynamic
Auto-updates as data evolves (daily/hourly refresh)
—
Use cases
Top sellers of the last 30 days
Newest arrivals (sorted by creation date)
Trending products (based on sales velocity ratio)
Most relevant products (weighted by conversion × recency × stock)
2️⃣ Items associated to
Definition Returns products most often purchased or viewed together with the current product (“complementary logic”). Built on co-occurrence and TF-IDF weighting to detect statistically meaningful associations.
Logic
Input variable
Current product ID (productId) or basket IDs (cart_items)
"SKU12345"
Algorithm
TF-IDF based co-occurrence analysis
“Bought together”, “Viewed together”
Output
Complementary product set
Printer → Ink cartridges
Dynamic
Real-time refresh with new behavioral data
—
Use cases
Frequently bought together
Cross-sell bundles (e.g., accessories, consumables)
Cart-based add-ons (threshold fillers or impulse buys)
3️⃣ Items similar to
Definition Returns products that share strong affinities with the current one — acting as alternatives within the same universe. Built using co-occurrence + TF-IDF weighting, attribute-based matching, or embedding similarity (semantic / visual).
Logic
Input variable
Current product attributes (productId, categoryId)
"SKU7890"
Algorithm
Similarity scoring model
“Similar products”, “Semantic”, “Visual”
Output
List of substitute or style-related products
“Another Oxford shirt in blue”
Dynamic
Updates as catalog and user signals change
—
Use cases
Alternative products on PDP (prevent exit)
Style discovery (same color / material / collection)
Niche promotion (long-tail visibility for new SKUs)
4️⃣ Items from recommendation
Definition Reuses the output of an existing recommendation rule. Used to compose multi-layered or conditional strategies.
Logic
Input variable
Output of a previous strategy
“Top sellers in category”
Algorithm
Sequential chaining / composition
Apply filter stock > 0 on previous output
Output
Filtered or refined set of recommended products
Top sellers with stock > 0 & margin > 20%
Use cases
Composed strategies: combine multiple rules in sequence
Fallbacks: use another recommendation if the first returns too few products
5️⃣ Manual selection
Definition A fixed curated list of products chosen by a merchandiser. Ideal for campaign or editorial content that should not change dynamically.
Input variable
Product IDs manually selected
[“SKU111”, “SKU222”, “SKU333”]
Algorithm
None (static list)
—
Output
Always the same set until edited
“Christmas collection”
Dynamic
❌ Manual only
—
Use cases
Seasonal campaigns (e.g., Christmas, Black Friday)
Editorial picks (lookbooks / content curation)
Hero products for brand priorities or high margin
6️⃣ Products from variable
Definition Returns products based on a dynamic contextual variable from the page or user session. Typical examples: current category, basket content, recently viewed items, or user profile segments.
Input variable
Dynamic contextual variable
categoryId, user_recent_basket, last_viewed_products
Algorithm
Variable-driven lookup rule
“Best sellers in current category”
Output
Contextual set of products linked to that variable
Personalized continuity
Dynamic
✅ Automatically adjusts to user context
—
Use cases
Category best sellers (using
categoryId)Recently viewed products (using
last_viewed_products)Basket-based rules (using
user_recent_basket)“Because you viewed…” personalization
🧩 Appendix — All Available Algorithms (from Petit Bateau CSV)
pageviews_last_7_days
7-day page views
Products with the most views over the last 7 days.
pageviews_last_14_days
14-day page views
Products with the most views over the last 14 days.
pageviews_last_30_days
30-day page views
Products with the most views over the last 30 days.
trend
Trend ratio
Ratio of page views between the last and previous period (velocity indicator).
revenues_last_30_days
30-day revenue
Products generating the highest revenue over the last 30 days.
revenues_last_14_days
14-day revenue
Products generating the highest revenue over the last 14 days.
revenues_last_7_days
7-day revenue
Products generating the highest revenue over the last 7 days.
quantities_purchased_last_7_days
7-day purchased quantities
Products with the highest number of units sold in the last 7 days.
quantities_purchased_last_14_days
14-day purchased quantities
Products with the highest number of units sold in the last 14 days.
quantities_purchased_last_30_days
30-day purchased quantities
Products with the highest number of units sold in the last 30 days.
(If your CSV contains additional specialized variants, e.g., “margin_last_30_days”, they can be added under the same pattern.)
🔄 Data Flow & Dynamic Variable Usage
Dynamic contextual variables (see dedicated glossary) drive these recommendation rules:
page_typedetermines which rule is triggered (homepage vs PDP vs cart).viewed_items,bought_items,cart_itemsfeed “associated” and “similar” rules.recency,frequency, andmonetaryscore freshness and priority.categoryId,productId, anduser_recent_basketdefine the contextual scope for “products from variable”.
Flow overview:
User Event (Tag) → Contextual Variables updated → Rule Evaluation (Algo) → Filtered Product List → Display on Site / Feed Analytics.
Last updated
Was this helpful?

