Structure your product Categories
Defining Category structures for effective Product organization.
After completing this page, you should be able to:
- Define the role of Categories in Product data modeling and be able to define, create, and manage Category structures that align with business objectives, enhance user experience, and drive sales.
Imagine you're responsible for managing the product catalog of a large, fast-growing online store. Your team frequently receives feedback from customers and stakeholders on how products are difficult to find, especially during seasonal promotions or when products span multiple Categories (for example, clothing that fits both "Sportswear" and "Casual"). Sales are being affected because customers can't easily navigate through the product Categories, and as the product catalog grows, the search performance is slowing down.
At the same time, you're managing different stores across regions with different product lines and customer preferences. Your current Category structure is becoming too complex, and updating or refactoring Categories often leads to unexpected results that disrupt the frontend experience.
How do you design a flexible, scalable, and efficient Category structure that not only improves navigation and discoverability but also ensures optimal performance across regions, stores, and promotions?
Read on to find out how to efficiently work with Categories in Composable Commerce.
Use cases for Categories
In Composable Commerce, Categories are a powerful tool that helps you organize and structure your Products to enhance customer experience, improve navigation, and boost sales. By effectively using Categories, you can make it easier for customers to find the Products they’re looking for, leading to better search engine optimization, upselling, and cross-selling opportunities.
Four main use cases exist for Categories:
- Navigation: Categories create a hierarchical structure for your Products, simplifying browsing. Think of Categories as the primary roadmap for your storefront.
- Example: a “Home Decor” Category with child Categories like “Furniture,” “Lighting,” and “Rugs”.
- Promotions: you can use Categories to group Products for special promotions or seasonal sales, making it easy to showcase and apply discounts.
- Example: a “Back to School” Category that gathers all school-related Products together for a seasonal promotion.
- Product Grouping: Categories help you logically group Products based on themes or specific characteristics for better management and analysis.
- Example: the “New Arrivals” or “Sustainable Materials” Categories to highlight specific product criteria.
- Product Breadcrumbs: you can enhance navigation on product display pages by showing the Category path.
Category trees: building a hierarchical structure
Categories in Composable Commerce form a Category tree, a hierarchical structure with parent-child relationships. This simplifies browsing by grouping related Products under main and subcategories.
The following are important considerations when building your Category tree:
- Multiple root-level Categories: Composable Commerce lets you have multiple root-level Categories, enabling different Category structures for various Stores, Channels, or regions. This is crucial for businesses operating in multiple markets or with different product lines. A Category is considered root-level if it has no parent Category. Each Category can have many child Categories but may only have one parent Category.
- Designing your Category tree: start by understanding your Products and how they can be logically grouped. Begin with a main root Category, then add top-level Categories branching into child Categories as needed.
- Dynamic updates: remember that Category modeling is an ongoing process. Refine and optimize your structure based on customer behavior and feedback to provide a seamless shopping experience.
Multiple root-level Categories
Multiple root-level Categories are essential for businesses operating in different regions, channels, or with varying product lines. This allows you to tailor the Category structure to specific customer preferences and needs.
To implement multiple root-level Categories:
- In your Category tree, each top-level node can represent a branch. For instance, you could have:
- North America Store
- South America Store
- Each branch can then have its Category structure beneath it, with child Categories such as "Electronics" and "Furniture".
- Some Categories might be duplicated across branches. For example, the "Electronics" Category might exist under both the North and South America stores. However, each “Electronics” Category would have a separate ID while sharing the same description. Please note that duplicate Category slugs are also not permitted.
Querying Products with Category hierarchy
Composable Commerce doesn't automatically infer Category inheritance when querying Products. This means that if a Product is assigned only to a subcategory (for example, "Boots"), querying that Product won't automatically return its parent Categories ("Football", "Team", and "Sports") in the response.
We have options, however, that allow us to get around this:
- GraphQL: you can explicitly request parent Categories using GraphQL queries.
- Reference expansions (HTTP API): utilize reference expansions in your HTTP API requests to include parent Categories in the response.
- Explicitly assign parent Categories to Products: for optimal performance, consider assigning all relevant parent Categories directly to the Product alongside the child Category. This eliminates the need for GraphQL Parent Category field or reference expansions during queries.
While GraphQL and reference expansions offer flexibility, explicitly assigning parent Categories to Products is generally the most performant approach, especially when dealing with large product catalogs and frequent Category-based filtering or searching. This is because explicitly assigning parent Categories to Products provides you with:
- Enhanced query performance: automatically retrieves the full Category tree for the Product, and querying using this option is faster than the other options.
- Efficient filtering: filtering Products based on any Category in the hierarchy (parent or child) becomes simpler and more efficient.
- Simplified search queries: you can use
categories.id:"{id}"
instead ofcategories.id: subtree("{id}")
in Product Projection Search, andcategories
instead ofcategoriesSubTree
in Product Search, leading to cleaner and faster queries.