The deeper companion to how to connect Claude to the Meta Ads CLI. That post is about giving Claude access to your Meta account. This post is about using that access to wire Meta ads + Shopify together properly — the four layers most stores have half-broken.
The customer pain point
Founders running Meta ads on Shopify usually have one of these problems and don't know it:
- Meta Pixel fires events Shopify doesn't see — your "Purchase" count in Ads Manager doesn't match your Shopify orders.
- Conversions API isn't installed — so 20-40% of conversions get lost to iOS 14.5+ and ad blockers.
- UTMs are inconsistent — every campaign tags differently, and your GA4/Shopify reports can't roll them up.
- The analytics loop is broken — you can't answer "did my Tuesday creative drop my ROAS?" without manually digging through Ads Manager, Shopify, and GA4.
Claude — given the right context — fixes all four in one sitting.
Table of Contents
- The 4-Layer Stack
- Layer 1 — Meta Pixel
- Layer 2 — Conversions API (CAPI)
- Layer 3 — UTM Standardization
- Layer 4 — The Diagnostic Loop
- What to Ship First
Key Takeaways
| Layer | What it does | Where it lives |
|---|---|---|
| Meta Pixel | Tracks events from the browser (PageView, ViewContent, AddToCart, Purchase) | Shopify theme + Meta app |
| Conversions API | Server-side mirror of Pixel events — recovers iOS/ad-blocker losses | Shopify ↔ Meta direct connection (no theme edit needed) |
| UTMs | Lets every system (Shopify, GA4, Meta) attribute the right traffic source | Set in Meta ad URLs, consumed everywhere |
| Diagnostic loop | One Claude prompt that pulls Meta + Shopify data together for ROAS analysis | Run weekly |
The non-negotiable: all four matter. Skip CAPI and you under-report 30% of conversions. Skip UTMs and you can't tell paid from organic. Skip the loop and you optimize on yesterday's numbers.
The 4-Layer Stack
- Pixel in the browser → events flow to Meta.
- CAPI from your server → events flow to Meta even when the browser doesn't.
- UTMs on every Meta ad URL → Shopify + GA4 know the order came from a specific campaign/ad set/ad.
- Loop = Claude reads all three weekly and tells you what's working.
Most stores have layer 1 working. Maybe layer 3. Almost never layer 2. Layer 4 is rare in our audits.
Layer 1 — Meta Pixel
Install via the official Meta channel in Shopify (Settings → Apps → Meta) — not by pasting Pixel code into your theme. The native channel:
- Auto-fires PageView, ViewContent, AddToCart, InitiateCheckout, Purchase
- Maps Shopify variants → Meta product catalog (needed for Advantage+ catalog ads)
- Doesn't break when you swap themes
The Claude prompt to verify it's set up right:
Using the Meta Ads CLI and Shopify connector:
1. Pull the last 7 days of "Purchase" events from Meta Pixel for
pixel ID [your pixel ID]
2. Pull the last 7 days of order count from my Shopify store
3. Calculate the gap: (Shopify orders − Meta Purchase events) / Shopify orders
Tell me:
- The gap percentage
- Whether the gap is consistent (likely an iOS/ad-blocker tax) or
trending (likely a tracking bug)
- If trending, what specifically broke and when
Be decisive.
A 25-35% gap is the iOS 14.5+ baseline — that's what CAPI fixes. A trending gap (e.g. 5% → 20% over 4 weeks) means something broke in your theme.
Layer 2 — Conversions API (CAPI)
CAPI sends events server-to-server. Independent of the browser. iOS, ad blockers, and Safari ITP can't kill it.
Two ways to install it:
Easy path (recommended): In Shopify → Settings → Apps → Meta → Conversions API → toggle ON. Shopify handles the entire pipeline natively — orders, checkouts, and product views fire from Shopify's servers directly to Meta.
Custom path (only if you have a custom funnel): Like us — we have a custom application form at /apply/:offer that lives outside Shopify checkout. We fire CAPI manually from our Vercel function. The reference implementation is in our application API — SubmitApplication event hashes PII (SHA-256), passes fbp/fbc cookies, dedups against the client-side fbq event using shared event_id.
The Claude prompt to verify CAPI is working:
Using the Meta Ads CLI, pull Event Match Quality (EMQ) for my
pixel ID [your pixel ID] for the last 7 days.
Tell me:
1. EMQ score per event type (Purchase, ViewContent, etc.)
2. Which parameters are below 100% coverage (fbp, fbc, em, ph,
client_ip_address, client_user_agent, external_id)
3. The single biggest match-quality fix I can ship this week
Anything under 6.5 EMQ is leaking attribution. Diagnose.
A common finding: fbc (click ID) coverage is low because URLs lose the fbclid param somewhere in your funnel. We've seen 10-15% coverage where it should be 60%+. Fix: stop redirecting through intermediate URLs that strip query strings.
Layer 3 — UTM Standardization
Without UTMs, Meta says "I drove this conversion" and GA4 says "I drove this conversion" and Shopify says "it's all direct traffic." Three sources of truth that disagree.
The Branva standard for Meta ads:
utm_source=facebook
utm_medium=cpc
utm_campaign={{campaign.name}}
utm_content={{adset.name}}
utm_term={{ad.name}}
Set these in Meta's URL parameters field on every campaign (Campaign settings → Tracking → URL Parameters). Use Meta's dynamic placeholders so each ad auto-tags itself.
Claude prompt to audit your UTMs:
Using the Meta Ads CLI:
1. List every active campaign for ad account [your account ID]
2. For each, show the URL parameters set at campaign + ad-set + ad
level
3. Flag any that:
- Have no UTMs set
- Use inconsistent utm_source (e.g. "fb" vs "facebook" vs "Meta")
- Use static values instead of {{campaign.name}} placeholders
- Are missing utm_content or utm_term
Give me a ranked fix list. Highest revenue campaigns first.
Inconsistent UTMs become 18 months of attribution debt. Fix early.
Layer 4 — The Diagnostic Loop
This is what most operators never set up. The loop:
Every Monday, using the Meta Ads CLI + Shopify connector:
1. Pull last week's spend, CPMs, CPCs, ROAS by campaign from Meta
2. Pull last week's orders, AOV, returning-vs-new from Shopify
3. Cross-reference Shopify orders to UTMs to confirm Meta-attributed
revenue
4. Calculate true ROAS = Shopify Meta-attributed revenue / Meta spend
5. Compare to Meta's reported ROAS — gap > 15% = attribution issue
Then rank:
- Top 3 ad sets to scale (ROAS > X, frequency < 2.5, CPM stable)
- Top 3 ad sets to kill (ROAS < Y, frequency > 4, declining CPC)
- Single creative that's bleeding — show me the ad ID
Brief. 10 bullets. I want to ship by EOD.
Run this every Monday. Six months in, you've built the cleanest paid-growth feedback loop your competitors don't have.
What to Ship First
If you only do one thing this week: turn on CAPI in Shopify → Settings → Apps → Meta → Conversions API. One toggle. Recovers ~30% of attributed conversions instantly. Every other fix in this post is incremental — that one is a step change.
Then run the Layer 1 Pixel verification prompt to confirm the gap closes from ~30% to ~5%.
Talk to Branva
We wire this 4-layer stack on every paid-growth client store as part of our managed operations — Pixel + CAPI + UTM standardization + the Monday loop. Book a free call and we'll audit your current setup live.
Frequently Asked Questions
Do I need both Pixel and CAPI?
Yes. Pixel catches browser-side events with high fidelity (when the browser cooperates). CAPI catches the rest — iOS users, ad blockers, Safari private mode. Together they hit 90-95% of conversions. Pixel alone caps around 60-70% in 2026.
Won't Shopify's native Meta channel handle all of this automatically?
For PageView/ViewContent/Purchase on Shopify-native pages: yes. For custom funnels (your own LPs, application forms, calculators outside Shopify checkout): no — you need to fire CAPI yourself. See our Meta CLI post for the connection setup.
What if my UTMs are already a mess?
Don't try to clean history. Standardize going forward (the Branva format above), and tell Claude "ignore data before [date]" when you run the diagnostic loop. Six months from now your history is clean.
Can Claude actually push UTM changes to Meta?
Yes — via the Meta Ads CLI, Claude can update the URL Parameters field on each ad/adset. Same confirm-before-apply discipline as Shopify bulk operations: Claude shows you the diff, you say "apply", it executes.
Where do I see Event Match Quality (EMQ)?
Meta Events Manager → your Pixel → Diagnostics → Event Match Quality. Anything under 6.5 means Meta can't reliably match the event to a user. Adding external_id, hashed email, and hashed phone in the CAPI payload is the fastest lift.
Related reading
- How Do I Connect Claude to the Meta Ads CLI? — the Claude-side setup.
- How Do I Connect Google Ads to Shopify Using Claude? — same pattern, Google side.
- How Do I Use the Shopify Connector in Claude? — the Shopify-side ops.
- How Do I Connect Claude to Shopify? — the prerequisite.
- The AI Workflows pillar — every workflow we run.