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

    Redesigned POS Channel Page Gives Merchants One‑Click Access to the Editor and Live Analytics
    Platform Updates

    Redesigned POS Channel Page Gives Merchants One‑Click Access to the Editor and Live Analytics

    Shopify’s fresh POS channel page puts customization, analytics and device setup front‑and‑center, letting merchants edit lock screens, receipts and more with a single click while giving staff quick performance insights.

    August 24, 20263 min
    Standard Storefront Events Now Support Cart Attributes – What Developers Need to Know
    Platform Updates

    Standard Storefront Events Now Support Cart Attributes – What Developers Need to Know

    Shopify’s latest update lets the standard updateCart action handle cart attributes and adds a shopify:cart:attributes-update event. Learn who’s affected, how to implement it, and actionable steps to keep your UI in sync.

    August 21, 20264 min
    From Reserved to Committed: How Shopify’s New Inventory Shift Impacts Draft Orders, Transfers & Shipments
    Platform Updates

    From Reserved to Committed: How Shopify’s New Inventory Shift Impacts Draft Orders, Transfers & Shipments

    Shopify is moving inventory holds for draft orders, transfers and shipments from the reserved bucket to committed. Learn what this means for developers and merchants, how it affects reports, and the exact steps you need to take to keep your apps and stores running smoothly.

    August 21, 20264 min
    Staying Ahead with Shopify: Recent Updates and Actionable Advice
    Platform Updates

    Staying Ahead with Shopify: Recent Updates and Actionable Advice

    Discover the latest Shopify updates, from personalized checkout field settings to new shipping options and marketing tools, and learn how to make the most of these changes for your business. Get expert advice on navigating recent platform updates and enhancing your store's performance. Stay competitive with the latest Shopify features and best practices.

    August 17, 20263 min