A Shopify data warehouse is a copy of your store's orders, line items, refunds, discounts and customers in a cloud warehouse you own, modeled so net sales match Shopify's own reports and can be joined to ad spend. It is where a DTC brand's order data stops being a set of admin reports. Shopify's built-in analytics answer "how much did we sell?" well. They are much weaker at "which campaigns brought in customers who kept buying?", "what did we actually keep after refunds?" and "how does this compare with what Meta and Google claim?" Those questions need orders, refunds and customers in the same place as your ad data, modeled so the revenue still matches Shopify's own numbers.
This guide covers the Shopify objects that matter for ad decisions, how to pull them with the GraphQL Admin API, bulk operations and webhooks, how to build net sales that reconcile with Shopify's reports, and how to join it all to ad spend. It is written for DTC ops and analytics leads, and for agencies automating client reporting for Shopify brands.
Why Shopify reports alone are not enough for ad decisions
Shopify's analytics are built around the store, not around the ad account. Three gaps show up quickly:
- Ad platforms and Shopify disagree, and neither is wrong. Meta, Google and TikTok report conversions under their own attribution models. Shopify reports orders as they happen. Comparing them requires both datasets in one model, with a clear rule for which number is used where.
- Refunds land on a different day. Shopify's sales reports record a refund as its own event on the day it happens. A campaign that drove high-return orders looks fine in week one and only looks bad later, in a report nobody connects back to the campaign.
- Customer-level questions need history. First order vs repeat, 90-day revenue by acquisition month, and payback by channel all need the full customer and order history, which is awkward to get from admin reports.
The warehouse answers these. It also gives you ownership: the data sits in Snowflake, BigQuery, Redshift or Databricks under your account, not inside a reporting tool's subscription.
The objects that matter: orders, line items, refunds, discounts, customers
You do not need all of Shopify's schema. For ad reporting, five objects carry almost everything:
- Orders: IDs,
processedAt,cancelledAt, thetestflag, currency codes, totals such assubtotalPriceSet,totalDiscountsSet,totalShippingPriceSetandtotalTaxSet, the sales channel, andcustomerJourneySummary, which holds first and last visit details including UTM parameters and landing page where Shopify captured them. - Line items: product and variant, SKU, quantity, original and discounted totals, and whether the item is a gift card. Product-level ROAS and margin start here.
- Refunds: each refund has its own timestamp, refunded line items with amounts, and transactions. Refunds are the main reason warehouse revenue drifts from Shopify's.
- Discounts: discount codes and the allocation of discounts to line items. Codes are also a useful attribution signal for influencer and affiliate traffic.
- Customers: customer ID and order history, used to flag first orders and build cohorts. Keep personal fields (names, emails, addresses) out of reporting tables; you rarely need them for ad analysis.
Money fields in the GraphQL Admin API come as a MoneyBag with two values: shopMoney in the store's currency and presentmentMoney in the currency the customer paid in. Store both.
Pulling data into a Shopify data warehouse: GraphQL Admin API, bulk operations and webhooks
Shopify has marked the REST Admin API as legacy, so new pipelines should use the GraphQL Admin API. There are three ways to pull data with it, and a solid pipeline uses all three.
Bulk operations for backfills and daily catch-up
Bulk operations let you submit one GraphQL query and have Shopify run it asynchronously across the whole dataset, handling pagination and throttling for you. When it finishes, you download a JSONL file: one JSON object per line, with nested records (such as line items) on their own lines and linked to their parent through a __parentId field.
A trimmed example for orders updated since a given date:
mutation {
bulkOperationRunQuery(
query: """
{
orders(query: "updated_at:>='2026-10-01T00:00:00Z'") {
edges {
node {
id
name
processedAt
updatedAt
cancelledAt
test
currencyCode
presentmentCurrencyCode
subtotalPriceSet { shopMoney { amount } presentmentMoney { amount } }
totalDiscountsSet { shopMoney { amount } }
totalShippingPriceSet { shopMoney { amount } }
totalTaxSet { shopMoney { amount } }
customer { id }
customerJourneySummary {
firstVisit { landingPage utmParameters { source medium campaign } }
}
lineItems {
edges {
node {
id
sku
quantity
isGiftCard
originalTotalSet { shopMoney { amount } }
}
}
}
}
}
}
}
"""
) {
bulkOperation { id status }
userErrors { field message }
}
}
Limits to design around, per Shopify's documentation: a bulk query can contain at most five connections and two levels of nested connections; result URLs expire after a week; and an operation that runs longer than 10 days is stopped. From API version 2026-01, an app can run up to five bulk queries per shop at the same time (earlier versions allowed one). Because of the nesting limit, we pull refunds and discount allocations in their own bulk queries rather than cramming everything into one.
Use the bulk_operations/finish webhook to know when a job is done, with polling as a fallback, since Shopify notes webhook delivery is not guaranteed.
Webhooks for freshness
Order creation, update and cancellation webhooks, plus refunds/create, give you near-real-time changes. They are good for intraday dashboards and alerts. They are not a source of truth: deliveries can be missed or arrive out of order. Treat webhook data as a fast preview that the next bulk pull overwrites.
Regular queries for small lookups
Shop settings (including the shop's time zone), products and variants, and anything small can be fetched with normal paginated queries, which count against the GraphQL Admin API's cost-based rate limits. Check the current limits for your plan in Shopify's rate limit docs rather than hard-coding them.
Net sales that match Shopify's own reports
The fastest way to lose trust in a warehouse is a revenue number that does not match Shopify. Shopify's sales definitions are explicit:
- Gross sales: product revenue before discounts and returns, excluding taxes, shipping, duties and fees.
- Net sales: gross sales minus discounts minus sales reversals (returns, refunds, cancellations and edits).
- Total sales: net sales plus additional fees, duties, shipping charges and taxes.
Shopify's ShopifyQL documentation also explains how the sales data is shaped: each row records one event, and one order can produce several rows when refunds or adjustments follow. That is the model to copy. Build a sales ledger with one row per event, dated in the shop's time zone, and net sales will reconcile:
-- Example (Snowflake syntax): an event-level sales ledger dated like Shopify's reports.
with order_events as (
select
o.shop_id,
o.order_id,
date(convert_timezone(s.iana_timezone, o.processed_at)) as event_date,
'order' as event_type,
sum(case when not li.is_gift_card then li.original_total end) as gross_sales,
-sum(coalesce(da.allocated_amount, 0)) as discounts,
0 as reversals
from {{ ref('stg_shopify__orders') }} o
join {{ ref('stg_shopify__shops') }} s using (shop_id)
join {{ ref('stg_shopify__line_items') }} li using (shop_id, order_id)
left join (
-- pre-aggregate so a line item with several discounts is not counted twice
select line_item_id, sum(allocated_amount) as allocated_amount
from {{ ref('stg_shopify__discount_allocations') }}
group by 1
) da
on da.line_item_id = li.line_item_id
where not o.is_test
group by 1, 2, 3
),
refund_events as (
select
r.shop_id,
r.order_id,
date(convert_timezone(s.iana_timezone, r.created_at)) as event_date,
'refund' as event_type,
0 as gross_sales,
0 as discounts,
-sum(rli.subtotal) as reversals
from {{ ref('stg_shopify__refunds') }} r
join {{ ref('stg_shopify__shops') }} s using (shop_id)
join {{ ref('stg_shopify__refund_line_items') }} rli using (shop_id, refund_id)
group by 1, 2, 3
)
select *, gross_sales + discounts + reversals as net_sales
from order_events
union all
select *, gross_sales + discounts + reversals as net_sales
from refund_events
This is a starting point, not a full reconciliation. Shopify splits reversals into gross and discount components and handles edits, cancellations and exchanges in detail. Pick a few days, compare your ledger with Shopify's sales report for the same dates, and close the gaps one rule at a time: test orders, gift cards, time zone, canceled-but-unrefunded orders, and edits. Once a month of data matches to the cent, add a dbt test that compares daily totals and alerts on drift.
Joining Shopify to ad spend: UTMs, first orders and cohorts
With a clean ledger, the joins to ad data are straightforward.
UTMs and landing pages. customerJourneySummary gives first and last visit UTM parameters where Shopify recorded them. Coverage is never 100%: consent choices, app-created orders, subscriptions and draft orders often have no journey data. Report the share of revenue with a known source next to any channel split, so nobody reads a 60% coverage chart as the whole business.
First orders. Flag each customer's first order by ordering their orders by processedAt. New-customer revenue by acquisition source is usually a more useful input to budget decisions than total revenue, because repeat orders would mostly happen without the ad.
Cohorts. Group customers by first-order month and first-touch source, then track net revenue (after refunds) at 30, 60 and 90 days. This shows which channels bring customers who stay, and which bring discount hunters who refund.
Ad spend. Spend comes from each ad platform's own pipeline, at campaign and day level. Join on date and on a channel or campaign mapping built from UTMs and naming conventions. Blended metrics such as MER and blended ROAS live on top of this join; our Shopify sales data page covers how we report them, and the true ROAS post explains the numerator choices. If you are weighing an attribution tool instead, our comparison of Triple Whale and Northbeam shows where those tools fit next to a warehouse.
Multi-store and multi-currency setups
Two setups need extra care.
Several stores. Brands with regional or wholesale stores have one Shopify shop per store, each with its own IDs, currency and time zone. Add shop_id to every key from the first table onward, because order numbers repeat across shops. Run the same bulk queries per shop and union the results in staging.
Selling in several currencies from one store. With Shopify Markets, customers can pay in their local currency while the store reports in its own. Use shopMoney for anything that must match Shopify's reports, and keep presentmentMoney for customer-facing analysis such as price testing by market. If you convert to a group reporting currency, do it from shop currency with a dated FX table and keep the native values.
Model checklist
- Orders, line items, refunds, discount allocations and customers in staging, keyed by
shop_id. - Bulk operations for backfills and daily catch-up; webhooks only for intraday previews.
- Separate bulk queries for refunds and discounts to stay inside the nesting limits.
- An event-level sales ledger dated in the shop's time zone.
- Test orders and gift cards handled the way Shopify's reports handle them.
- A daily reconciliation test against Shopify's net sales.
- Journey coverage reported next to every channel split.
- First-order flags and monthly cohorts on net revenue after refunds.
- Personal fields excluded from reporting models.
We build this on a marketing data warehouse the client owns, often on Snowflake or BigQuery. If you want a second pair of eyes on your store and ad accounts, book a free 30-minute ad data review or request an ad data plan.
Frequently asked questions
How do I export Shopify data to BigQuery or Snowflake?
Use GraphQL Admin API bulk operations for the backfill and a daily catch-up of orders updated since the last run, download the JSONL results, and load them into staging tables keyed by shop ID. A managed connector can do the extraction, but you still need the modeling layer that reconciles revenue with Shopify.
Why doesn't my warehouse revenue match Shopify analytics?
The usual causes are refunds dated on the original order instead of the refund date, a UTC date instead of the shop's time zone, test orders or gift cards counted as sales, and taxes or shipping included in a net sales figure. Model sales as one row per event, as Shopify does, and reconcile a few days at a time.
Should I use webhooks or bulk exports for Shopify orders?
Both, for different jobs. Bulk operations are the source of truth for backfills and daily loads. Webhooks are useful for intraday freshness and alerts, but Shopify does not guarantee delivery, so the next bulk pull should overwrite anything that arrived by webhook.
Where is Shopify data stored?
Shopify hosts your store's data on its own platform, and its privacy and data processing documentation describes how that data is handled. A warehouse copy is separate: it lives in your own Snowflake, BigQuery, Redshift or Databricks account, in the cloud region you choose when you set that account up, under your access controls and retention rules. That copy is what lets you keep full order history and join it to ad data.