Generate Daily Product Rankings Based On Sales Data
Keep your best-selling products front and center with daily sales-based rankings. This template crunches your sales numbers every 24 hours, gives each product a numbered rank, and shuffles your collection order to showcase what's hot right now. Note: This template requires the Store Shopify Orders in a Database template to be installed and connected.
🔧 Setup is needed:
➕ Install and turn on this template Store Shopify Orders in a Database
➕ Create Best Sellers Product Metafield
➕ Create Best Sellers Collection
⏰ Adjust the schedule
✏️ Setup Variables
✏️ Add Collection ID
Follow the steps below to set up this workflow.
Step 1
Install and turn on this Store Shopify Orders in a Database workflow in your MESA dashboard.
Step 2
In the Shopify Admin, you will need to create a Best Sellers Product Metafield.
Click Settings.




For Name, fill in Best Sellers Index.
Click Select type and select Integer.
Check that One value is selected. If not, select One value.

In the Options section, toggle on Smart collections.
Click Save.

Click X on the top right corner to exit out of Settings.
Step 3
In Shopify Admin, you will also need to create a Best Sellers Collection.



For Title, fill in Best Sellers.
Add whatever you would like for the Description.
In the Collection type section, select Smart.
In the Conditions section, in Products must match, select all conditions.
For the 2 drop-down menus, select Best Sellers Index metafield for the first drop-down menu.
In the second drop-down menu, select is greater than.
In the text field, fill in with 0.

Setup other sections if needed (i.e. “Publishing”, “Image”, etc..).
Click Save.
In the Products section, click on the Sort: drop-down menu, select Manually.

Step 4
After creating the Best Sellers Product Metafield and Best Sellers collection, you will need to set up this workflow.
Step 5
In the Schedule trigger, keep it as is running daily or adjust the frequency.
Step 6
In the Transform Setup Variables step, fill in the Value field after each Key field.
After the Days Back field, in the Value field, fill in a number for how many days back you would like to look in the orders.
After the Limit field, in the Value field, fill in a number for the limit of how many products you would like to display in the Best Sellers collection.
After the Collection ID field, in the Value field, fill in the collection ID from the Best Sellers Collection.

To locate your collection ID, go back to the Best Sellers Collection you created in your Shopify Admin.
In your web browser's URL bar, locate your URL.
https://admin.shopify.com/store/my-store-uuid/collections/287588253384
After /collections, the set of numbers is the collection ID. Using the example URL, the collection ID is 287588253384.
Step 7
In the Shopify Get List of Products from Best Sellers Collection step, fill in the collection ID from the Best Sellers collection.

Step 8
At the top or bottom of the workflow, click the Save Changes button to save your changes.
Step 9
✋ Still have questions? We got you. Email us at contact@getmesa.com where our Customer Success team is happy to help!