Pre-configured metric recipes for common LayersQL and ShopifyQL use cases — sales, views, carts, returns, and velocity — that you can copy into your store.
Layers provides pre-configured metric recipes that implement common use cases for both LayersQL and Imported metrics.
When you create a new store, Layers automatically provisions a set of default dashboard metrics on the Overview dashboard. These metrics give you an at-a-glance summary of key performance indicators without any manual setup.Dashboard recipes include aggregate metrics for search, collections, orders, revenue, image search, similar products, and block recommendations. They are displayed as cards or tables depending on the metric type.
The following recipes track how your recommendation blocks perform. They are added to the Overview dashboard automatically for all stores.Block Impressions (30d) — Card
FROM blocksSHOW COUNT(requests)SINCE -30d
Total number of block recommendation requests over the last 30 days.Block Revenue (30d) — Card
FROM blocksSHOW SUM(total_sales)SINCE -30d
Total revenue attributed to block recommendations over the last 30 days.Block Conversion Rate (30d) — Card
FROM blocksSHOW (COUNT_DISTINCT(cart_sessions) / NULLIF(COUNT_DISTINCT(requests),0)) * 100SINCE -30d
Percentage of block recommendation requests that resulted in an add to cart over the last 30 days.Block Click Sessions (30d) — Card
FROM blocksSHOW COUNT_DISTINCT(click_sessions)SINCE -30d
Unique sessions where a product from block recommendations was clicked over the last 30 days.Top Blocks (30d) — Table
FROM blocksSHOW COUNT(requests)GROUP BY block_titleSINCE -30d
Your most-requested recommendation blocks over the last 30 days, ranked by request volume.Top Blocks by Revenue (30d) — Table
FROM blocksSHOW SUM(total_sales)GROUP BY block_titleSINCE -30d
Recommendation blocks generating the most revenue over the last 30 days.
Block analytics recipes query the blocks dataset. You need the Storefront Pixel installed to track block interactions and attribute revenue.
Geographic dashboard recipes show where search demand is concentrated. They use the geo_bar chart type, which renders a ranked horizontal bar chart and resolves two-letter country codes (for example, US) into full country names (United States). Bars are sorted in descending order by search volume, and LIMIT 12 keeps the chart readable on dashboard tiles.Searches by Country (30d) — Geo bar
FROM search_textSHOW COUNT(requests) AS searchesWHERE geo_country IS NOT NULLGROUP BY geo_countrySINCE -30dVISUALIZE searches TYPE geo_bar BY geo_country LIMIT 12
Search request volume grouped by shopper country over the last 30 days. Use this to identify the markets driving the most search demand.Searches by State/Region (30d) — Geo bar
FROM search_textSHOW COUNT(requests) AS searchesWHERE geo_state IS NOT NULLGROUP BY geo_stateSINCE -30dVISUALIZE searches TYPE geo_bar BY geo_state LIMIT 12
Search request volume grouped by shopper state or region over the last 30 days. Use this to spot regional demand within the countries you serve.
Geographic recipes query the search (text) dataset and rely on the geo_country and geo_state fields captured with each search request. Rows without geo data are excluded.
Filter usage dashboard recipes show how shoppers use filter facets on collection pages. They query the collections dataset and rely on the shopper-applied filter_property and filter_value dimensions. Transform-injected filters and the built-in collection scope are excluded so the counts reflect facet interactions, not the base collection.Filter usage by facet (30d) — Bar
FROM collectionsSHOW COUNT_DISTINCT(filtered_requests)GROUP BY filter_propertySINCE -30d
How often shoppers apply each filter facet across collections over the last 30 days. A request that uses several facets counts once per facet, so this ranks facets by reach rather than deduplicating requests.Filter values by facet (30d) — Table
FROM collectionsSHOW COUNT_DISTINCT(filtered_requests)GROUP BY filter_property, filter_valueSINCE -30d
Which values shoppers pick within each filter facet over the last 30 days. Use this to see whether specific colors, sizes, or price bands drive facet usage.Zero-result filters by value (30d) — Table
FROM collectionsSHOW COUNT_DISTINCT(filtered_zero_results)GROUP BY filter_property, filter_valueHAVING COUNT_DISTINCT(filtered_zero_results) > 0SINCE -30d
Filter selections that returned no products over the last 30 days, by facet and value. Use this to find dead-end combinations to prune from your facet configuration or fill with catalog work.
Product engagement dashboard recipes summarize shopper interaction with product tiles. They query the products dataset and depend on product_impression, product_hover, and product_touch events emitted by the Storefront Pixel or sent through the Tracking API.Product Impressions (30d) — Card
FROM productsSHOW product_impressionsSINCE -30dCOMPARE TO previous_period
Total tracked product impression events over the last 30 days, with the previous-period delta.Top Products by Impressions (30d) — Table
FROM productsSHOW product_impressionsGROUP BY productSINCE -30d
Products ranked by tracked impression events over the last 30 days.Product Hover Rate (30d) — Card
FROM productsSHOW hover_rateSINCE -30dCOMPARE TO previous_period
Tracked product hovers divided by impressions over the last 30 days. Indicates how often shoppers explore tiles on desktop.Product Touch Rate (30d) — Card
FROM productsSHOW touch_rateSINCE -30dCOMPARE TO previous_period
Tracked product touches divided by impressions over the last 30 days. Indicates tile engagement on mobile.
FROM productsSHOW SUM(total_sales)GROUP BY productSINCE -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 productsSHOW SUM(total_sales)GROUP BY product, variantSINCE -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 productsSHOW SUM(quantity_purchased)GROUP BY productSINCE -7d
Number of items purchased in the last 7 days. Use to identify high-volume products.View Sessions (7 days)
FROM productsSHOW COUNT_DISTINCT(view_sessions)GROUP BY productSINCE -7d
Unique product view sessions in the last 7 days. Track product visibility and interest.Cart Sessions (7 days)
FROM productsSHOW COUNT_DISTINCT(cart_sessions)GROUP BY productSINCE -7d
Unique add-to-cart sessions in the last 7 days. Measure purchase intent.
Trending metric recipes weight recent sales more heavily than older ones so ranking reacts quickly to shifts in what shoppers are buying. Use them in a sort order when a flat trailing window (like 7-day or 30-day units) hides products whose sales are picking up right now. They only make sense once your store has enough recent purchase history for a short-horizon window to reliably predict next week’s sales. Layers gates the Trending measures in the sort metric picker on that check.Trending units (7-day half-life, 28 days)
FROM productsSHOW SUM(quantity_purchased_decayed_7d)GROUP BY productSINCE -28d
Units sold in the last 28 days where each sale loses half its weight every 7 days. Yesterday’s units count in full, units from a week ago count half, units from two weeks ago count a quarter. Use to surface fast-moving products without being fooled by month-old sales.Trending units (14-day half-life, 56 days)
FROM productsSHOW SUM(quantity_purchased_decayed_14d)GROUP BY productSINCE -56d
Same shape as the 7-day variant but with a longer memory. Recent sales still dominate, but slow-and-steady sellers aren’t shut out. Use for catalogs with steadier turnover where a 7-day half-life feels too jumpy.Units momentum (7d vs prior 7d)
FROM productsSHOW SUM(units_last_7d) / NULLIF(SUM(units_prior_7d), 0)GROUP BY productHAVING SUM(units_prior_7d) >= 100SINCE -14d
Ratio of the last 7 days of units sold to the 7 days before. Values above 1 mean the product is accelerating, values below 1 mean it’s cooling off. Pair with a threshold on prior-period units (default 100) so a product with a single unit last week can’t leapfrog established sellers.
FROM salesSHOW product_id, returned_quantity_rateWHERE product_id IS NOT NULLGROUP BY product_idSINCE -7d UNTIL today
Percentage of returned items from Shopify. Identify products with quality or sizing issues.Average Sales Price (7 days) - Refresh: Daily
FROM salesSHOW product_id, average_order_valueWHERE product_id IS NOT NULLGROUP BY product_idSINCE -7d UNTIL today
Average order value after discounts. Understand actual selling prices vs. list prices.Revenue (7 days) - Refresh: Daily
FROM salesSHOW product_id, net_salesWHERE product_id IS NOT NULLGROUP BY product_idSINCE -7d UNTIL today
Net sales (sales minus returns) from Shopify. Authoritative revenue for financial merchandising.Sales Velocity - Refresh: Daily
FROM salesSHOW product_id, (net_items_sold / 168) as sales_velocity_per_hourWHERE product_id IS NOT NULLGROUP BY product_idSINCE -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 Analytics > Reports, then open LayersQL Report Recipes or Imported Report Recipes from the page’s actions menu to install and customize them for your needs.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Layers","colors":{"primary":"#607FFD","light":"#AFC0FF","dark":"#3A57E8"},"logo":{"light":"https://mintcdn.com/protoninc/PNs-gxGUVcdBDEEC/logo.svg?fit=max\u0026auto=format\u0026n=PNs-gxGUVcdBDEEC\u0026q=85\u0026s=989e3194cb32f07e7018b8b7186b9007","dark":"https://mintcdn.com/protoninc/PNs-gxGUVcdBDEEC/logo.svg?fit=max\u0026auto=format\u0026n=PNs-gxGUVcdBDEEC\u0026q=85\u0026s=989e3194cb32f07e7018b8b7186b9007","href":"https://www.uselayers.com/?utm_source=docs\u0026utm_medium=referral\u0026utm_campaign=docs-to-site"},"favicon":"https://mintcdn.com/protoninc/qubyNEZK4oJTl9By/favicon.svg?fit=max\u0026auto=format\u0026n=qubyNEZK4oJTl9By\u0026q=85\u0026s=3611d60346e12f15e4684bc60cb69ece","api":{"mdx":{"server":"https://app.uselayers.com/api/storefront/v1"}},"navbar":{"links":[{"href":"https://www.uselayers.com/changelog?utm_source=docs\u0026utm_medium=referral\u0026utm_campaign=docs-to-site","label":"Changelog"},{"href":"mailto:support@uselayers.com","label":"Support"},{"href":"https://app.uselayers.com/dashboard?utm_source=docs\u0026utm_medium=referral\u0026utm_campaign=docs-to-dashboard","label":"Dashboard"}],"primary":{"type":"button","label":"Request Demo","href":"https://www.uselayers.com/demo?utm_source=docs\u0026utm_medium=referral\u0026utm_campaign=docs-to-site"}},"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/uselayers"},"links":[{"header":"Legal","items":[{"label":"Privacy Statement","href":"https://docs.uselayers.com/legal/privacy-statement"},{"label":"Terms of Use","href":"https://docs.uselayers.com/legal/terms-of-use"}]}]},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"protoninc","hasAudioNarration":false,"actualSubdomain":"protoninc","customDomains":["docs.uselayers.com"],"gitSource":{"type":"github","owner":"protonagency","repo":"layers-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"edits":false,"issues":false,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"}},"buildId":"6af4956d4b5da1d1ca432463","clientVersion":"0.0.4102","searchFilterCounts":[{"language":"default","tag":"Documentation","count":103},{"language":"default","tag":"Help Center","count":90},{"language":"default","tag":"Merchandising","count":57},{"language":"default","tag":"Developers","count":42},{"language":"default","tag":"API Reference","count":25},{"language":"default","tag":"SDK","count":20},{"language":"default","tag":"Sort Orders","count":18},{"language":"default","tag":"Configuration","count":15},{"language":"default","tag":"Liquid","count":14},{"language":"default","tag":"Search \u0026 Discovery","count":14}]},"assistantConfig":{"enableAskAiButton":true,"enableAskAiSearchBar":false,"deflection":{"enabled":true,"email":"support@uselayers.com","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"platform/metrics/recipes","slug":"/platform/metrics/recipes","pageMetadata":{"title":"Metric recipes","description":"Pre-configured metric recipes for common LayersQL and ShopifyQL use cases — sales, views, carts, returns, and velocity — that you can copy into your store.","href":"/platform/metrics/recipes"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Pre-configured metric recipes for common LayersQL and ShopifyQL use cases — sales, views, carts, returns, and velocity — that you can copy into your store.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Layers provides pre-configured metric recipes that implement common use cases for both LayersQL and Imported metrics.`}),`\n`,_jsx(Heading,{level:`2`,id:`dashboard-metric-recipes`,children:`Dashboard metric recipes`}),`\n`,_jsxs(_components.p,{children:[`When you create a new store, Layers automatically provisions a set of default dashboard metrics on the `,_jsx(_components.strong,{children:`Overview`}),` dashboard. These metrics give you an at-a-glance summary of key performance indicators without any manual setup.`]}),`\n`,_jsx(_components.p,{children:`Dashboard recipes include aggregate metrics for search, collections, orders, revenue, image search, similar products, and block recommendations. They are displayed as cards or tables depending on the metric type.`}),`\n`,_jsx(Heading,{level:`3`,id:`block-analytics-dashboard-recipes`,children:`Block analytics dashboard recipes`}),`\n`,_jsxs(_components.p,{children:[`The following recipes track how your `,_jsx(_components.a,{href:`/platform/blocks`,children:`recommendation blocks`}),` perform. They are added to the Overview dashboard automatically for all stores.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Block Impressions (30d)`}),` — Card`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` blocks`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`COUNT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(requests)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`30d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Total number of block recommendation requests over the last 30 days.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Block Revenue (30d)`}),` — Card`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` blocks`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`SUM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(total_sales)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`30d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Total revenue attributed to block recommendations over the last 30 days.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Block Conversion Rate (30d)`}),` — Card`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` blocks`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW (COUNT_DISTINCT(cart_sessions) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` NULLIF`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(COUNT_DISTINCT(requests),`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 100`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`30d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Percentage of block recommendation requests that resulted in an add to cart over the last 30 days.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Block Click Sessions (30d)`}),` — Card`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` blocks`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW COUNT_DISTINCT(click_sessions)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`30d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Unique sessions where a product from block recommendations was clicked over the last 30 days.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Top Blocks (30d)`}),` — Table`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` blocks`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`COUNT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(requests)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` block_title`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`30d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Your most-requested recommendation blocks over the last 30 days, ranked by request volume.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Top Blocks by Revenue (30d)`}),` — Table`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` blocks`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`SUM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(total_sales)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` block_title`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`30d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Recommendation blocks generating the most revenue over the last 30 days.`}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Block analytics recipes query the `,_jsx(_components.a,{href:`/platform/layersql/datasets/blocks`,children:`blocks dataset`}),`. You need the `,_jsx(_components.a,{href:`/shopify-integration/storefront-pixel`,children:`Storefront Pixel`}),` installed to track block interactions and attribute revenue.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`geographic-dashboard-recipes`,children:`Geographic dashboard recipes`}),`\n`,_jsxs(_components.p,{children:[`Geographic dashboard recipes show where search demand is concentrated. They use the `,_jsx(_components.code,{children:`geo_bar`}),` chart type, which renders a ranked horizontal bar chart and resolves two-letter country codes (for example, `,_jsx(_components.code,{children:`US`}),`) into full country names (`,_jsx(_components.code,{children:`United States`}),`). Bars are sorted in descending order by search volume, and `,_jsx(_components.code,{children:`LIMIT 12`}),` keeps the chart readable on dashboard tiles.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Searches by Country (30d)`}),` — Geo bar`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` search_text`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`COUNT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(requests) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`AS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` searches`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WHERE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` geo_country `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`IS NOT NULL`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` geo_country`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`30d`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`VISUALIZE searches `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`TYPE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` geo_bar `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` geo_country `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`LIMIT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 12`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Search request volume grouped by shopper country over the last 30 days. Use this to identify the markets driving the most search demand.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Searches by State/Region (30d)`}),` — Geo bar`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` search_text`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`COUNT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(requests) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`AS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` searches`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WHERE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` geo_state `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`IS NOT NULL`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` geo_state`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`30d`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`VISUALIZE searches `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`TYPE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` geo_bar `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` geo_state `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`LIMIT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 12`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Search request volume grouped by shopper state or region over the last 30 days. Use this to spot regional demand within the countries you serve.`}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Geographic recipes query the `,_jsx(_components.a,{href:`/platform/layersql/datasets/search-text`,children:`search (text) dataset`}),` and rely on the `,_jsx(_components.code,{children:`geo_country`}),` and `,_jsx(_components.code,{children:`geo_state`}),` fields captured with each search request. Rows without geo data are excluded.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`filter-usage-dashboard-recipes`,children:`Filter usage dashboard recipes`}),`\n`,_jsxs(_components.p,{children:[`Filter usage dashboard recipes show how shoppers use filter facets on collection pages. They query the `,_jsx(_components.a,{href:`/platform/layersql/datasets/collections`,children:`collections dataset`}),` and rely on the shopper-applied `,_jsx(_components.code,{children:`filter_property`}),` and `,_jsx(_components.code,{children:`filter_value`}),` dimensions. Transform-injected filters and the built-in collection scope are excluded so the counts reflect facet interactions, not the base collection.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Filter usage by facet (30d)`}),` — Bar`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` collections`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW COUNT_DISTINCT(filtered_requests)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` filter_property`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`30d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`How often shoppers apply each filter facet across collections over the last 30 days. A request that uses several facets counts once per facet, so this ranks facets by reach rather than deduplicating requests.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Filter values by facet (30d)`}),` — Table`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` collections`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW COUNT_DISTINCT(filtered_requests)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` filter_property, filter_value`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`30d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Which values shoppers pick within each filter facet over the last 30 days. Use this to see whether specific colors, sizes, or price bands drive facet usage.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Zero-result filters by value (30d)`}),` — Table`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` collections`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW COUNT_DISTINCT(filtered_zero_results)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` filter_property, filter_value`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`HAVING`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` COUNT_DISTINCT(filtered_zero_results) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`30d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Filter selections that returned no products over the last 30 days, by facet and value. Use this to find dead-end combinations to prune from your facet configuration or fill with catalog work.`}),`\n`,_jsx(Heading,{level:`3`,id:`product-engagement-dashboard-recipes`,children:`Product engagement dashboard recipes`}),`\n`,_jsxs(_components.p,{children:[`Product engagement dashboard recipes summarize shopper interaction with product tiles. They query the `,_jsx(_components.a,{href:`/platform/layersql/datasets/products`,children:`products dataset`}),` and depend on `,_jsx(_components.code,{children:`product_impression`}),`, `,_jsx(_components.code,{children:`product_hover`}),`, and `,_jsx(_components.code,{children:`product_touch`}),` events emitted by the `,_jsx(_components.a,{href:`/shopify-integration/storefront-pixel`,children:`Storefront Pixel`}),` or sent through the `,_jsx(_components.a,{href:`/tracking-api/send-events`,children:`Tracking API`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Product Impressions (30d)`}),` — Card`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` products`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW product_impressions`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`30d`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`COMPARE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`TO`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` previous_period`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Total tracked product impression events over the last 30 days, with the previous-period delta.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Top Products by Impressions (30d)`}),` — Table`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` products`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW product_impressions`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`30d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Products ranked by tracked impression events over the last 30 days.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Product Hover Rate (30d)`}),` — Card`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` products`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW hover_rate`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`30d`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`COMPARE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`TO`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` previous_period`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Tracked product hovers divided by impressions over the last 30 days. Indicates how often shoppers explore tiles on desktop.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Product Touch Rate (30d)`}),` — Card`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` products`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW touch_rate`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`30d`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`COMPARE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`TO`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` previous_period`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Tracked product touches divided by impressions over the last 30 days. Indicates tile engagement on mobile.`}),`\n`,_jsx(Heading,{level:`2`,id:`layersql-metric-recipes`,children:`LayersQL metric recipes`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Total Sales (7 days)`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` products`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`SUM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(total_sales)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`7d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Revenue tracked by Layers over the last 7 days. Use for merchandising based on search-driven conversions.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Total Sales - Variant Level (7 days)`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` products`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`SUM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(total_sales)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product, variant`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`7d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`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.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Total Quantity (7 days)`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` products`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`SUM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(quantity_purchased)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`7d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Number of items purchased in the last 7 days. Use to identify high-volume products.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`View Sessions (7 days)`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` products`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW COUNT_DISTINCT(view_sessions)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`7d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Unique product view sessions in the last 7 days. Track product visibility and interest.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Cart Sessions (7 days)`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` products`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW COUNT_DISTINCT(cart_sessions)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`7d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Unique add-to-cart sessions in the last 7 days. Measure purchase intent.`}),`\n`,_jsx(Heading,{level:`2`,id:`trending-metric-recipes`,children:`Trending metric recipes`}),`\n`,_jsxs(_components.p,{children:[`Trending metric recipes weight recent sales more heavily than older ones so ranking reacts quickly to shifts in what shoppers are buying. Use them in a sort order when a flat trailing window (like 7-day or 30-day units) hides products whose sales are picking up right now. They only make sense once your store has enough recent purchase history for a short-horizon window to reliably predict next week’s sales. Layers gates the `,_jsx(_components.a,{href:`/platform/sorting/weighted-groups#trending-measures`,children:`Trending measures in the sort metric picker`}),` on that check.`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Trending units (7-day half-life, 28 days)`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` products`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`SUM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(quantity_purchased_decayed_7d)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`28d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Units sold in the last 28 days where each sale loses half its weight every 7 days. Yesterday’s units count in full, units from a week ago count half, units from two weeks ago count a quarter. Use to surface fast-moving products without being fooled by month-old sales.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Trending units (14-day half-life, 56 days)`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` products`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`SUM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(quantity_purchased_decayed_14d)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`56d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Same shape as the 7-day variant but with a longer memory. Recent sales still dominate, but slow-and-steady sellers aren’t shut out. Use for catalogs with steadier turnover where a 7-day half-life feels too jumpy.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Units momentum (7d vs prior 7d)`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` products`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`SUM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(units_last_7d) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` NULLIF`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`SUM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(units_prior_7d), `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`HAVING`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` SUM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(units_prior_7d) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 100`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`14d`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Ratio of the last 7 days of units sold to the 7 days before. Values above 1 mean the product is accelerating, values below 1 mean it’s cooling off. Pair with a threshold on prior-period units (default 100) so a product with a single unit last week can’t leapfrog established sellers.`}),`\n`,_jsx(Heading,{level:`2`,id:`imported-shopifyql-metric-recipes`,children:`Imported (ShopifyQL) metric recipes`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Return Rate (7 days)`}),` - Refresh: Daily`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` sales`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW product_id, returned_quantity_rate`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WHERE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`IS NOT NULL`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product_id`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`7d UNTIL today`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Percentage of returned items from Shopify. Identify products with quality or sizing issues.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Average Sales Price (7 days)`}),` - Refresh: Daily`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` sales`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW product_id, average_order_value`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WHERE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`IS NOT NULL`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product_id`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`7d UNTIL today`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Average order value after discounts. Understand actual selling prices vs. list prices.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Revenue (7 days)`}),` - Refresh: Daily`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` sales`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW product_id, net_sales`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WHERE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`IS NOT NULL`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product_id`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`7d UNTIL today`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Net sales (sales minus returns) from Shopify. Authoritative revenue for financial merchandising.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Sales Velocity`}),` - Refresh: Daily`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` sales`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SHOW product_id, (net_items_sold `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 168`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` sales_velocity_per_hour`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WHERE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`IS NOT NULL`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GROUP BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product_id`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SINCE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`7d UNTIL today`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Units sold per hour from 7-day Shopify data. Track product momentum and trending items.`}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`These recipes are available in your Layers dashboard. Go to `,_jsx(_components.strong,{children:`Analytics`}),` > `,_jsx(_components.strong,{children:`Reports`}),`, then open `,_jsx(_components.strong,{children:`LayersQL Report Recipes`}),` or `,_jsx(_components.strong,{children:`Imported Report Recipes`}),` from the page’s actions menu to install and customize them for your needs.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Metric recipes","description":"Pre-configured metric recipes for common LayersQL and ShopifyQL use cases — sales, views, carts, returns, and velocity — that you can copy into your store.","href":"/platform/metrics/recipes"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Dashboard metric recipes","slug":"dashboard-metric-recipes","depth":2,"children":[{"title":"Block analytics dashboard recipes","slug":"block-analytics-dashboard-recipes","depth":3,"children":[]},{"title":"Geographic dashboard recipes","slug":"geographic-dashboard-recipes","depth":3,"children":[]},{"title":"Filter usage dashboard recipes","slug":"filter-usage-dashboard-recipes","depth":3,"children":[]},{"title":"Product engagement dashboard recipes","slug":"product-engagement-dashboard-recipes","depth":3,"children":[]}]},{"title":"LayersQL metric recipes","slug":"layersql-metric-recipes","depth":2,"children":[]},{"title":"Trending metric recipes","slug":"trending-metric-recipes","depth":2,"children":[]},{"title":"Imported (ShopifyQL) metric recipes","slug":"imported-shopifyql-metric-recipes","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/protoninc/d2da920448b9ce07/track.js"],"subdomain":"protoninc","siteName":"Layers","title":"Metric recipes - Layers","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-17T15:08:03.205Z","originalFileLocation":"platform/metrics/recipes.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Pre-configured metric recipes for common LayersQL and ShopifyQL use cases — sales, views, carts, returns, and velocity — that you can copy into your store.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Layers\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Metric recipes - Layers\">\u003cmeta data-mint-head property=\"og:description\" content=\"Pre-configured metric recipes for common LayersQL and ShopifyQL use cases — sales, views, carts, returns, and velocity — that you can copy into your store.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Layers\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.uselayers.com/platform/metrics/recipes\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://protoninc.mintlify.site/_mintlify/api/og/v2?division=Metrics\u0026amp;title=Metric+recipes\u0026amp;description=Pre-configured+metric+recipes+for+common+LayersQL+and+ShopifyQL+use+cases+%E2%80%94+sales%2C+views%2C+carts%2C+returns%2C+and+velocity+%E2%80%94+that+you+can+copy+into+your+store.\u0026amp;theme=b639e83e40674e1127455713\u0026amp;signature=f7d6837e0b3e91e00865b75c70a80c2c1918d1c071265e2b55c34c4c352a86c6\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Metric recipes - Layers\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Pre-configured metric recipes for common LayersQL and ShopifyQL use cases — sales, views, carts, returns, and velocity — that you can copy into your store.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://protoninc.mintlify.site/_mintlify/api/og/v2?division=Metrics\u0026amp;title=Metric+recipes\u0026amp;description=Pre-configured+metric+recipes+for+common+LayersQL+and+ShopifyQL+use+cases+%E2%80%94+sales%2C+views%2C+carts%2C+returns%2C+and+velocity+%E2%80%94+that+you+can+copy+into+your+store.\u0026amp;theme=b639e83e40674e1127455713\u0026amp;signature=f7d6837e0b3e91e00865b75c70a80c2c1918d1c071265e2b55c34c4c352a86c6\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/protoninc/-Zid9_7urMZu-aPC/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Layers\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#607FFD\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.uselayers.com/platform/metrics/recipes\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/platform/metrics/recipes.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.uselayers.com/#organization\",\"name\":\"Layers\",\"url\":\"https://docs.uselayers.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/protoninc/PNs-gxGUVcdBDEEC/logo.svg?fit=max\u0026auto=format\u0026n=PNs-gxGUVcdBDEEC\u0026q=85\u0026s=989e3194cb32f07e7018b8b7186b9007\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.uselayers.com#website\",\"name\":\"Layers\",\"url\":\"https://docs.uselayers.com\",\"publisher\":{\"@id\":\"https://docs.uselayers.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.uselayers.com/platform/metrics/recipes#webpage\",\"url\":\"https://docs.uselayers.com/platform/metrics/recipes\",\"name\":\"Metric recipes\",\"description\":\"Pre-configured metric recipes for common LayersQL and ShopifyQL use cases — sales, views, carts, returns, and velocity — that you can copy into your store.\",\"dateModified\":\"2026-10-17T15:08:03.205Z\",\"isPartOf\":{\"@id\":\"https://docs.uselayers.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.uselayers.com/platform/metrics/recipes#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.uselayers.com/platform/metrics/recipes#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Catalog \u0026 Data\",\"item\":\"https://docs.uselayers.com/platform/attributes\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Metrics\",\"item\":\"https://docs.uselayers.com/platform/metrics\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Metric recipes\",\"item\":\"https://docs.uselayers.com/platform/metrics/recipes\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.uselayers.com/platform/metrics/recipes#article\",\"headline\":\"Metric recipes\",\"name\":\"Metric recipes\",\"description\":\"Pre-configured metric recipes for common LayersQL and ShopifyQL use cases — sales, views, carts, returns, and velocity — that you can copy into your store.\",\"url\":\"https://docs.uselayers.com/platform/metrics/recipes\",\"mainEntityOfPage\":{\"@id\":\"https://docs.uselayers.com/platform/metrics/recipes#webpage\"},\"dateModified\":\"2026-10-17T15:08:03.205Z\",\"publisher\":{\"@id\":\"https://docs.uselayers.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.uselayers.com#website\"}}]}\u003c/script>","agentPointerHref":"/platform/metrics/recipes.md","siteName":"Layers","nav":{"global":null,"anchors":[{"anchor":"Documentation","groups":[{"group":"Overview","pages":[{"title":"Layers for Shopify Plus: search and merchandising","sidebarTitle":"Introduction","href":"/introduction"}]},{"group":"Core Concepts","pages":[{"title":"Product attributes: core concepts","sidebarTitle":"Attributes","href":"/core-concepts/attributes"},{"title":"Search","href":"/core-concepts/search"},{"title":"Sorting","href":"/core-concepts/sorting"},{"title":"Merchandising","href":"/core-concepts/merchandising"},{"title":"Real-time collaboration","href":"/platform/real-time-collaboration"}]},{"group":"Merchandising","pages":[{"title":"Collection sources","href":"/platform/collection-sources"},{"group":"Merchandising Rules","pages":[{"title":"Merchandising rules","href":"/platform/merchandising"},{"title":"Pins \u0026 media overrides","href":"/platform/merchandising/pins"},{"title":"Banner injection","sidebarTitle":"Banners","href":"/platform/merchandising/banners"},{"title":"Banner types","sidebarTitle":"Banner types","href":"/platform/merchandising/banner-types"},{"title":"Featured media override","href":"/platform/merchandising/featured-media"},{"title":"Sell-out pin deletion","href":"/platform/merchandising/sell-out-deletion"},{"title":"Expressions \u0026 automation","href":"/platform/merchandising/expressions"},{"title":"Soft boost expressions","href":"/platform/merchandising/soft-boost-expressions"},{"title":"Diversity expressions in sort orders","href":"/platform/merchandising/diversity"},{"title":"Draft products \u0026 filtering","href":"/platform/merchandising/draft-and-filtering"},{"title":"Previewing rules","href":"/platform/merchandising/preview"},{"title":"Multiple rules per collection","href":"/platform/merchandising/multiple-rules"},{"title":"Contextual conditions","href":"/platform/merchandising/contextual-conditions"},{"title":"Rule scheduling","href":"/platform/merchandising/scheduling"}]},{"group":"Blocks","pages":[{"title":"Blocks","href":"/platform/blocks"},{"title":"Recommendation block strategies","href":"/platform/blocks/strategies"},{"title":"Rules \u0026 safeguards","href":"/platform/blocks/rules-and-safeguards"},{"title":"Fallback chains","href":"/platform/blocks/fallback-chains"},{"title":"Priority \u0026 status","href":"/platform/blocks/priority-and-status"}]},{"group":"Variant Breakouts","pages":[{"title":"Variant breakouts","href":"/platform/variant-breakouts"},{"title":"Configuration \u0026 behavior","href":"/platform/variant-breakouts/configuration"},{"title":"API impact \u0026 use cases","href":"/platform/variant-breakouts/api-impact"}]},{"title":"Product families","href":"/platform/product-families"},{"title":"Hidden content rules","href":"/platform/hidden-products"},{"title":"Product sequences","href":"/platform/sequences"},{"group":"Sort Orders","pages":[{"title":"Sort orders","href":"/platform/sorting"},{"title":"Priority rules","href":"/platform/sorting/priority-rules"},{"title":"Priority rule examples","href":"/platform/sorting/priority-rule-examples"},{"title":"Sort order recipes","href":"/platform/sorting/recipes"},{"title":"Weighted groups","href":"/platform/sorting/weighted-groups"},{"title":"Soft boost","href":"/platform/sorting/soft-boost"},{"title":"Conditional sort expressions","href":"/platform/sorting/conditional-expressions"},{"title":"Segmented \u0026 conditional sorting","href":"/platform/sorting/segmented-sorting"},{"title":"Preview \u0026 annotations","href":"/platform/sorting/preview"}]},{"title":"Filters / facets","href":"/platform/facets"}]},{"group":"Search \u0026 Discovery","pages":[{"title":"Ranking relevancy","href":"/platform/ranking-relevancy"},{"title":"Semantic redirects","href":"/platform/semantic-redirects"},{"title":"Autocomplete curation","href":"/platform/autocomplete-curation"},{"title":"Search instructions","href":"/platform/search-instructions"},{"title":"Request transforms","href":"/platform/request-transforms"},{"title":"Filtering language","href":"/engine/filtering"},{"title":"Geospatial filtering and distance sort","href":"/engine/geospatial-filtering"},{"title":"Query understanding","href":"/engine/user-intent-processing"},{"title":"Query interpretation","href":"/engine/query-interpretation"},{"title":"Typo tolerance","href":"/engine/typo-tolerance"},{"group":"Contextual Information","pages":[{"title":"Contextual information","href":"/engine/contextual-information"},{"title":"Context data structure","href":"/engine/contextual-information/data-structure"},{"title":"Usage \u0026 privacy","href":"/engine/contextual-information/usage-and-privacy"}]},{"title":"Supported languages","href":"/engine/supported-languages"}]},{"group":"Catalog \u0026 Data","pages":[{"group":"Attributes","pages":[{"title":"Manage attributes in the Layers dashboard","sidebarTitle":"Overview","href":"/platform/attributes"},{"title":"Catalog attributes","sidebarTitle":"Catalog attributes","href":"/platform/attributes/catalog-attributes"},{"title":"Attribute options","sidebarTitle":"Attribute options","href":"/platform/attributes/attribute-options"},{"title":"Attribute classes","sidebarTitle":"Attribute classes","href":"/platform/attributes/attribute-classes"}]},{"group":"Computed Attributes","pages":[{"title":"Computed attributes","href":"/platform/attributes/calculated-attributes"},{"title":"Computed attribute Functions","href":"/platform/attributes/functions"},{"title":"Computed attribute recipes","href":"/platform/attributes/calculated-attributes/recipes"}]},{"group":"Metrics","pages":[{"title":"Metrics","description":"Understand the performance metrics Layers provides — sales, views, conversions, returns, velocity — and how they power sort orders and merchandising rules.","href":"/platform/metrics"},{"title":"Metric recipes","href":"/platform/metrics/recipes"},{"title":"Creating metrics \u0026 best practices","description":"How to create custom LayersQL and imported metrics in Layers, configure refresh schedules, and apply best practices for naming, scope, and query optimization.","href":"/platform/metrics/creating-and-best-practices"}]}]},{"group":"LayersQL","pages":[{"title":"LayersQL: query language for Layers analytics","sidebarTitle":"Overview","href":"/platform/layersql/overview"},{"title":"LayersQL syntax reference","href":"/platform/layersql/syntax"},{"title":"Functions","href":"/platform/layersql/functions"},{"group":"Datasets","pages":[{"title":"LayersQL datasets and shared dimensions","sidebarTitle":"Datasets","href":"/platform/layersql/datasets"},{"title":"Products dataset","href":"/platform/layersql/datasets/products"},{"title":"Sales dataset","href":"/platform/layersql/datasets/sales"},{"title":"Search (text) dataset","href":"/platform/layersql/datasets/search-text"},{"title":"Search (image) dataset","href":"/platform/layersql/datasets/search-image"},{"title":"Search (similar) dataset","href":"/platform/layersql/datasets/search-similar"},{"title":"Collections dataset","href":"/platform/layersql/datasets/collections"},{"title":"Blocks dataset","href":"/platform/layersql/datasets/blocks"},{"title":"Optimizations dataset","href":"/platform/layersql/datasets/optimizations"}]}]},{"group":"Shopify Integration","pages":[{"title":"Shopify catalog sync: webhooks, metafields, and inventory","sidebarTitle":"Catalog sync","href":"/shopify-integration/catalog-sync"},{"title":"Crawler Signatures","sidebarTitle":"Crawler Signatures","href":"/shopify-integration/crawler-signatures"},{"group":"Metaobjects \u0026 Metafields","pages":[{"title":"Metaobjects \u0026 metafields","sidebarTitle":"Metaobjects \u0026 metafields","href":"/shopify-integration/metaobjects-metafields"},{"title":"Metaobjects","sidebarTitle":"Metaobjects","href":"/shopify-integration/metaobjects-metafields/metaobjects"},{"title":"Collection \u0026 app metafields","sidebarTitle":"Collection \u0026 app metafields","href":"/shopify-integration/metaobjects-metafields/app-metafields"},{"title":"Cache, sync \u0026 access","sidebarTitle":"Cache, sync \u0026 access","href":"/shopify-integration/metaobjects-metafields/cache-and-access"}]},{"title":"Storefront Pixel","sidebarTitle":"Storefront Pixel","href":"/shopify-integration/storefront-pixel"},{"title":"Shopify admin extensions","sidebarTitle":"Shopify admin extensions","href":"/shopify-integration/shopify-admin-extensions"},{"title":"Shopify Markets","sidebarTitle":"Shopify Markets","href":"/shopify-integration/shopify-markets"},{"title":"Translations","href":"/shopify-integration/translations"},{"title":"Shopify B2B Catalogs","sidebarTitle":"B2B Catalogs","href":"/shopify-integration/b2b-catalogs"},{"title":"Discount entitlements","sidebarTitle":"Discount entitlements","href":"/shopify-integration/discount-entitlements"},{"title":"Mobile apps (Tapcart, Fuego, Canvas)","sidebarTitle":"Mobile apps","href":"/shopify-integration/mobile-apps"}]},{"group":"Legal","pages":[{"title":"Legal Information","href":"/legal/legal-information"},{"title":"Service Level Agreement (SLA)","href":"/legal/service-level-agreement"},{"title":"Infrastructure \u0026 Sub-processors","href":"/legal/sub-processors"},{"title":"Privacy Statement","href":"/legal/privacy-statement"},{"title":"Terms of Use","href":"/legal/terms-of-use"},{"title":"Security Disclosure","href":"/legal/security-disclosure"},{"title":"Compliance","href":"/legal/compliance"},{"title":"Security overview","href":"/legal/security-overview"},{"title":"AI \u0026 your data","href":"/legal/ai-data-use"},{"title":"Data lifecycle","href":"/legal/data-lifecycle"},{"title":"Incident response overview","href":"/legal/incident-response"},{"title":"Report abuse","href":"/legal/abuse"}]}]},{"anchor":"Help Center","icon":"map","pages":[{"title":"Help Center","href":"/help/onboarding/install"}]},{"anchor":"Developers","icon":"code","pages":[{"title":"Developers","href":"/developers/overview"}]},{"anchor":"API Reference","icon":"rectangle-terminal","pages":[{"title":"API Reference","href":"/api-reference/browse"}]},{"anchor":"Integrations","icon":"plug","href":"https://www.uselayers.com/integrations?utm_source=docs\u0026utm_medium=referral\u0026utm_campaign=docs-to-site"}]},"basePath":"","title":"Metric recipes - Layers","buildId":"dpl_596ePT575z4qnAFksq1biRW97aLY","deploymentId":"dpl_596ePT575z4qnAFksq1biRW97aLY","dynamics":[],"chunks":[]}