App development

Ship analytics in your Shopify app without building a data stack

Shopify apps can now model, query, and embed analytics natively: analytics-queryable metafields, App Events, a versioned ShopifyQL API, and metric-card web components. Here's what it deletes from your codebase.

Bas Lefeber

Founder, learnshopify.dev · July 31, 2026 · 6 min read

Ready to learn Shopify development?Short, interactive lessons where you write real Liquid against a live storefront and watch it change as you type. Free, and genuinely fun.

There is a stage every successful Shopify app reaches where merchants start asking what it did for them. The feature works; now prove it. And the honest answer for most teams is that proving it costs more than the feature did. You end up running an event pipeline, a warehouse or at least a time-series table, a rollup job, a charting library, number and currency formatting for every locale a merchant might use, and a dashboard that never quite matches the numbers in Shopify's own analytics because it is computing them differently.

On July 21, 2026, at DotDev, Shopify shipped full-stack capabilities to power app analytics, which is a plain way of saying: that entire stack is now platform infrastructure. It lands in API version 2026-10. This post walks the four layers and, more usefully, what each one deletes.

Four layers you used to own, now provided. The app keeps the domain logic and gives up the plumbing.

TL;DR

Mark a metafield analytics-queryable and it becomes a ShopifyQL dimension. Emit App Events and they become queryable alongside Shopify's own commerce data. Query both through the ShopifyQL API, now versioned with schema-level reference docs. Render the result with <s-shopifyql-metric-card> and <s-metrics-bar>, which handle charting and locale formatting. Then enrich with the Annotations and Metric Targets APIs.

Layer 1: get your data into the model

The interesting design choice here is that Shopify did not build a separate place to put app analytics data. It made the places your data already lives queryable.

Analytics-queryable metafields. A metafield can now be marked as analytics-queryable, at which point it becomes a ShopifyQL dimension: something you can group and break down by. If your app writes a supplier or margin_band or size_recommendation metafield onto products, merchants can now slice Shopify's own sales data by it. You wrote the data once, for your feature; the analytics capability comes free.

App Events. Your app emits custom events (an onboarding completed, a sync run, a recommendation accepted) and they become queryable in the same system as orders and sessions. This is the same App Events mechanism that underpins usage-based app pricing, which is a neat piece of platform design: one event stream serves billing and analytics rather than two.

The join is the point

Your custom data becoming a dimension on Shopify's data is worth more than either half alone. "Revenue by the supplier field my app manages" is a query neither party could answer before: Shopify has the revenue and not your dimension, you have the dimension and only an approximation of the revenue.

Layer 2: query it with ShopifyQL

ShopifyQL has existed for a while as a query language for commerce data. What changed is status: it is now a first-class part of the platform, with schema-level reference documentation and stable, versioned queries. That is the difference between a feature you experiment with and one you build a product on.

The language reads like SQL that had the confusing parts removed. Three concepts: schemas are the queryable datasets you select with FROM, metrics are measurable values you retrieve with SHOW, and dimensions are the breakdown categories you segment by with GROUP BY.

text
FROM sales  SHOW total_sales  DURING last_month

Add a time series:

text
FROM sales  SHOW total_sales  TIMESERIES day  SINCE -30d UNTIL today

Or a breakdown, which is where your custom dimensions land:

text
FROM sales  SHOW total_sales  GROUP BY sales_channel  DURING last_month  ORDER BY total_sales DESC

From an app, you run these through the GraphQL Admin API and get structured table data back, with parse errors reported separately so you can surface a bad query intelligently instead of failing blank:

GraphQL Admin API
query RunShopifyQL {  shopifyqlQuery(    query: "FROM sales SHOW total_sales, orders TIMESERIES month SINCE -12m UNTIL today"  ) {    tableData {      columns { name, dataType, displayName }      rows    }    parseErrors  }}

Note displayName coming back with the column metadata. Shopify is handing you the merchant-facing label for each metric, already localised, which is a small thing that saves you maintaining a translation map of every metric name in every language you support.

Layer 3: embed it without a charting library

This is the layer most likely to delete code you have already written. Two web components ship for embedding results directly in your app UI:

  • <s-shopifyql-metric-card> renders a query as a metric card with its chart.
  • <s-metrics-bar> renders a row of metrics, plus a date picker component for the range control every analytics view needs.

They handle the charting and the locale handling. Concretely, that is a charting dependency you do not add to your bundle, a set of currency and number formatting decisions you do not make, and a visual language that matches the merchant's admin instead of approximating it. It also means your metric card keeps matching Shopify's admin when Shopify redesigns it, which is a maintenance cost people consistently forget to price in.

LayerWhat Shopify providesWhat you stop maintaining
ModelAnalytics-queryable metafields, App EventsEvent pipeline, time-series store, rollup jobs
QueryVersioned ShopifyQL API with schema docsAggregation SQL, metric definitions, a query cache
Embed<s-shopifyql-metric-card>, <s-metrics-bar>Charting library, locale + currency formatting, chart styling
EnrichAnnotations API, Metric Targets APIA parallel annotations model merchants have to maintain twice
What each layer replaces in a typical app analytics build.

