Unlock Shop Campaigns Insights with ShopifyQL

Shop Campaigns performance data is now queryable via ShopifyQL, giving developers and merchants deeper analytics without extra scopes. Learn what changed, who it impacts, and how to start pulling campaign metrics today.

Unlock Shop Campaigns Insights with ShopifyQL
5 sections

Shopify just opened a new window into advertising performance. The latest developer changelog adds the shop_campaign_insights schema to ShopifyQL, letting apps fetch campaign‑level metrics—like spend, sales, ROAS, and more—directly from the same query endpoint you already use. No new OAuth scopes, no extra integration steps, just a richer data set you can embed in dashboards, reports, or custom automations.

What Changed: shop_campaign_insights in ShopifyQL

The shop_campaign_insights schema is now part of the ShopifyQL ecosystem. It surfaces both campaign‑level and segment‑level metrics, supporting time dimensions from hourly to yearly and respecting the merchant’s shop timezone. In practice, you can query fields such as ad_spend, sales, orders, roas, average_order_value, and average_customer_acquisition_cost by campaign name, customer segment, or any date range you need.

Who Is Affected?

*Developers* building analytics, reporting, or marketing automation apps are the primary audience. If your app already uses the shopifyqlQuery field with the read_reports scope, you can start pulling campaign data immediately. *Merchants* benefit indirectly—any third‑party app that surfaces these insights will give them a clearer picture of ad spend efficiency, helping them allocate budgets smarter.

How to Query Shop Campaigns Data

The query works exactly like any other ShopifyQL request. Below is a minimal GraphQL example that fetches spend, sales, and ROAS for a specific campaign over the last 30 days. Note the use of triple‑quoted strings for readability; you can also build the query dynamically in your language of choice.

graphql

{

shopifyqlQuery(

query: """

SELECT campaign_name, ad_spend, sales, roas

FROM shop_campaign_insights

WHERE campaign_name = 'Summer Sale'

AND date >= '2024-06-01'

"""

) {

rows

}

}

The response returns a rows array where each element corresponds to a time bucket (hourly, daily, etc.) depending on the granularity you requested. From there you can feed the data into charts, CSV exports, or trigger alerts when ROAS dips below a threshold.

Embedding Metrics with Analytics Web Components

If you want to display campaign KPIs without managing a data store, Shopify’s new Analytics Web Components are a shortcut. Drop the <shopify-analytics-metric> tag into your app UI, point it at the shop_campaign_insights schema, and the component renders a live metric card—complete with timezone handling and automatic refresh.

html

<shopify-analytics-metric

schema="shop_campaign_insights"

metric="roas"

filter="campaign_name='Summer Sale'"

period="daily"

></shopify-analytics-metric>

Because the component pulls directly from Shopify’s analytics backend, you don’t need to store or cache the data yourself, reducing compliance overhead and simplifying your architecture.

Next Steps for Developers and Merchants

  • Update your app’s query library – Ensure you’re using the latest shopifyqlQuery endpoint version. No code changes are required if you already have a generic query wrapper, but add the new schema name to your whitelist if you enforce schema validation.
  • Test with real data – Use a development store that runs active Shop Campaigns. Run the sample query above and verify the shape of rows.
  • Add UI components – Consider the Analytics Web Component for quick dashboards or build custom React/Vue charts using the raw data.
  • Leverage Annotations – The Analytics Annotations API lets you tag charts with events like "campaign started" or "budget increased," giving merchants contextual insight right on the graph.
  • Merchants should reach out to their app partners and ask whether the app now surfaces Shop Campaigns metrics. If you build the reports yourself, schedule a walkthrough to show how ROAS trends correlate with ad spend changes—this builds trust and demonstrates the value of the new data.

    By tapping into shop_campaign_insights today, you future‑proof your analytics stack and give merchants the granular visibility they need to optimize advertising ROI.

    Ready to level up your analytics? Start querying the new schema now, embed live metrics with Web Components, and let your merchants make data‑driven campaign decisions faster than ever.

    Tags
    Sources

    Related Articles

    Protecting Shoppers: Shopify’s New Confirmation Prompt for External Redirects

    Protecting Shoppers: Shopify’s New Confirmation Prompt for External Redirects

    Shopify now shows a confirmation modal before sending customers to untrusted external sites, helping prevent phishing and unwanted redirects. Learn what changed, who’s affected, and how to keep your store’s experience smooth.

    October 21, 20264 min
    Mastering Stock Counts: New Tools to Create, Manage, and Review Inventory in Shopify Admin

    Mastering Stock Counts: New Tools to Create, Manage, and Review Inventory in Shopify Admin

    Shopify’s latest Stock Count feature brings barcode scanning, real‑time reviews, and audit trails directly into the admin. Learn who it impacts, how to set it up, and what developers need to know.

    October 20, 20264 min
    Unlocking Analytics for Metaobjects: New Queryable Capability in the Shopify Admin API

    Unlocking Analytics for Metaobjects: New Queryable Capability in the Shopify Admin API

    Shopify’s 2027-01 GraphQL Admin API now lets you read and set the analyticsQueryable capability on metaobject definitions, aligning them with metafields. Learn what changed, who it impacts, and how to enable analytics for your custom data.

    October 20, 20263 min
    Securing Your Shopify App: New AI‑Powered Checks and Expiring Tokens

    Securing Your Shopify App: New AI‑Powered Checks and Expiring Tokens

    Shopify’s latest developer update forces app makers to adopt AI security scans, short‑lived access tokens, and tighter account protections. Learn what changed, who’s affected, and how to implement the new safeguards today.

    October 20, 20264 min