Skip to main content

Analytics

Shopify Analytics is a platform your app can build on to put your data in front of merchants, in the reports and dashboards they already use, without running your own data infrastructure. Model your data into it, query it with ShopifyQL, embed live charts in your app, and enrich it with merchant context. It's open to your app and to the AI agents that query it for merchants. Everything runs inside Shopify.

At the center is ShopifyQL, the query language behind Shopify Analytics. The metric cards, dashboards, and reports in the Shopify admin all run on it, and it's how your app reads analytics data. Your app builds on that one query layer with four building blocks you can combine.

For example, here's how it could work for an email marketing app:

  • Model your app's data: add a campaign_source metafield to orders and send an email_sent App Event, so both are queryable alongside store data.
  • Query it with ShopifyQL through the GraphQL Admin API: run a query like FROM app_events SHOW emails_sent GROUP BY app_name.
  • Embed it with a web component: show the results on the app's dashboard with a metric card (<s-shopifyql-metric-card>).
  • Enrich it with an annotation: mark an event, like a campaign launch, so its impact shows on the merchant's charts.
Model, Query, Embed, and Enrich — four building blocks on ShopifyQL, the query layer behind Shopify Analytics.

Anchor to Model your app's data into Shopify AnalyticsModel your app's data into Shopify Analytics

Your app's data becomes queryable in Shopify Analytics without a separate analytics store, whether it comes from metafields on records you already use or from App Events you send.

Mark a metafield definition as analytics-queryable and its values become a dimension in ShopifyQL, alongside store data. For example, add a campaign_source to an order or a subscription_status to a customer, and merchants can group, filter, and chart on it in reports. The values already live in Shopify.

ShopifyQL query

FROM sales
SHOW total_sales
GROUP BY order.metafields.my_app.campaign_source

App Events makes the events your app already sends to Shopify queryable in analytics. Declare your events, send them through the App Events API, and merchants can query them in ShopifyQL the same way they query store data. One query can compare the same event across every installed app.

Developer preview

App Events in Analytics is in developer preview. The preview is available to approved apps and supports declared standard events. Sign up for early access.

ShopifyQL query

FROM app_events
SHOW emails_sent
GROUP BY app_name

Anchor to Query analytics with ShopifyQLQuery analytics with ShopifyQL

GraphQL Admin API

query {
shopifyqlQuery(
query: "FROM sales SHOW total_sales, orders TIMESERIES month DURING last_year"
) {
tableData {
columns { name dataType }
rows
}
parseErrors
}
}

Anchor to Embed analytics with web componentsEmbed analytics with web components

Analytics web components render the same charts the Shopify admin uses, so you can show live analytics in your app without building your own charting, currency handling, or locale formatting. Each component runs a ShopifyQL query.

Metric card

<s-shopifyql-metric-card
heading="Total sales"
query="FROM sales
SHOW total_sales
TIMESERIES day WITH TOTALS, PERCENT_CHANGE
DURING last_month
COMPARE TO previous_period
VISUALIZE total_sales TYPE line"
></s-shopifyql-metric-card>
A ShopifyQL metric card with the heading Total sales, showing the total with its percent change from the previous period above a line chart of daily total sales for the last month.

Anchor to Enrich analytics with annotations and targetsEnrich analytics with annotations and targets

Annotations mark why a metric moved, attributed to your app. A loyalty app can mark the day a program launched, an email app can mark a campaign, and a subscription app can mark a pricing change. Create annotations with the analyticsAnnotationCreate mutation on the GraphQL Admin API, read them with analyticsAnnotations, and overlay them on a chart in ShopifyQL with ANNOTATE.

Metric targets let merchants set a goal for a metric, such as total sales for the quarter, and track progress in reports and dashboards. Create targets with the analyticsTargetCreate mutation on the GraphQL Admin API, read them with analyticsTargets, and compare against them in ShopifyQL with COMPARE TO TARGETS.

GraphQL Admin API

mutation {
analyticsAnnotationCreate(input: {
type: "campaign"
title: "Email campaign sent"
startedAt: "2026-02-06T09:00:00Z"
}) {
analyticsAnnotation { id type title }
userErrors { field message }
}
}

GraphQL Admin API

mutation {
analyticsTargetCreate(input: {
metric: "total_sales"
name: "Q3 sales target"
startDate: "2026-07-01"
endDate: "2026-09-30"
expectedValue: "50000.00"
}) {
analyticsTarget { id name metric expectedValue }
userErrors { field message }
}
}

Was this page helpful?