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

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