/databrill-core:dbl-metrics-shopify-salesfrom databrill-core
Report Shopify store performance from the daily reports — sales, net sales, gross profit, orders, sessions, conversion rate, bounce rate, returning customers. Use when the user asks how the Shopify store is doing, Shopify revenue or traffic for a period, Shopify conversion, why Shopify sales changed, or wants a week-over-week or month-over-month Shopify trend.
Ships in databrill-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
On a user- or organization-scoped connector, call listWorkspaces, select the
workspace, and pass its wsid explicitly to every data tool. A workspace-scoped
connector URL supplies that wsid. Never infer it from stores or from a
listWorkspaces result with one entry.
There is no dedicated MCP tool for Shopify. Use executeSql against
shopify_reports_v1__SalesDaily and shopify_reports_v1__SessionsDaily, one
row per (shopId, day).
Read ${CLAUDE_PLUGIN_ROOT}/docs/shopify-data-shape.md first. These two
tables carry more traps than any other Shopify family, and every one of them
returns a plausible wrong number rather than an error. For the declared columns
and types of any shopify_* table, read
${CLAUDE_PLUGIN_ROOT}/docs/schema/shopify/index.tsv and then that table's
.yaml beside it.
SalesDaily means zero sales. ShopifyQL returns no row
for a day with none, so that table is sparse while SessionsDaily is dense.
Always LEFT JOIN sessions → sales and COALESCE sales and order measures to 0.
For cost and profit, use zero only when the sales row is absent; preserve an
existing row's NULL as unavailable.
An INNER JOIN silently drops the store's worst days and inflates every
average.discounts and returns are negative. They are already signed; adding
them to gross_sales is correct, subtracting them double counts.conversion_rate from sessions and orders, and never average a rate across
days. average_session_duration is in seconds.day is the shop's local calendar day, not UTC.conversion_rate will not always agree with the day's own order count — a day
with sessions and orders can still report a conversion_rate of 0. It credits a
session, not an order. Do not put the two side by side as though they must
reconcile.
A workspace can hold several storefronts. Always start by listing them and pick or group explicitly:
SELECT "shopId", "name", "myshopifyDomain", "currencyCode", "ianaTimezone"
FROM "shopify_shop_v1__Shop" ORDER BY "name";
Never present a multi-shop total as one store's performance.
In the queries below, replace <shopId>, '<start>' and '<end>' with literal values: executeSql
takes no bind parameters.
SELECT sh."name",
se."day",
se."sessions",
se."pageviews",
ROUND(se."conversion_rate" * 100, 2) AS "conversionPct",
COALESCE(sa."total_sales", 0) AS "totalSales",
COALESCE(sa."net_sales", 0) AS "netSales",
COALESCE(sa."orders", 0) AS "orders",
COALESCE(sa."discounts", 0) AS "discounts", -- negative
COALESCE(sa."returns", 0) AS "returns", -- negative
CASE WHEN sa."shopId" IS NULL THEN 0 ELSE sa."gross_profit" END
AS "gross_profit",
sa."updatedAt" AS "dayLastRevised"
FROM "shopify_reports_v1__SessionsDaily" AS se
JOIN "shopify_shop_v1__Shop" AS sh ON sh."shopId" = se."shopId"
LEFT JOIN "shopify_reports_v1__SalesDaily" AS sa
ON sa."shopId" = se."shopId" AND sa."day" = se."day"
WHERE se."day" BETWEEN '<start>' AND '<end>'
ORDER BY sh."name", se."day";
cost_of_goods_sold, gross_profit and gross_margin can be NULL on an existing
sales row. The query above preserves unavailable profit and uses zero only for
an absent sales row. Do not replace unavailable cost or profit with zero or infer
one measure from another.
Period totals: sum the numerators and denominators, then divide. Never average
the per-day rates. SUM skips NULL, so a cost or profit total is incomplete if
any returned sales day lacks that measure. Report the total as unavailable, or
label it as a known-value subtotal and state how many sales days lack the value.
SELECT SUM(se."sessions") AS "sessions",
SUM(COALESCE(sa."orders", 0)) AS "orders",
SUM(COALESCE(sa."total_sales", 0)) AS "totalSales",
SUM(COALESCE(sa."orders", 0)) / NULLIF(SUM(se."sessions"), 0)
AS "ordersPerSession"
FROM "shopify_reports_v1__SessionsDaily" AS se
LEFT JOIN "shopify_reports_v1__SalesDaily" AS sa
ON sa."shopId" = se."shopId" AND sa."day" = se."day"
WHERE se."shopId" = <shopId> AND se."day" BETWEEN '<start>' AND '<end>';
Note that ordersPerSession computed this way is not the source's
conversion_rate, which uses its own inclusion rule. Report one or the other and
say which.
These tables can start well after the store did. Establish the range first and state it; do not present a partial window as a full one:
SELECT "shopId", MIN("day") AS "from", MAX("day") AS "to", COUNT(*) AS "days"
FROM "shopify_reports_v1__SessionsDaily" GROUP BY "shopId";
For history older than the reports, go to dbl-metrics-shopify-orders — the
orders table can reach back much further — and say that the two sources count
differently.
SalesDaily.updatedAt means when this day's numbers last changed, not when we
last looked. Recent days revise as returns land. If the user is comparing a
just-ended period, check whether its days are still being revised before
treating the comparison as settled. On SessionsDaily a completed day's numbers
settle when the shop-local day closes, so an old updatedAt there is normal.
Decompose sales-per-day into sessions × conversion × average order value, all
from these two tables, then attribute. gross_profit and gross_margin are
only as good as the merchant's per-variant cost data. Check cost_of_goods_sold
and each profit measure before drawing a margin conclusion: NULL means Shopify
supplied no value, while zero is a supplied value. NULL alone does not establish
why the value is unavailable or whether the merchant records per-variant costs.
${CLAUDE_PLUGIN_ROOT}/docs/diagnosis-methods.md has the general method.
dbl-metrics-shopify-orders for product, geography and refund breakdowns.
dbl-metrics-shopify-inventory for stock. This is Shopify only — Amazon's
equivalents are dbl-metrics-traffic and dbl-ask-sales-drop, and the two
channels must be reported separately.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub databrill/databrill-core-agent-plugin --plugin databrill-core19 skills in this plugin
/dbl-ask-inventory-pacingRecommend how advertising should respond to inventory — pause, throttle, hold, or ramp spend based on each product's runway. Use when the user asks "should we pause ads before the stockout", "we're low on stock, what about ads", "should we cut spend to stretch inventory", "we restocked — ramp back up?", "how do we sell down overstock", "long-term storage fee risk", or wants an inventory-driven ad pacing decision./dbl-ask-sales-dropDiagnose why a store's sales dropped — decompose the change into traffic, conversion, and price, and flag ad-channel and ad-efficiency causes. Use when the user asks "why did sales drop / fall / decline", "sales are down", "revenue dropped", "why did orders fall", "what happened to sales (week-over-week)", or wants a sales-decrease diagnosis for a marketplace./dbl-brand-configEdit brand configuration — product families, the ontology category and variant layer, ASIN-to-family and ASIN-to-SKU mapping, and effective-dated cost, rate and planning attributes. Use when the user asks to set up or edit product families, map ASINs to families or SKUs, seed the ontology, recategorise or relabel a family, or set a cost per unit, VAT rate or lead time for a period. Do not use for reading brand configuration — that is dbl-db./dbl-dashboardDesign or construct a dashboard, report, chart, table, or recurring analysis from Databrill MCP or database data. Use when the user asks to explore their data visually, build a dashboard or artifact, chart trends, make a management report, export a reporting dataset, or compare several accounts/workspaces./dbl-dbAnswer Databrill data questions that do not fit a dedicated metric skill by selecting the right MCP tool or a safe read-only Deno/n8n database workflow. Use for arbitrary database exploration, table or column discovery, SQL, CSV exports, orders, listings, returns, reimbursements, fees, settlements, Walmart, The Fulfillment Lab data, or questions about what data is available./dbl-metrics-adsAnalyze Amazon PPC advertising performance metrics including impressions, clicks, orders, spend, sales, CTR, CR, CPC, ACOS, and ROAS. Use when the user asks about ad performance, PPC metrics, advertising efficiency, campaign analysis, ACOS/ROAS, or spend by ad type (SP/SB/SBV/SD).