Skip to main content

Personalized Category Pages

Category pages are essential navigation hubs for e-commerce sites, content platforms, and marketplaces. Whether it's "Women's Dresses", "Action Movies", or "Data Science Articles", these pages present users with a curated subset of items based on a chosen theme or classification. While crucial for browsing, standard category pages often rely on simple, generic sorting methods like "Newest", "Best Selling", or "Price (Low-High)". These defaults fail to account for individual user preferences, often forcing shoppers or readers to scroll through pages of potentially irrelevant items to find something that resonates.

Imagine landing on a "Running Shoes" page and immediately seeing the brands and styles most suited to your past browsing and purchase history, rather than just the newest arrivals. This is the power of personalized category pages. By intelligently re-ranking items within a category based on individual user affinity, businesses can significantly improve product discovery, increase click-through rates from category to item pages, boost conversion rates, and create a much more satisfying browsing experience. Building this capability, however, traditionally involves significant technical complexity.

Building Personalized Category Pages with Shaped

Let's illustrate using Shaped's filter_predicate to personalize the item order on a category page.

Goal: When a user visits category "CAT_A", show items from that category sorted by personal relevance.

1. Ensure Data is Connected: Assume user_interactions and item_metadata (with an accurate category column) are connected to Shaped.

2. Define Your Shaped Model (YAML): A standard recommendation model definition works. Ensure category is included as an item feature from your item_metadata source.

category_personalization_model.yaml
model:
name: category_page_recs
connectors:
- type: Dataset
name: user_interactions
id: interactions
- type: Dataset
name: item_metadata # Dataset containing item details including category
id: items
fetch:
events: |
SELECT user_id, item_id, timestamp AS created_at, 1 as label, event_type FROM interactions
items: |
SELECT
item_id,
title,
category, -- Make sure the category column is selected and accurate
brand,
image_url,
product_url
FROM items

3. Create the Model:

shaped create-model --file category_personalization_model.yaml

4. Monitor Training: Wait for the model category_page_recs to become ACTIVE.

shaped view-model --model-name category_page_recs

5. Fetch Personalized Category Ranking (Application Backend Logic): When a user (USER_789) requests the page for category "CAT_A":

  • Step A (Your Backend): Determine the category filter needed, e.g., filter_string = "category = 'CAT_A'" (adjust field name and value).
  • Step B (Your Backend): Call Shaped's rank API, passing the user ID and the filter_predicate.
const { Shaped } = require('@shaped/shaped');  

const shapedClient = new Shaped();
const categoryFilter = "category = 'CAT_A'"; // Assuming 'category' is the column name in your items data
const itemsPerPage = 24;
const response = await shapedClient.rank({
modelName: 'category_page_recs',
userId: 'USER_789',
filterPredicate: categoryFilter, // Pass the filter string
limit: itemsPerPage, // Fetch enough items for the first page
returnMetadata: true
});
console.log(`Got ${response.ids.length} personalized items for filter '${filter}'`);
  • Step C (Your Backend): The response contains only items matching the filter_predicate, already sorted by personal relevance for USER_789. Use this list directly for rendering the first page and subsequent pagination (by adding offset to the Shaped API call).

Beyond Simple Categories: The Power of filter_predicate

The filter_predicate uses a SQL-like expression language, allowing for much more than simple category matching. You can create personalized views based on:

  • Price Ranges: price >= 50 AND price < 100
  • Brands: brand = 'Acme Brand' or brand IN ['Brand A', 'Brand B']
  • Release Dates: publish_year >= 2024
  • Multiple Attributes: (category = 'Electronics' AND brand = 'Acme') OR color = 'Blue'
  • Array Fields: array_has(tags, 'featured')
  • Text Matching: title LIKE '%gadget%' or regexp_match(description, '(?i)waterproof')

This enables you to build highly specific, personalized landing pages or filtered views easily, all powered by the same underlying Shaped model.

Conclusion: Enhance Browsing with Effortless Category Personalization

Generic sorting on category pages fails to engage users effectively. Personalizing the ranking within categories significantly enhances discovery and conversion. While traditionally complex due to the need for real-time scoring of large candidate sets, Shaped's rank endpoint with the filter_predicate feature offers a much simpler and more powerful solution.

By offloading both the filtering and the personalized ranking to Shaped's optimized infrastructure, you can easily implement dynamic, personalized category pages (and other filtered views) with minimal backend logic. Let Shaped handle the complex AI and data filtering, so you can focus on creating more engaging and effective browsing experiences for your users.

Ready to personalize your category pages and boost discovery?

Request a demo of Shaped today to see it in action with your specific use case. Or, start exploring immediately with our free trial sandbox.