The "sales" is an invalid dataset? ShopifyQL query stopped working

Topic summary

A ShopifyQL query referencing the sales dataset and UTM fields (e.g., utm_campaign_source, utm_campaign_medium) stopped working. The orders and product datasets don’t expose these UTM fields, causing the query to fail.

Latest update: The sales table is no longer available. Official docs list current datasets, and sales is not among them.

Workaround provided: Use the Admin GraphQL API to query orders and retrieve UTM parameters via customerJourneySummary → lastVisit → utmParameters (campaign, content, medium, source, term).

Context: UTM parameters are marketing tracking tags attached to visits; ShopifyQL datasets don’t currently include them, but GraphQL can surface them per order.

Status: Partial resolution. You can get UTM data via GraphQL orders, but replicating ShopifyQL aggregates (e.g., total_sales grouped by hour with UTM breakdowns) wasn’t addressed and remains open.

Summarized with AI on February 1. AI used: gpt-5.

Hi

My query is

FROM sales SHOW orders, total_sales GROUP BY hour, utm_campaign_source, utm_campaign_medium, order_id....

there are some utm* params in the query

but the orders and product tables do not provide these fields.

I’d like to know that how do i do

Thanks

Hi @fmiotech :waving_hand:

You can find a list of datasets available in the docs here. At this time, the sales table is no longer available, but one workaround would be to query orders directly to get the UTM parameters:

{
    orders (first:10) {
        nodes {
            id
            customerJourneySummary {
                lastVisit {
                    utmParameters {
                        campaign
                        content
                        medium
                        source
                        term
                    }
                }
            }  
        }
    }
}

Hope that helps!

3 Likes