Skip to main content

Create unique IDs for categories with the Category ID Generator

Discover how to create unique IDs for your products' categories and category paths with the Productsup data service called Category ID Generator.

Introduction

Note

The Category ID Generator data service is available for the intermediate stage only.

The Category ID Generator is a data service in Productsup that creates unique IDs for product categories and category paths across an account, project, or site. This data service scans your category attribute, identifies the delimiter used in the attribute, and creates an additional data source in your site to add and populate five (5) new columns:

  • ___service_categoryid_pathids

  • ___service_categoryid_id

  • ___service_categoryid_path

  • ___service_categoryid_last

  • ___service_categoryid_hash

These columns let the platform:

  1. Assign each category a unique ID.

  2. Break each category down into category levels.

  3. Assign each category path a unique ID based on the category levels it contains.

Applying the Category ID Generator service looks similar to this:

Category path

Category hash

Category path ID

Category ID

Last category level

Clothes -> Homewear -> Home shoes -> Slippers

Clothes ->Homewear ->Home shoes ->Slippers

1>2>3>4

4

Slippers

Clothes -> Accessories -> Socks

Clothes ->Accessories ->Socks

1>9>10

10

Socks

Clothes -> Homewear -> Sleeping clothes -> Pajamas

Clothes ->Homewear ->Sleeping clothes ->Pajamas

1>2>22>23

23

Pajamas

Your current category path is in the Category path column. A simplified version of it is in the Category hash column, which contains a technical value needed for the data service to complete its tasks. The Category path ID column combines IDs of different category levels into one category path ID. The Last category level column has the last category level of the path and usually determines the category ID shown in the Category ID column.

Note

The column names in this example don't coincide with those in Productsup. These are simplified column names.

The names of your columns depend on the column prefix you choose during the data service setup.

Prerequisites

Make sure you have set a product identifier to use this data service. See Set a product identifier for more information.

Add the Category ID Generator data service

  1. Go to Data Services from your site's main menu and select ADD SERVICE.

  2. Search for Category ID Generator, select Add, give it a desired name and column prefix, and select Add.

    By default, ___service_categoryid is the column prefix.

    Use the Category ID Generator to create unique IDs for your products' categories
  3. Select the attribute that contains your products' categories in Category Column.

  4. In ID pool based on…, choose the level within the platform that Productsup should scan for categories:

    • Account - Productsup assesses the uniqueness of all categories in your account. Each unique category in this account gets a unique ID. If multiple sites have a category with the same data, such a category receives unique IDs each time it appears in the account.

    • Account (Distinct) - Productsup assesses the uniqueness of all categories in your account. Each unique category in this account gets a unique ID. If multiple sites have a category with the same data, such a category receives the same ID across all sites of the account.

    • Project - Productsup assesses the uniqueness of all categories in the chosen project. Each unique category in this project gets a unique ID. If multiple sites have a category with the same data, such a category receives unique IDs each time it appears in the project.

    • Project (Distinct) - Productsup assesses the uniqueness of all categories in the chosen project. Each unique category in this project gets a unique ID. If multiple sites have a category with the same data, such a category receives the same ID across all sites in the project.

    • Site - Productsup assesses the uniqueness of all categories in the chosen site. Each unique category in this site gets a unique ID.

    Tip

    To use the options Account, Account (Distinct), Project, and Project (Distinct), add and set up the Category ID Generator in all sites where you want to create unique category IDs. The items selected in the drop-down menu ID pool based on… should be the same across all these sites.

  5. In Tree Separator, enter the symbol that should separate levels within your category paths. The default separator is >.

  6. Select Save.

  7. For the platform to process a new data service, select Run in the top-right corner of your site's view.

    Note

    If you can't see your new category IDs in the intermediate stage in Data View, ensure the platform hasn't hidden them:

    1. Go to Data View from your site's main menu and choose the relevant stage or export in the drop-down list on your left.

    2. Select the menu icon on the right and then select the eye icon.

    3. Find the attributes in the list that use the custom prefix ___service_categoryid and select the eye icon next to each attribute you want Data View to display.

    4. Close the pop-up menu.

    The naming of the attributes created by the Category ID Generator depends on the column prefix you choose in Step 2. The attribute names the data service generates always start with three underscores (___), which means the platform doesn't send such attributes to your export channels.

Edit the Category ID Generator data service

  1. Go to Data Services from your site's main menu.

  2. Search for your data service.

  3. Select the cogwheel icon () next to the desired data service to edit settings.

  4. Select Save.

Delete the Category ID Generator data service

  1. Go to Data Services from your site's main menu.

  2. Select the cogwheel icon () next to the desired data service.

  3. In the Danger Area panel, select Remove this service.

  4. Select Yes.