Shop product impressions Return empty data

I want to know the most popular products in the store.

I tried to use the shopifyqlQuery with the SQL below to get it.

FROM shop_product_impressions
       SHOW shop_product_impressions
       GROUP BY ONLY TOP 30 product_id WITH CURRENCY 'USD'
       SINCE startOfDay(-7d) UNTIL today
ORDER BY shop_product_impressions DESC
VISUALIZE shop_product_impressions

But I found that for some stores which have a lot of orders the value of shop_product_impressions is empty. I don’t know why it happens?

Hey @Jolect_Jolect! The shop_product_impressions table specifically tracks product views within the Shop app channel, not general storefront traffic. So a store can have thousands of orders through its online store but still return empty impression data if customers aren’t browsing products through the Shop app itself.

The Shop sales channel analytics docs note that “if you don’t have enough customers using Shop, then certain performance metrics won’t be available,” which lines up with what you’re seeing on those high-order stores.

If you’re looking for popular products more broadly, you’d be better off querying the sales table instead:

FROM sales
  SHOW net_items_sold
  GROUP BY product_title
  SINCE startOfDay(-7d)
  UNTIL today
  ORDER BY net_items_sold DESC
  LIMIT 30

That’ll give you best sellers based on actual sales across all channels, which is likely closer to what you’re after.

If you do specifically need Shop channel impressions and are seeing unexpected results on stores where you know buyers are active in the Shop app, share the full response body and the x-request-id from the response headers and I can take a closer look.

Thanks for you kindly response.

Does the Shop app channel refer to https://shop.app/?

I want to look at impressions rather than sales, because I need to exclude items like free gifts — they have high sales but very low impressions.

But if it’s not supported yet, I’ll use your approach for the time being.

Yes, the Shop channel refers to the Shop app specifically, so impressions are only tracked for products viewed by buyers browsing through that app.

That makes sense on the free gifts angle. You can get what you need from the sales table by filtering out zero-revenue products with HAVING. Note that WHERE in ShopifyQL only supports dimensions, not metrics, so you need HAVING for this, and the filtered metric has to be in the SHOW clause:

FROM sales
  SHOW net_items_sold, net_sales
  GROUP BY product_title
  HAVING net_sales > 0
  SINCE startOfDay(-7d)
  UNTIL today
  ORDER BY net_items_sold DESC
  LIMIT 30

That’ll rank products by units sold while dropping any free gift line items. There’s no general storefront product impressions table available via the API, so this is the closest equivalent for now.

1 Like