Products and categories

Products can have multiple categories, and categories can be used for more than one product. Therefore, when setting up category-level analyses, you must be careful to use the correct definitions. Do you want the top-level category? Second-level category? What if the product can fall into multiple top-level categories?

Imagine a pair of jeans that falls into three different category levels, as defined by a Commerce implementation: ‘Clothing’ (top level), ‘Outerwear’ (second level), and ‘Pants’ (third level). You might wish to analyze your categories performance by number of units sold. The metric you need for this analysis is Items sold, which is built on the sales\_order\_item table. Therefore, you need to move category-level information onto the items table. Each row on the sales\_order\_item table has an associated product\_id, so if you know the categories associated with a product, you can bring that information over to the desired table.

Before moving any data, you must first know the proper joins and filters to ensure you grab the correct category. For some analyses, you may need to know ‘Pants’, but in other analyses, ‘Clothing’ might be more appropriate. These are distinct categories that are identified separately. Knowing how each category level is defined ensures you are able to attribute unit sales to the appropriate category for your specific analysis.

Now, imagine you also have an Our Favorites top-level category on the home page of your website. Perhaps you have implemented your Commerce store to include these jeans in both the Clothing category and the Our Favorites category. If so, this pair of jeans has more than one top-level category. In that case, moving a single top-level category over to the sales\_order\_item table does not quite make sense, as there are multiple options. To account for this, Adobe suggests creating yes/no columns that check for specific categories. For example, Is product in Clothing category? and Is product in Our Favorites category? columns allow you to check if a product falls into those specific categories.

Previous pageOptimizing Your SQL Queries
Next pageNaming Reports and Elements in Commerce Intelligence

Commerce