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

Solved
fmiotech
New Member
4 0 1

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

 

Accepted Solution (1)
ShopifyDevSup
Shopify Staff
Shopify Staff
1200 190 418

This is an accepted solution.

Hi @fmiotech 👋


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!

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Reply 1 (1)
ShopifyDevSup
Shopify Staff
Shopify Staff
1200 190 418

This is an accepted solution.

Hi @fmiotech 👋


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!

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog