Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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

Solved

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

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
1453 239 534

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
1453 239 534

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