Guide · Analytics and metrics
Shopify data in a warehouse: ETL, BigQuery and ClickHouse
How to get Shopify data into a warehouse: ETL explained, loading into BigQuery or ClickHouse, the pitfalls of the Shopify API, tool types and when it pays.
- ETL (extract, transform, load) copies data from Shopify, ad platforms and other tools into one warehouse where you can query it together with SQL.
- A warehouse pays when questions cross sources (profit per campaign, LTV by first product, several stores) and spreadsheets stop scaling.
- Shopify data is harder to load than it looks: API rate limits, nested orders, edits and refunds after the fact, the 60-day order limit without extra access, currencies and time zones.
- BigQuery is the usual first choice (serverless, SQL, native GA4 export); ClickHouse suits large event volumes but needs care with updates.
- Options range from CSV exports and managed connectors to custom pipelines and analytics tools that export modelled tables.
As a Shopify store grows, its questions outgrow the reports of any single tool. Which campaigns bring customers who come back? What is the profit per channel after shipping and fees? How do three stores in three currencies compare? Answering those needs the data in one place, and that place is usually a data warehouse. This guide explains ETL for Shopify, when a warehouse makes sense, how to load data into BigQuery and ClickHouse, the types of tools that do it, and the pitfalls.
Understanding ETL for Shopify stores
ETL stands for extract, transform, load. Most modern setups are really ELT: they load raw data into the warehouse and transform it there with SQL (often with a tool such as dbt), because warehouse compute is cheap and raw data can be re-modelled later. The distinction matters less than the result: tables you can trust and query.
A data warehouse is a database built for analysis: it stores large tables in columns, scans them fast and is queried with SQL. BigQuery, Snowflake, Redshift and ClickHouse are the common ones; a data lake of Parquet files in S3, Google Cloud Storage or Azure Blob is a cheaper variant that most warehouses can read.
Common use cases for ETL in Shopify
- Blended marketing reports: spend from every ad platform next to Shopify orders, with one definition of revenue.
- Profit reporting: product costs, shipping, fees and refunds joined per order, then rolled up per product, channel and month.
- Customer analytics: cohorts, lifetime value, repeat rate by first product or acquisition channel over years of history.
- Several stores and markets: one table across stores, currencies converted, time zones aligned.
- BI dashboards: Looker Studio, Looker, Power BI, Tableau or Metabase on top of clean tables.
- Data science: demand forecasts, churn models, marketing mix models.
Step by step: ETL for a Shopify store
- Write down the questions
Five questions the warehouse must answer. They decide which sources and tables you need; "everything" is not a plan.
- List the sources
Shopify (orders, line items, refunds, products, customers), ad platforms (spend per campaign and day), GA4 (sessions), email, and your cost data.
- Choose how to extract
Shopify's Admin GraphQL API (with bulk operations for large exports), webhooks for changes as they happen, or a connector that does both.
- Choose the destination
BigQuery, Snowflake, Redshift or ClickHouse, or files in cloud storage. Pick the one your team or agency already knows.
- Model the data
One row per order, per order line, per refund and per ad campaign per day. Decide the store currency, time zone and revenue definition once.
- Load incrementally
After the first backfill, load only what changed (by updated time), and replace whole days so edits and refunds overwrite old values.
- Check quality
Compare order counts and net sales per day with Shopify's reports; alert when a load fails or a day is missing.
- Build the reports
Dashboards and saved queries on top of the modelled tables, not on raw API output.
Shopify ETL vs manual reporting
| Manual reporting (exports and spreadsheets) | ETL into a warehouse | |
|---|---|---|
| Effort per report | Hours each time | Setup once, then minutes |
| History | What fits in a spreadsheet | Years of orders and events |
| Joining sources | Lookups by hand, error-prone | SQL joins on ids |
| Freshness | As old as the last export | Hourly or daily |
| Consistency | Each person's own formulas | One model, one definition |
| Cost | Staff time | Tool and warehouse fees, plus setup |
| Suits | A small store with a few questions | Growing stores, several stores, analysts on the team |
Swipe the table sideways to see every column.
When does a warehouse make sense?
Signs that a store has outgrown its tools' reports:
- You export from three or more tools every week and combine them in a spreadsheet.
- Questions need more history than your tools keep, such as LTV over two years.
- You run several stores or markets and want one view.
- An analyst or agency wants SQL access to the data.
- You want to build your own models (forecasting, MMM) or feed a BI tool.
If none apply, a good analytics tool with exports is usually enough, and cheaper.
Why use BigQuery with Shopify?
- Serverless: no servers to run; you pay for storage and the data each query scans (or a flat-rate reservation).
- SQL: standard SQL, so any analyst can query it.
- GA4 export: GA4 exports raw events to BigQuery natively, including on free standard properties (with a daily event limit), so Shopify orders and GA4 events can sit side by side.
- Google tools: Looker Studio, Sheets (connected sheets) and Vertex AI read BigQuery directly.
- Partitioning: tables partitioned by day keep queries on recent data cheap.
Why connecting Shopify to BigQuery is not simple
| Problem | Why it happens | How to handle it |
|---|---|---|
| Rate limits | The Admin GraphQL API limits query cost per second | Use bulk operations for history, incremental queries after |
| Only 60 days of orders | Apps see the last 60 days unless granted the read_all_orders scope | Request read_all_orders for the backfill |
| Nested data | An order holds line items, discounts, shipping lines, refunds and transactions | Flatten into separate tables joined by order id |
| Changes after the fact | Orders are edited, refunded, cancelled and fulfilled days later | Reload by updated time and replace whole days |
| Currencies | Shop currency, presentment currency and ad account currencies differ | Store both, convert with daily rates |
| Time zones | API times are UTC; Shopify reports use the store time zone | Add a store-local day column and report on it |
| Personal data | Orders contain names, emails and addresses | Hash or drop them unless there is a clear need and legal basis |
| No costs in Shopify | Shipping invoices, fees and ad spend live elsewhere | Load them as their own sources and join |
Swipe the table sideways to see every column.
How to load Shopify data into BigQuery: the options
- CSV exports
Export orders and products from Shopify admin and upload to BigQuery. Free and fine for a one-off analysis; not repeatable.
- Spreadsheet in between
A Google Sheet filled by an app or script, queried as an external table. Simple, but slow and limited in size.
- Managed ELT connectors
Services that read the Shopify API and load raw tables on a schedule. Little work, priced by rows or volume; you still model the raw tables yourself.
- Custom pipeline
Your own code calling the Admin API (bulk operations plus webhooks) and BigQuery load jobs. Full control; you maintain it when Shopify changes the API.
- Analytics tool with a warehouse export
A tool that already joins orders, costs, spend and attribution exports modelled tables. Less raw detail, but the hard modelling is done.
Why connecting Shopify to ClickHouse is not straightforward
- Few direct connectors
Fewer ready-made Shopify integrations load into ClickHouse than into BigQuery or Snowflake.
- Updates are expensive
ClickHouse is built for appending. Orders change after they are placed, so you need a table engine that keeps the latest version (ReplacingMergeTree with a version column) and queries that account for it.
- Nested JSON
Shopify orders are deeply nested; they need flattening into line, refund and transaction tables before they are fast to query.
- Operations
Self-hosted ClickHouse needs someone to run it; ClickHouse Cloud removes that but adds a bill.
Options for loading Shopify data into ClickHouse
- Through files: write Parquet or JSON files per day to S3 or Google Cloud Storage and read them with ClickHouse's
s3table function, or ingest them continuously (S3Queue, or ClickPipes on ClickHouse Cloud). - Through an ELT connector that supports ClickHouse as a destination.
- Through a stream: Shopify webhooks into a queue (Kafka, for example) and from there into ClickHouse.
- Custom code: read the Admin API and insert in batches.
-- Read one day of exported orders (Parquet) from S3 into ClickHouse
INSERT INTO orders
SELECT *
FROM s3('https://my-bucket.s3.eu-west-1.amazonaws.com/shop/orders/2026-11-24.parquet',
'AWS_KEY_ID', 'AWS_SECRET', 'Parquet');Types of Shopify ETL tools
| Type | Examples | Strengths | Trade-offs |
|---|---|---|---|
| Managed ELT | Fivetran, Airbyte Cloud, Stitch, Hevo | Many sources, little maintenance | Raw tables to model; volume-based pricing |
| Open-source ELT | Airbyte (self-hosted), Meltano | No licence fee, full control | You run and update it |
| Spreadsheet connectors | Add-ons that pull Shopify into Sheets | Quick for small stores | Row limits, slow, fragile |
| Analytics tools with exports | Profit and attribution tools that export to a warehouse | Costs and attribution already joined | Their model, their tables |
| Custom pipeline | Your own code on the Admin API | Exactly what you need | Engineering time, API changes |
Swipe the table sideways to see every column.
How ETL tools work with Shopify data
- Access: the tool installs as a Shopify app with read scopes (orders, products, customers;
read_all_ordersfor history). - Backfill: a first run reads history, usually through bulk operations that export large result sets as files.
- Incremental sync: later runs ask for records updated since the last run, or listen to webhooks.
- Schema mapping: nested objects become child tables; new fields add columns.
- Scheduling and retries: hourly or daily runs, with retries when the API throttles.
-- Net revenue, contribution margin and ad spend per day (BigQuery, example tables)
SELECT o.order_day,
SUM(o.revenue) AS revenue,
SUM(o.contribution_margin) AS contribution_before_ads,
ANY_VALUE(s.spend) AS ad_spend
FROM shop.orders o
LEFT JOIN (SELECT day, SUM(spend) AS spend FROM shop.ad_spend GROUP BY day) s
ON s.day = o.order_day
GROUP BY o.order_day
ORDER BY o.order_day DESC;Shopify data in a warehouse with ROASaurus
ROASaurus already joins your orders, product costs, shipping, fees, ad spend and attribution. Instead of rebuilding that model, you can export its tables to your own warehouse, query them in the app, or pull them into Sheets and Looker Studio.
Connections › Warehouse- Open Connections › Warehouse and add an export to BigQuery, Snowflake, Redshift, S3, Google Cloud Storage or Azure Blob (files as Parquet, gzip JSON lines or CSV, one file per day).
- Pick the tables: orders (with profit and attribution), order items (with product cost), ad spend per platform, campaign and day, touches (journeys), customers (with LTV and predicted LTV) and the daily P&L.
- Choose daily or hourly and how many days of history the first run loads. Each run replaces the store-local days that changed, so a run can repeat safely; customers are a full snapshot.
- Personal data is not exported: customers are identified by platform id or email hash. Tables are created for you and new columns are added when ROASaurus adds fields.
- For quick questions without a warehouse, use Reports › SQL: read-only SQL on this store's views (orders, order items, refunds, customers, ad spend, touches, events, products and more), with charts, saved queries and CSV download.
- Use Connections › Google Sheets & Looker Studio to sync data into a spreadsheet or connect Looker Studio.
ROASaurus has no ClickHouse destination; ClickHouse can read the daily Parquet files from S3 or Google Cloud Storage with its s3 table function.
Start freeOpen the live demo14-day trial of every feature, no credit card.
Sources
- Shopify Dev: Perform bulk operations with the GraphQL Admin API
- Shopify Dev: API rate limits
- Shopify Dev: Access scopes
- Google Analytics Help: BigQuery Export
- Google Cloud: Introduction to loading data into BigQuery
- ClickHouse Docs: s3 table function
- ClickHouse Docs: ReplacingMergeTree