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 Save Shopify Orders to a Database template to be installed and connected.

🔧  Setup is needed:
➕  Install and turn on this template Save Shopify Orders to 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 Save Shopify Orders to 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.

Click Metafields and metaobjects on the left sidebar.

Click Products.

Click Add definition.

For Name, fill in Best Sellers Index.

Check that One type is selected. 

Click Select type and select Integer.

In the Options section, toggle on Use as a condition in collections and Storefront API access.

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.

Click Products.

Click Collections.

Click Add collection.

For Title, fill in Best Sellers. For the description, add whatever you would like.

In the Products section on the right side, fill out this condition: Best Sellers Index is greater than 0.

In the Collection items section, set the Default sort to Manually.

Setup other sections if needed.

Click Save when you are done.

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

Click Save.

Step 8

At the top or bottom of the page, switch Off to On to turn on your workflow to start automating. Runs will trigger depending on the frequency set in the Schedule trigger (first step).

✋  Still have questions? We got you. Email us at contact@getmesa.com where our Customer Success team is happy to help!