ShopifyQL query examples give South African store owners a direct line into their commerce data — no spreadsheet exports, no waiting for a developer, just a structured question that returns a chart or table straight inside Shopify Admin. ShopifyQL is Shopify's own commerce analytics query language, built into every Shopify plan and modelled on SQL so that anyone comfortable with basic reporting can learn it in an afternoon.

South Africa's online retail market is forecast at R159 billion for 2026 (World Wide Worx, Sep 2026) — which means the difference between a store that can read its own data and one that cannot is increasingly a competitive gap. The queries below are organised by the business question you are actually trying to answer, with SA-specific filters baked in.

Quick Answer

ShopifyQL query examples follow a two-clause minimum: FROM <schema> picks the dataset and SHOW <metric> picks what you want to see. Add WHERE billing_country = 'South Africa' to isolate local data, WITH TIMEZONE 'Africa/Johannesburg' to align daily timestamps, and TIMESERIES month to turn any total into a trend. The ShopifyQL editor is available on all Shopify plans; the Notebooks app (for saving full analytical workbooks) is Shopify Plus only.

Not sure which queries your store actually needs?

Send us your current reporting setup and we'll map it to the ShopifyQL queries that answer the questions your business is actually asking.

Get a Free Analytics Review

What Is ShopifyQL and How Do You Access It?

ShopifyQL is a commerce analytics query language built by Shopify that lets merchants interrogate their own store data using a structured, SQL-like syntax. Understanding ShopifyQL query syntax means you can ask any business question your data can answer — no data export, no third-party BI tool, no developer required.

The language works identically across four surfaces:

  • ShopifyQL editor in Admin — accessible from any report view; available on all plans
  • GraphQL Admin API — for developers embedding queries in apps or automations
  • Python SDK / CLI — for scripted analysis and Jupyter-style notebooks
  • Web components — for embedding metric cards in Shopify apps
FeatureBasic–AdvancedPlus / Enterprise
ShopifyQL editor in reports✓✓
Save custom data explorations✓✓
ShopifyQL Notebooks (full analytics workbooks)✗✓
Multi-store organisation queries✗✓
GraphQL Admin API integration✓✓

Note on ShopifyQL Notebooks: As of early 2026, Shopify has been integrating the Notebooks experience directly into the report view for Plus merchants — verify current status in Shopify Admin, as the rollout has been progressive. The core querying capability — writing and running ShopifyQL — is available on all plans through the built-in editor.

Every ShopifyQL query needs at minimum FROM (which dataset to query) and SHOW (which metric to return). All other clauses are optional and must appear in this order if used. The full clause reference, including all WHERE operators and time functions, is in Shopify's official ShopifyQL syntax guide.

FROM → SHOW → WHERE → GROUP BY → TIMESERIES → WITH → HAVING → SINCE/UNTIL → COMPARE TO → ORDER BY → LIMIT → VISUALIZE

ShopifyQL Query Examples by Business Question

The most useful ShopifyQL query examples start with a question you would actually ask in a Monday morning meeting, not with a clause you found in documentation. These Shopify analytics query examples are organised by the business decision they support — each one names the question first, then provides the query, then notes what the result reveals.

Syntax Quick Reference

Values in WHERE always use single quotes: 'South Africa' not "South Africa". Relative dates use a number + unit: -30d, -3m, -1y. Named dates include today, last_month, last_week. The TIMESERIES clause backfills empty periods (good for trend lines); GROUP BY returns only periods that have data (good for rankings).

Sales and Revenue Queries

Sales schema queries answer the most immediate question every store owner has: how much did we sell, through which channel, and how does it compare to last period.

Monthly sales trend — last 12 months

Question: Is revenue growing month-on-month or are there dips I'm not seeing in the summary?

FROM sales
  SHOW net_sales, orders_count
  TIMESERIES month
  SINCE -12m UNTIL today
  VISUALIZE net_sales TYPE line

Sales by channel — ranked

Question: Which channel — online store, POS, draft orders — is driving the most revenue?

FROM sales
  SHOW net_sales, orders_count
  GROUP BY sales_channel
  SINCE -90d UNTIL today
  ORDER BY net_sales DESC

Period-over-period comparison

Question: Is this quarter better or worse than the same quarter last year?

