Most Shopify builds break revenue in places nobody checks.
Building a Personalized Product Recommender in Shopify Liquid
A Liquid-based product recommender that doesn't need an app, doesn't slow the PDP, and uses real signals — order history, current cart, and product metafields.
Updated May 7, 2026
We typically work with Shopify and Shopify Plus stores doing $500k+ in annual revenue.

Building a Personalized Product Recommender in Shopify Liquid
Shopify's built-in recommendations.products is a good baseline. Apps that promise "AI personalization" usually deliver slow scripts and ugly carousels. The middle ground — a Liquid + Section Rendering API recommender powered by your own signals — is where the lift lives.
Signals you actually have
- Current cart contents.
- Customer order history (
customer.orders). - Product metafields (occasion, material, line, complement_to).
- Browsing session (via cookie or local storage).
The architecture
- PDP renders a placeholder section.
- Section Rendering API fetches a personalized section async, passing the customer ID and current product.
- The section uses Liquid logic against metafields and order history to pick complements.
- Cache aggressively at the section level.
{%- comment -%} sections/recommended-for-you.liquid {%- endcomment -%}
{%- liquid
assign current = product
assign suggestions = ''
if customer
for order in customer.orders limit: 5
for line in order.line_items
assign suggestions = suggestions | append: line.product.id | append: ','
endfor
endfor
endif
assign complement_ids = current.metafields.custom.complement_products.value
-%}
Why this beats most apps
- Native speed. Renders inside your existing critical path or async via Section Rendering API.
- No black box. You control the rules, so merchandising can adjust them.
- No monthly fee. It's your code.
- AI-ready. Add an LLM call server-side later if you want — same architecture.
When to use a real personalization platform
If you're running 1000+ orders/day and have rich first-party data, platforms like Rebuy, Nosto, or Klaviyo's on-site personalization can outperform pure Liquid. Below that, Liquid wins on ROI.
We build personalization, PDP, and merchandising features on Shopify and Shopify Plus. Get a quote.
As of early 2026, the strategy for building product recommenders on Shopify has shifted from basic Liquid loops to a hybrid model utilizing Shopify Functions and the Search & Discovery logic. While Liquid remains the primary templating language for rendering these components, the retirement of Shopify Scripts on August 28, 2025, forced a transition toward Shopify Functions for backend logic. This shift allows developers to inject recommendation rules directly into the cart and checkout engines, ensuring that personalized bundles or "frequently bought together" logic remains consistent across the entire buyer journey.
The rise of agentic commerce and the Model Context Protocol (MCP) in 2026 has further evolved how signals are processed. Brands are increasingly moving away from third-party JavaScript carousels that damage Core Web Vitals, opting instead for server-side logic executed via Hydrogen or Oxygen for headless builds, or the Section Rendering API for Liquid themes. By leveraging the Search & Discovery API’s 'related products' endpoint alongside custom metafields, merchants can now achieve high-intent personalization without the latency overhead typically associated with legacy recommendation apps. This architectural choice is critical for brands chasing the Q1 2026 GMV milestones, where conversion rate optimization (CRO) hinges on millisecond-fast page loads.
Frequently asked questions
Why is a Liquid-based recommender faster than a third-party app?
Liquid executes on Shopify's servers before the page is sent to the browser. Unlike app-based recommenders that load via JavaScript after the page is visible, Liquid-rendered recommendations prevent 'layout shift' and ensure the content is indexable by search engines. By using the Section Rendering API, you can fetch these recommendations asynchronously to keep the initial page load fast while still serving pure HTML.
How do I combine Shopify's native AI recommendations with my own Liquid logic?
As of 2025-2026, Shopify recommends using the 'Related Products' logic within the Search & Discovery app to seed the initial data, then filtering that data in Liquid using logic-based metafields (e.g., 'exclude_if_out_of_stock' or 'match_by_material'). This combines Shopify's machine learning with your specific merchandising rules.
Does the deprecation of Shopify Scripts affect Liquid recommenders?
Shopify Scripts was officially deprecated on August 28, 2025. For modern recommenders that involve discounting (e.g., 'Buy this recommendation and get 10% off'), you must now use Shopify Functions. A Liquid recommender can identify the product to show, but the Function handles the logic of applying the discount once that product is added to the cart.
Can Liquid access a customer's full purchase history for personalization?
To personalize for returning customers, use the customer.orders object to scan previous purchases. You can look for specific tags or product types and then use Liquid's where filter to suggest complementary items. For example, if a customer previously bought a 'Camera Body,' your Liquid logic can prioritize 'Lenses' in the recommendation section.
Further reading
Keep reading
Related resources

Custom Shopify Solutions for Established Brands
Five places where off-the-shelf Shopify stops scaling — and the custom solutions we build for established DTC brands on Shopify and Shopify Plus.

The Shopify Store Setup Playbook for Serious DTC
A pre-launch checklist for established brands: catalog, theme, payments, shipping, tax, analytics, and the integrations you actually need on day one.

Shopify Development Guide: Themes, Apps, Functions & Headless
A practical map of where to build what on Shopify and Shopify Plus — when to use a theme section, when to write a Shopify Function, when to ship an app, and when headless is worth it.
