The platform provides pre-configured metric recipes that implement common use cases for both LayersQL and Imported metrics.
LayersQL metric recipes
Total Sales (7 days)
FROM products
SHOW SUM(total_sales)
GROUP BY product_id
SINCE -7d
Revenue tracked by Layers over the last 7 days. Use for merchandising based on search-driven conversions.
Total Sales - Variant Level (7 days)
FROM products
SHOW SUM(total_sales)
GROUP BY product_id, variant_id
SINCE -7d
Revenue tracked by Layers at the variant level. When used with variant breakouts, variant tiles sort by their individual sales while product tiles sort by total product sales.
Total Quantity (7 days)
FROM products
SHOW SUM(quantity_purchased)
GROUP BY product_id
SINCE -7d
Number of items purchased in the last 7 days. Ideal for identifying high-volume products.
View Sessions (7 days)
FROM products
SHOW COUNT_DISTINCT(view_sessions)
GROUP BY product_id
SINCE -7d
Unique product view sessions in the last 7 days. Track product visibility and interest.
Cart Sessions (7 days)
FROM products
SHOW COUNT_DISTINCT(cart_sessions)
GROUP BY product_id
SINCE -7d
Unique add-to-cart sessions in the last 7 days. Measure purchase intent.
Imported (ShopifyQL) metric recipes
Return Rate (7 days) - Refresh: Daily
FROM sales
SHOW product_id, returned_quantity_rate
WHERE product_id IS NOT NULL
GROUP BY product_id
SINCE -7d UNTIL today
Percentage of returned items from Shopify. Identify products with quality or sizing issues.
Average Sales Price (7 days) - Refresh: Daily
FROM sales
SHOW product_id, average_order_value
WHERE product_id IS NOT NULL
GROUP BY product_id
SINCE -7d UNTIL today
Average order value after discounts. Understand actual selling prices vs. list prices.
Revenue (7 days) - Refresh: Daily
FROM sales
SHOW product_id, net_sales
WHERE product_id IS NOT NULL
GROUP BY product_id
SINCE -7d UNTIL today
Net sales (sales minus returns) from Shopify. Authoritative revenue for financial merchandising.
Sales Velocity - Refresh: Daily
FROM sales
SHOW product_id, (net_items_sold / 168) as sales_velocity_per_hour
WHERE product_id IS NOT NULL
GROUP BY product_id
SINCE -7d UNTIL today
Units sold per hour from 7-day Shopify data. Track product momentum and trending items.
These recipes are available in your Layers dashboard. Go to the Metrics section and select from the recipe library to install and customize them for your specific requirements.