FROM sales
  SHOW net_sales, orders_count
  TIMESERIES month
  SINCE startOfYear(0y) UNTIL today
  COMPARE TO previous_year
  WITH PERCENT_CHANGE

The WITH PERCENT_CHANGE modifier adds a percentage-change column automatically — no manual calculation needed.

Top 10 products by revenue

Question: Which SKUs should I restock first and promote hardest?

FROM sales
  SHOW net_sales, orders_count
  GROUP BY product_title
  SINCE -30d UNTIL today
  ORDER BY net_sales DESC
  LIMIT 10

Discount impact on revenue

Question: How much did promotions cost me, and are they pulling through enough volume?

FROM sales
  SHOW net_sales, discounts, orders_count
  GROUP BY discount_code
  SINCE -90d UNTIL today
  ORDER BY discounts DESC

Want someone to build your monthly reporting stack?

Tell us what decisions you need to make each month — we'll map the right ShopifyQL queries and set up a reporting rhythm that takes 20 minutes, not half a day.

Book a Reporting Consultation

Customer Behaviour Queries

Customer schema queries identify who is buying, how often, and how much they are worth over time — the inputs you need before building any retention or loyalty programme.

New vs returning customers

Question: Am I growing a loyal base or constantly acquiring new buyers at full cost?

FROM customers
  SHOW customer_count
  GROUP BY customer_type
  TIMESERIES month
  SINCE -12m UNTIL today

Top 50 customers by lifetime spend

Question: Who are my most valuable customers — the ones I absolutely cannot afford to lose?

FROM customers
  SHOW lifetime_spend, orders_count
  ORDER BY lifetime_spend DESC
  LIMIT 50

Export this list monthly and flag any top-50 customer who hasn't ordered in 60+ days for a personal re-engagement message or a Yoco / PayFast loyalty token.

Average order value by cohort

Question: Are customers who joined during a promotion spending as much as organic acquires?

FROM customers
  SHOW lifetime_spend, orders_count
  GROUP BY customer_cohort_month
  TIMESERIES month
  SINCE -12m UNTIL today

Retention Rule of Thumb

A query showing new customers growing faster than returning customers is not a problem until the gap widens for three consecutive months. One period is noise; a sustained shift signals a retention issue worth investigating with a cart recovery or post-purchase email sequence.

Inventory and Product Queries

Inventory schema queries surface stockout risk and slow-movers before they damage either your cash flow or your fulfilment commitments to SA couriers like The Courier Guy or Aramex. ShopifyQL reports examples in this section cover stock levels, sell-through rate, and multi-location stock views.

Low-stock alert — items below threshold

Question: Which products will run out before my next supplier delivery arrives?

FROM inventory
  SHOW stock_quantity, units_sold
  WHERE stock_quantity < 10
  ORDER BY units_sold DESC

Sort by units_sold descending so the fastest-moving items appear first — a product with 5 units remaining and 200 monthly sales is a genuine emergency; one with 5 units and 3 monthly sales can wait.

Sell-through rate by product

Question: Which items are tying up working capital without moving?

FROM inventory
  SHOW sell_through_rate, stock_quantity, units_sold
  ORDER BY sell_through_rate ASC
  LIMIT 20

Stock by location

Question: Which warehouse or store location is overstocked and which is running low?

FROM inventory_by_location
  SHOW stock_quantity, inventory_value
  GROUP BY location_name
  ORDER BY stock_quantity ASC

Filtering for South African Store Data

Filtering ShopifyQL results to South Africa removes international orders, tourist purchases and currency noise — essential for stores that sell across multiple geographies or currencies.

SA-only sales with ZAR currency and Joburg timezone

FROM sales
  SHOW net_sales, orders_count
  WHERE billing_country = 'South Africa'
  TIMESERIES month
  WITH TIMEZONE 'Africa/Johannesburg'
  WITH CURRENCY 'ZAR'
  SINCE -12m UNTIL today

WITH TIMEZONE 'Africa/Johannesburg' aligns daily cut-offs to South Africa Standard Time (UTC+2, no daylight saving). Without it, a sale at 23:00 SAST appears in the next day's data if your store defaults to UTC. Note: WITH CURRENCY 'ZAR' only converts currency presentation if your store has multi-currency enabled. Single-currency ZAR stores can omit this modifier — your data is already in ZAR.

