Rank items with the Product Marker data service
Rank items based on a specific attribute in your feed using the Product Marker data service in Productsup.
Introduction
The Product Marker data service is a Productsup feature that lets you rank items in your site based on a specific attribute. For example, you can use the Product Marker data service to identify the three most ordered items in your feed. Optionally, you can identify those most ordered items within each category if you choose a grouping attribute in the data service setup.
The Product Marker data service can also count the number of parts in an attribute value that is split with a delimiter and identify which items in your feed have the highest or lowest number of parts in a value.
Once the data service finishes processing, it creates a new attribute in your site containing the ranking results.
Note
The Product Marker data service is available for the import and intermediate stages.
Prerequisites
To use the Product Marker data service, you need:
A unique item identifier. See Set a unique item identifier for more information.
A ranking attribute in your feed that contains one of these value types:
Numeric values. In this case, the data service compares numbers across different items and marks the item with the highest or lowest number.
Alphanumeric values split into parts with a delimiter. In this case, the data service counts the number of parts in each value, compares it across different items, and marks the item with the highest or lowest number of parts in a value.
Add the Product Marker data service
Go to Data Services from your site's main menu, and select Add data service.
Search for Product Marker, select Add, and give it a desired name in Name and attribute name prefix Column prefix.
By default, the attribute name prefix starts with three underscores (
___
), which means the new attribute won't be exported during site runs.Choose the stage where you have the needed ranking attribute in Service Data Level, and select Add.
In Attribute containing the values, select the attribute that contains the data you want to use for ranking.
If your ranking attribute is split into parts with a delimiter and you want to count these parts and compare their number across different items in the feed, enter the character that splits your values into parts in Delimiter. For example, enter the greater-than sign > if you want to mark items with the longest category values, for example, Shoes > Sneakers and Shoes > Sneakers > Running sneakers.
Note
You can't use a space character as a delimiter.
If you want to rank your items within groups, such as categories, select the attribute that groups the needed items in Import attribute you want to group by (optional).
In Method, choose Ascending to mark items with the lowest values or Descending to mark items with the highest values.
Enter the number of items you want to mark in Number of marked items. For example, to mark the three highest values in an attribute, enter 3 in this field.
In Result attribute, enter the name of the newly-added attribute that should contain the ranking results. The platform adds the prefix defined in Step 2 to the attribute name. You can later find the attribute at the same stage where you applied the data service.
Select Save.
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 ranking data in Data View, ensure the platform hasn't hidden it:
Go to Data View from your site's main menu and choose the relevant stage or export in the dropdown on your left.
Select the menu icon on the right and then select the eye icon.
Find the result attribute in the list, and select the eye icon next to it.
Close the pop-up.
Ranking example
The goal is to identify the three most ordered items within each category. You can set up the Product Marker data service in the following way:
Attribute containing the values: orders
Import attribute you want to group by (optional): category
Number of marked items: 3
Result attribute: most_ordered
Method: Descending
id | category | stock | size | color | orders |
---|---|---|---|---|---|
1 | Shoes | 4 | S | red | 10 |
2 | Shoes | 2 | S | blue | 15 |
3 | Shoes | 1 | L | blue | 25 |
4 | Shirts | 5 | 38 | black | 7 |
5 | Shirts | 4 | 38 | blue | 15 |
6 | Shirts | 7 | 38 | green | 5 |
7 | Shirts | 2 | 40 | green | 10 |
8 | Shirts | 5 | 42 | green | 17 |
9 | Pants | 7 | 28 | black | 26 |
As a result, you can see the rankings in the newly created attribute ___marker_most_ordered:
id | category | stock | size | color | orders | ___marker_most_ordered |
---|---|---|---|---|---|---|
1 | Shoes | 4 | S | red | 10 | Shoes 3 |
2 | Shoes | 2 | S | blue | 15 | Shoes 2 |
3 | Shoes | 1 | L | blue | 25 | Shoes 1 |
4 | Shirts | 5 | 38 | black | 7 | |
5 | Shirts | 4 | 38 | blue | 15 | Shirts 2 |
6 | Shirts | 7 | 38 | green | 5 | |
7 | Shirts | 2 | 40 | green | 10 | Shirts 3 |
8 | Shirts | 5 | 42 | green | 17 | Shirts 1 |
9 | Pants | 7 | 28 | black | 26 | Pants 1 |
Note
If there are more items within the same category than you chose to mark in Number of marked items, the data service only marks as many items as you chose and leaves the remaining values of the result attribute empty.
Edit the Product Marker data service
Go to Data Services from your site's main menu.
Change the settings of the needed data service:
To deactivate a data service, choose the pause icon next to the desired data service.
Select the cogwheel icon
next to the desired data service to edit other settings and select Save.
Delete the Product Marker data service
Go to Data Services from your site's main menu.
Tip
To stop a data service from affecting your feed without deleting the data service itself, you can choose the pause icon next to the desired data service.
Select the cogwheel icon
next to the desired data service.
In the Danger Area panel, select Remove this service.
Select Yes.