How to track gross margin by channel and sku with AI

Finance & FP&A3 AI tools7 steps6 friction points

Gross margin by channel and SKU is one of the most operationally important numbers a product business can track — and one of the least visible. Blended margins hide what's actually making money. A SKU that looks healthy in aggregate might be underwater on Amazon while printing margin on your DTC site. Getting this number right means pulling revenue by channel, subtracting COGS per SKU, and doing it consistently across whatever combination of Shopify, Stripe, QuickBooks, and spreadsheets you're running.

The reason operators reach for AI here is obvious: this is data-wrangling work, not judgment work. Joining revenue records to cost data, normalizing SKU names across systems, building margin summaries by channel — all of that is pattern-matching on structured data that an LLM can assist with. The analytical layer (what does this mean, where's the leak) also feels like a natural fit for a tool that can read a table and explain it in plain English.

ChatGPT, Claude, and Gemini can genuinely help with this workflow today. They're good at writing formulas, cleaning inconsistent SKU names, restructuring exported CSVs, and narrating what a margin table shows. The limits are about data access and persistence, not analytical capability. You can get real analytical value out of a raw LLM here — but the workflow requires manual data prep on your end before every single run.

Finance & FP&A3 AI tools7 steps6 friction points
AI walkthrough

How to do it with AI today

A practical walkthrough using ChatGPT, Claude, and other off-the-shelf LLMs — what they're good at, what you'll have to do by hand.

Tools that work for this
ChatGPTClaudeGemini
Step-by-step
1 Export your revenue data by channel: pull a transaction-level export from Shopify or Stripe (or both), with columns for order date, channel, SKU or product ID, quantity, and gross revenue. Save as CSV.
2 Export your COGS data from QuickBooks or your inventory system — ideally a per-SKU cost table with SKU, unit cost, and the date range it applies to. If your COGS live in a spreadsheet, export that too.
3 Open ChatGPT (GPT-4o) or Claude and paste both CSVs directly into the chat. Ask the model to join them on SKU, calculate gross margin per SKU per channel, and return a summary table sorted by margin percentage descending.
4 Use a follow-up prompt to catch SKU naming mismatches — product IDs often differ between your storefront and your accounting system. Ask the model to flag rows it couldn't join and suggest likely matches based on name similarity.
5 Ask the model to group the joined data by channel (e.g., Amazon, DTC, Wholesale) and summarize total revenue, total COGS, gross profit, and gross margin percentage for each. Request the output as a markdown table you can paste into Notion or Google Sheets.
6 Paste the summary table back into a follow-up prompt and ask for a plain-English interpretation: which channels have the healthiest margins, which SKUs are dragging a channel down, and where the biggest margin risk sits.
7 Save the full prompt sequence — inputs, joins, and output format — in a doc. Next month you'll repeat this from scratch with a fresh export, so capturing the prompt chain saves setup time.
Prompts you can copy
Here are two CSVs: one is Shopify orders with columns [date, channel, sku, quantity, revenue], the other is a COGS table with [sku, unit_cost]. Join them on SKU, calculate gross margin per SKU per channel, and return a table sorted by gross margin % descending.
Some SKU names in the revenue file don't match the COGS file exactly. Flag every row you couldn't join, list the unmatched SKUs, and suggest likely COGS matches based on name similarity.
Group the joined data by channel (Amazon, DTC, Wholesale) and show total revenue, COGS, gross profit, and gross margin % for each. Format as a markdown table.
Looking at this margin summary by channel and SKU, which three SKUs are most at risk of being margin-negative if COGS increase by 10%? Show your math.
Rewrite the SKU column in the revenue CSV to normalize naming — strip trailing whitespace, lowercase everything, and replace spaces with underscores — then re-run the join.
Reality check

Where this gets hard

The walkthrough above works — until your numbers change, the LLM hallucinates, or you have to re-paste everything next month.

No live connection to Stripe, Shopify, or QuickBooks — every run starts with you manually exporting CSVs from each system, which takes 20-30 minutes before any analysis begins.
Context window limits mean large catalogs get truncated: if you have 500+ SKUs and months of transaction history, you'll need to chunk the data, run multiple sessions, and manually stitch the results back together.
SKU name normalization has to be re-done every month — the model doesn't remember how it resolved mismatches last time, so you're debugging the same join problems on every new export.
Nothing persists between sessions. The margin table from last month lives in a chat window you'll never find again. There's no versioned output, no comparison to prior periods, and no alert when a margin drops.
Output format drifts run to run. The table structure you carefully prompted in February isn't guaranteed to match what you get in March, which makes period-over-period comparison painful.
Channel attribution only goes as deep as what's in your export. If your Shopify and Amazon data use different tagging conventions for the same SKU sold in different bundles, the model can help clean it — but you have to catch the discrepancy first.

Tired of the friction?

Starch runs the whole workflow on live data — no copy-paste, no hallucinated numbers, no re-prompting next month.

See the Starch version →
Starch alternative

The same workflow on Starch

Starch is an agentic operating system — it builds the persistent app that runs this workflow against your live data, so gross margin by channel and SKU is a dashboard you check, not a prompt chain you re-run each month.

Connect Stripe and Plaid once: Starch syncs your actual revenue and expense data on a schedule. The Runway Analysis starter app gives you a live financial baseline — fork it and extend it to add SKU-level margin tracking on top of your real numbers.
Connect QuickBooks from Starch's integration catalog and the agent queries your bill and invoice records live when your margin app runs — no monthly CSV export, no copy-paste into a chat window.
Connect Shopify from Starch's integration catalog and the agent pulls order-level channel and SKU data live, joins it to your COGS from QuickBooks, and surfaces gross margin by channel automatically — describe this in plain English and Starch builds it.
Describe the view you want — for example, 'Show me gross margin by channel and by SKU for the last 90 days, flagging any SKU below 30% margin in red' — and an agent builds that dashboard. No formulas, no drag-and-drop, no code.
The Scenario Analysis starter app lets you model what happens to overall margin if COGS increase by 10% or a low-margin channel grows faster than expected — connected to your live Stripe and Plaid data, not a static spreadsheet.
Set up an automation — 'every Monday, pull last week's margin by channel, flag any SKU that dropped more than 5 points, and Slack me a summary' — and Starch runs it without you re-prompting anything.
Get closed-beta access →
Toolkit

Starch apps for this workflow

Pick your role

See this workflow by operator

Run track gross margin by channel and sku on Starch

You're on the list! We'll be in touch soon.