Revenue by SA province

Question: Should I prioritise Gauteng or Western Cape for the next paid campaign?

FROM sales
  SHOW net_sales, orders_count
  WHERE billing_country = 'South Africa'
  GROUP BY billing_region
  SINCE -90d UNTIL today
  ORDER BY net_sales DESC

VAT collected from SA customers

Question: What VAT did I collect from local buyers this quarter — to crosscheck against my SARS submission?

FROM sales_taxes
  SHOW tax_amount
  WHERE billing_country = 'South Africa'
  TIMESERIES month
  SINCE startOfYear(0y) UNTIL today

SA VAT note: These queries show VAT collected through Shopify's tax system — always reconcile against your accountant's records before filing with SARS. Shopify does not file on your behalf. South Africa's VAT rules on registration thresholds changed in April 2026; confirm current figures with your accountant before relying on them for compliance purposes.

Black Friday vs prior year — SA orders

Question: How did this year's Black Friday period compare to last year for SA buyers?

FROM sales
  SHOW total_sales, orders_count
  WHERE billing_country = 'South Africa'
  SINCE 2025-11-28 UNTIL 2025-12-01
  COMPARE TO previous_year

Adjust the SINCE/UNTIL dates each year. Using COMPARE TO previous_year generates a matching prior-year window automatically — no manual date calculation.

Sessions and Marketing Queries

Sessions and marketing schemas reveal how people are finding your store and what happens after they arrive — the inputs you need before spending on paid acquisition through Meta Ads or Google Shopping. ShopifyQL notebook examples built on these schemas are particularly useful for pre-campaign baseline reports and post-event attribution reviews.

Traffic source breakdown

Question: Which channel is sending the most shoppers, and which has the best add-to-cart rate?

FROM sessions
  SHOW sessions_count, add_to_carts, reached_checkout
  GROUP BY utm_source
  SINCE -30d UNTIL today
  ORDER BY sessions_count DESC

Peak shopping days of the week

Question: When are South African shoppers most active — to time email sends and paid campaigns?

FROM sessions
  SHOW sessions_count, orders_placed
  GROUP BY day_of_week
  SINCE -90d UNTIL today
  ORDER BY sessions_count DESC

Marketing channel attributed sales

Question: Which channel gets credit for the most revenue under last-click attribution?

FROM sales
  SHOW net_sales, orders_count
  GROUP BY referring_channel
  WITH LAST_CLICK_ATTRIBUTION
  SINCE -90d UNTIL today
  ORDER BY net_sales DESC

WITH LAST_CLICK_ATTRIBUTION is an explicit modifier that credits the full sale to the last recorded touchpoint before purchase. It matches Shopify's default behaviour when no attribution model is specified and attribution tracking is active — but FIRST_CLICK_ATTRIBUTION and LINEAR_ATTRIBUTION are also available and worth testing for channels with longer consideration periods.

ShopifyQL limitations to know upfront: The language does not support JOINs or subqueries — you cannot combine the sales and sessions schemas in one query. Session data is only available from October 2022 onward. Practitioners report that query performance can degrade on date ranges beyond roughly six months; add LIMIT 100 when testing any extended-window query, then remove it for the final run.

Why South African Businesses Choose Growth Pulse Media

Growth Pulse Media is run by Dirk van Greuning, who built and scaled a large South African ecommerce business before founding the agency. The analytics frameworks that inform our Shopify marketing service come from that operator background — not from a textbook. We know what it costs when a store owner is making margin calls based on a summary dashboard that can't tell Gauteng from the Eastern Cape, or that counts a refund as a sale.

We are a registered Shopify Partner. All work is executed in-house — no outsourcing to freelance sub-contractors — and we deliberately limit the number of active clients so that senior attention goes to every account. When we build a ShopifyQL reporting stack for a store, it reflects the questions that actually drive buying decisions: which products to restock, which channels to scale, which customer cohorts need a retention push.

SA-specific integrations we regularly configure alongside analytics: PayFast, Peach Payments, Ozow, Yoco, The Courier Guy, Aramex, Dawn Wing, Klaviyo and Omnisend. Each of these appears in your Shopify data as a payment method, fulfilment channel or marketing source — and each one can be filtered or grouped in ShopifyQL queries.

