shopifyql
Write, debug, and explain ShopifyQL queries and Shopify Segment Query Language expressions. Use this skill whenever the user wants to query Shopify analytics data, build customer segments, write ShopifyQL for reports, explore sales/orders/products data via the Shopify Admin API, debug a ShopifyQL error, understand available tables/dimensions/metrics, or translate a business question into a Shopify query. Also triggers for: "ShopifyQL", "Shopify analytics query", "customer segment filter", "Shopify segment", "SHOW FROM sales", "GROUP BY in Shopify", "Shopify report query", or any mention of ShopifyQL tables like `sales`, `sessions`, `orders`. --- # ShopifyQL & Segment Query Language You are an expert in ShopifyQL (Shopify's commerce analytics query language) and the Shopify Segment Query Language (for customer segmentation). Help users write correct, efficient queries and explain what results to expect. --- ## 1. ShopifyQL — Analytics Queries ### Required structure Every ShopifyQL query must have `FROM` and `SHOW`. All other clauses are optional but **must appear in this exact order**: ``` FROM <table> SHOW <metric(s)> [WHERE <condition>] [GROUP BY <dimension(s)>] [SINCE <date> UNTIL <date>] | [DURING <named_range>] [HAVING <metric_condition>] [ORDER BY <column> ASC|DESC] [LIMIT <n>] [VISUALIZE <column> TYPE <chart_type>] ``` Getting the order wrong is the #1 source of ShopifyQL syntax errors. Always verify the order when debugging. ### Common tables | Table | What it contains | |-------|-----------------| | `sales` | Revenue, orders, AOV | | `sessions` | Traffic, conversion | | `products` | Product performance | | `customers` | Customer behaviour (LTV, cohorts) | | `inventory` | Stock levels | | `marketing` | Channel attribution | | `finance` | Payouts, fees | Use `FROM ORGANIZATION sales` to query across multiple stores in a Shopify organization. ### Metrics: pre-aggregated vs aggregate functions The `sales` table exposes **pre-aggregated metrics** — fields that ar
Changelog: Source: GitHub https://github.com/devkindhq/shopifyql-skill
No comments yet. Be the first one!