Shopify has one of the simplest native Meta CAPI integrations available — but the default setup leaves significant conversion data on the table. In this guide, we’ll walk through exactly how to set up Meta CAPI for your Shopify store, and then cover the advanced configuration that most guides skip.
Why Shopify Stores Need Meta CAPI
If you are running Facebook or Instagram ads to your Shopify store, you are likely tracking conversions with the Meta Pixel. But here is the problem: the Pixel alone is missing a significant portion of your iOS sales.
Since Apple’s iOS 14 ATT update, most iPhone users have opted out of cross-app tracking — which means the Meta Pixel cannot see their purchases. For most Shopify stores with a significant iOS customer base (often 50–70% of mobile traffic), this creates a major data gap.
Meta CAPI solves this by sending purchase events from Shopify’s server directly to Meta, bypassing the browser entirely. Combined with the Pixel, it gives you near-complete conversion coverage.
Method 1: Shopify Native Integration (Fastest)
Shopify has a built-in Meta (Facebook) channel that includes CAPI. This is the easiest setup but has limitations in data quality.
Step 1: Install the Meta Sales Channel
- Go to Shopify Admin → Sales channels (left sidebar) → click +
- Find Facebook & Instagram and click Add
- Follow the prompts to connect your Facebook Business account, Ad Account, and Pixel
Step 2: Enable Conversions API
- In the Facebook & Instagram sales channel, go to Settings
- Under Data sharing, select Maximum (this enables CAPI)
- Click Save
What “Maximum” data sharing means: Shopify sends Purchase events via CAPI with customer data (hashed email, phone, name, address) that Shopify has on file from the order. This is already significantly better than Pixel-only tracking.
Step 3: Verify in Meta Events Manager
- Go to Meta Events Manager
- Select your Pixel → Overview
- Look for events showing “Server” as the source (not just “Browser”)
- Check your Event Match Quality score — aim for 7.0 or higher
Method 2: Shopify + Server-Side GTM (Recommended)
For greater control and higher Event Match Quality, use Server-Side Google Tag Manager as a CAPI relay. This method gives you more data control, better deduplication, and the ability to enrich events with additional parameters.
Step 1: Set Up Server-Side GTM Container
- In Google Tag Manager, create a new Server container (not Web)
- Deploy the server container to a Google Cloud Run instance (GTM provides an auto-deploy button)
- Configure a custom domain (e.g.,
track.yourdomain.com) pointing to your server container — this improves cookie persistence
Step 2: Configure Meta CAPI Tag in GTM
- In your Server GTM container, create a new tag using the Facebook Conversions API tag template
- Enter your Meta Pixel ID and CAPI Access Token (generated in Events Manager → Settings → Conversions API)
- Map event parameters:
event_name,event_id,user_data.em(hashed email),user_data.ph(hashed phone),custom_data.value,custom_data.currency - Set trigger: fire on all client events matching your conversion events
Step 3: Connect Shopify Web Events to Server GTM
- In your Web GTM container (or Shopify theme), configure the Meta Pixel to send via your Server GTM container URL instead of directly to Meta
- Add
eventIDto every Pixel event using a Data Layer push from Shopify’s order confirmation page - Shopify’s
thank_youpage exposes order data — push this to the Data Layer for enriched CAPI events
Method 3: Direct CAPI Integration via Shopify Webhooks (Advanced)
The most powerful approach: use Shopify’s native webhooks to trigger CAPI events directly from your backend without GTM.
Step 1: Create a Shopify Webhook
In Shopify Admin → Settings → Notifications → Webhooks, create a webhook for the orders/paid event pointing to your endpoint (e.g., a Cloudflare Worker, AWS Lambda, or Node.js server).
Step 2: Process the Webhook and Send CAPI Event
// Example Node.js webhook handler
const crypto = require('crypto');
function hashSHA256(value) {
return value ? crypto.createHash('sha256').update(value.toLowerCase().trim()).digest('hex') : undefined;
}
async function sendCAPIEvent(orderData) {
const customer = orderData.customer;
const address = orderData.billing_address;
const payload = {
data: [{
event_name: 'Purchase',
event_time: Math.floor(Date.now() / 1000),
event_id: `shopify-${orderData.id}`, // unique per order for deduplication
action_source: 'website',
user_data: {
em: [hashSHA256(customer.email)],
ph: [hashSHA256(customer.phone?.replace(/D/g, ''))],
fn: [hashSHA256(customer.first_name)],
ln: [hashSHA256(customer.last_name)],
ct: [hashSHA256(address?.city)],
st: [hashSHA256(address?.province_code?.toLowerCase())],
zp: [hashSHA256(address?.zip)],
country: [hashSHA256(address?.country_code?.toLowerCase())],
},
custom_data: {
value: parseFloat(orderData.total_price),
currency: orderData.currency,
order_id: orderData.order_number.toString(),
num_items: orderData.line_items.length,
}
}]
};
const response = await fetch(
`https://graph.facebook.com/v19.0/${PIXEL_ID}/events?access_token=${CAPI_TOKEN}`,
{ method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) }
);
return response.json();
}Shopify CAPI Checklist: Common Mistakes
- Not enabling deduplication: Always include
event_id: "shopify-ORDER_ID"in the CAPI payload and matchingeventIDin the Pixel call on the thank-you page - Missing phone number: Shopify stores phone during checkout — always include hashed phone in CAPI events
- Wrong event timing: Fire the CAPI Purchase event on
orders/paidwebhook (when payment confirmed), notorders/created(when order placed but may not be paid) - Not hashing PII: Shopify’s native integration hashes automatically — but custom implementations must SHA-256 hash email, phone, and name before sending
- Using test Pixel in production: Double check you are using your real Pixel ID, not a test Pixel, in your CAPI configuration
Expected Results After Shopify CAPI Setup
| Metric | Before CAPI | After CAPI (Typical) |
|---|---|---|
| Event Match Quality | 4–6 | 8–9.5 |
| Reported purchases in Meta | 60–70% of actual | 90–100% of actual |
| iOS conversions tracked | ~30% | ~85% |
| Cost per result (CPA) | Baseline | Typically 15–35% lower |
| ROAS | Baseline | Typically 20–40% higher |
Results vary depending on your iOS customer mix, product price point, and data completeness. Stores with higher-value products (AOV $100+) and strong email capture typically see the largest improvements.
Frequently Asked Questions
Does Shopify have built-in CAPI support?
Yes. The Shopify Facebook & Instagram Sales Channel includes CAPI when you select “Maximum” data sharing. However, it has limitations — it does not send all customer parameters, and deduplication relies entirely on Shopify’s implementation. Custom integration gives better results.
Do I still need the Meta Pixel if I use CAPI on Shopify?
Yes. The Pixel captures ViewContent, AddToCart, and InitiateCheckout events that help Meta optimise ad delivery for top-of-funnel users. CAPI is most critical for Purchase events. Running both gives full-funnel coverage.
How do I get my CAPI Access Token for Shopify?
Go to Meta Business Suite → Events Manager → Select your Pixel → Settings → Conversions API → Generate Access Token. Store this securely — it grants full access to send events to your Pixel.
Will CAPI affect my Shopify store speed?
No. CAPI events are sent server-side (from Shopify’s or your server) and do not add any JavaScript or loading time to your storefront. If anything, reducing reliance on browser-based Pixel tracking can slightly improve page performance.
Related guides: How to Improve Meta Event Match Quality | What is Meta CAPI? | Meta Pixel vs Conversions API
Want Us to Set Up Meta CAPI for Your Shopify Store?
We handle the complete Meta CAPI setup for Shopify — from deduplication to customer parameter enrichment — typically achieving Event Match Quality of 8.5+. Most clients see 20–40% improvement in ROAS within 2 weeks.