Who This Is NOT For

Stores that need real-time operational dashboards. ShopifyQL queries run on demand inside Admin or via API — they are not a live streaming data product. If you need a dashboard that refreshes every 30 seconds during a sale event, you need a BI tool connected to your data warehouse, not ShopifyQL alone.

Owners who need true profit-per-unit calculations. The profitability schema covers revenue, shipping costs, taxes and fulfilment fees, but it does not have access to your cost of goods sold (COGS) unless you have entered unit costs in Shopify. Without unit costs entered, the schema cannot compute net margin per SKU.

Teams that want cross-schema joins. ShopifyQL does not support JOINs. If your analysis requires correlating sessions data with customer lifetime value in a single query — for example, identifying high-LTV customers who arrived via organic search — you need to export both queries separately and combine them in a spreadsheet or BI tool.

Merchants on Shopify Basic who want the full Notebooks experience. The built-in ShopifyQL editor is available on all plans, but the Notebooks environment — with saved analytical workbooks, AI-assisted query generation via Sidekick, and organisation-level multi-store views — requires Shopify Plus (from $2,300/month on a 3-year term).

Ready to turn your Shopify data into a decision-making tool?

Share your current analytics setup and we'll audit which queries are missing and what reporting cadence makes sense for your store's growth stage.

Request a Free Shopify Analytics Audit

Frequently Asked Questions

What is the difference between ShopifyQL and ShopifyQL Notebooks?

ShopifyQL is the query language itself — available to all Shopify plans via the editor built into any report view. ShopifyQL Notebooks is a more advanced environment that, as of early 2026, Shopify has been integrating into the report view for Plus merchants — verify current status in Shopify Admin. It allows you to save full analytical workbooks, use Sidekick AI to generate queries, and run multi-store organisation queries. Notebooks features are exclusive to Shopify Plus.

Can I filter ShopifyQL queries to show only South African orders?

Yes. Add WHERE billing_country = 'South Africa' to any sales or customer query to isolate local orders. Combine it with WITH TIMEZONE 'Africa/Johannesburg' to align daily timestamps to SAST (UTC+2), and WITH CURRENCY 'ZAR' if your store trades in multiple currencies.

What schemas (datasets) are available in ShopifyQL?

ShopifyQL provides schemas covering sales, customers, sessions, inventory, inventory_by_location, profitability, returns, sales_taxes, discounts, payments, payment_attempts, marketing_engagements, campaign_sales, fulfilments, and more. Each schema exposes a specific set of dimensions and metrics — the FROM clause selects which schema you are querying.

Does ShopifyQL work with the Shopify GraphQL Admin API?

Yes. The same ShopifyQL query you write in the admin editor can be passed to the shopifyqlQuery field in the GraphQL Admin API, making it possible to embed analytics results directly in a Shopify app, a custom dashboard, or an automated reporting script. The query syntax is identical regardless of which surface you use.

What are the main limitations of ShopifyQL for store analysis?

ShopifyQL does not support JOINs or subqueries — you cannot combine two schemas in a single query. Session data is only available from October 2022 onward, and COGS is not accessible without manually entered unit costs in Shopify. Date ranges beyond roughly six months can slow queries (practitioners report this as a working threshold); add LIMIT 100 when testing, then remove it for full results.

Get More From Your Shopify Analytics

Growth Pulse Media is a registered Shopify Partner based in Johannesburg. We build analytics frameworks for South African stores — from ShopifyQL query libraries to full monthly reporting dashboards tied to your actual business decisions. All work is in-house, limited client load means senior attention on every account, and we integrate with the SA payment and fulfilment stack your store already uses.

No obligation — we'll get back to you within 24 hours.

Get a Free Shopify Analytics Review
Dirk van Greuning — Founder, Growth Pulse Media
Dirk van Greuning Founder, Growth Pulse Media

Founder of Growth Pulse Media and a specialist in South African search dominance. Dirk translates his experience in scaling South African businesses into high-velocity digital strategies for B2B and retail leaders. He writes about SEO, lead generation, and paid media from an operator's perspective — prioritising pipeline value over impressions.

Connect on LinkedIn