Layer 4: the enrichment APIs

Two smaller APIs sit on top, and both are about your app participating in the merchant's analytics rather than running a separate universe beside it.

The Annotations API lets your app create annotations on charts through GraphQL, using the read_analytics_annotations and write_analytics_annotations scopes. If your app changed something (a price test started, a sync repaired a catalog, a campaign launched), it can mark that moment on the merchant's chart. The value is causal: a spike with a labelled cause is an insight, and a spike without one is a mystery the merchant will eventually blame on something.

The Metric Targets API exposes targets merchants set on metrics, so your app can reference them programmatically. That means your app can talk in the merchant's own terms ("72% of the way to your Q3 revenue target") rather than asking them to configure a goal a second time inside your settings page.

Model, query, embed, enrich. Each layer is usable on its own; adopted together they remove most of an analytics build.

When this is the wrong choice

A fair post names the limits. Building on this couples your analytics to Shopify's data model, its query language, and its release cadence. That is the right trade for most apps and the wrong one for a few:

  • Multi-platform apps. If your product also serves BigCommerce or WooCommerce merchants, you need a unified analytics layer of your own, and a Shopify-specific one becomes a second system rather than a replacement.
  • Analytics as the product. If merchants pay you specifically for analysis Shopify does not do, your differentiation lives in modelling and computation that ShopifyQL will not express. Use the embed layer, keep your own model.
  • Data that has to leave. Reporting that feeds a merchant's own warehouse, or joins data from systems Shopify has never seen, still needs a pipeline. The embedded components are for surfaces inside the admin.

For the large middle of the ecosystem, though, the app that wants a credible dashboard proving its own value, this is straightforwardly the right call. The dashboard was never the differentiator. It was the tax on having one.

Learn this properly · free lesson

App vs theme vs Function: which tool for which job

Deciding what your app owns and what the platform should own is the same judgment call in every direction: app, theme, or Function. Work through it on a real build. Free lesson, no signup.

Try this lesson — free

Where to start

  1. Read the changelog entry and the ShopifyQL reference. The schema-level docs are the new part and the reason this is buildable.
  2. List the metafields your app writes and ask which are dimensions a merchant would want to slice sales by. Those are your analytics-queryable candidates, and marking them is close to free.
  3. Write one ShopifyQL query that answers the question your merchants ask most often. If it answers cleanly, most of your dashboard is a query and a component.
  4. Before you build any more of an in-house dashboard, price the <s-shopifyql-metric-card> version of it. Bundle size, formatting, and design drift are easy to forget and expensive to keep.
  5. Plan for API version 2026-10, and check the DotDev 2026 roundup for the other removals landing in the same version.

Frequently asked questions

What is ShopifyQL?

ShopifyQL is Shopify's query language for commerce data, covering sales, orders, customers, marketing, inventory, and payments. Queries select a schema with FROM, retrieve metrics with SHOW, and break them down by dimensions with GROUP BY, plus time controls like TIMESERIES, DURING, SINCE, and UNTIL. As of the July 2026 update it is a first-class, versioned part of the platform with schema-level reference documentation.

How does a Shopify app run a ShopifyQL query?

Through the shopifyqlQuery field on the GraphQL Admin API, which returns tableData with typed columns (including a localised displayName) and rows, plus a separate parseErrors field. There is also a Python SDK for scripts and notebooks, and web components that run a query and render the result directly in your app's UI.

What are analytics-queryable metafields?

A metafield marked analytics-queryable becomes a ShopifyQL dimension, so Shopify's own commerce data can be grouped and broken down by it. It lets an app's custom data (a supplier, a margin band, a product attribute the app manages) be joined against sales and order metrics without the app building its own data pipeline.

What are the Shopify analytics web components?

<s-shopifyql-metric-card> renders a ShopifyQL query as a metric card with its chart, and <s-metrics-bar> renders a row of metrics, alongside a date picker component. They handle charting and locale formatting, so an app can embed analytics without adding a charting library or maintaining its own number and currency formatting.

What do the Annotations and Metric Targets APIs do?

The Annotations API lets an app create annotations on a merchant's analytics charts through GraphQL, using the read_analytics_annotations and write_analytics_annotations scopes, so events your app caused are labelled where the merchant sees the effect. The Metric Targets API exposes performance targets the merchant has set on metrics so the app can reference them programmatically instead of asking the merchant to re-enter goals.

Which API version includes the Shopify app analytics platform?

API version 2026-10. It spans the Admin GraphQL API, the App Events API, metafields and metaobjects, and ShopifyQL. The changelog entry was published July 21, 2026, during Shopify DotDev.

Start free

Ready to become a Shopify developer?

You just read how it works. Now write it yourself: real tickets from a live store, in an editor where the storefront updates as you type. Module 1 is free, no card.

Start your first lesson

Free · No credit card · Your first win in minutes

app-developmentShopifyQLPlatformAdmin API

About the author

Bas Lefeber, Founder, learnshopify.dev

Bas builds learnshopify.dev, where developers learn production-grade Shopify theme development against a live storefront. He writes about Liquid, theme architecture, and the parts of the job that still matter now that AI writes the code.

Keep going in the curriculum