Skip to content

Meta CAPI Recovery

E-commerce

Send server-side Shopify sales to Meta CAPI

Stream completed Shopify orders straight to Meta Conversions API with fbclid and SHA-256 hashed email/phone, using Meta's Test Events code before turning live sending on.

Nothing sends to Meta until you explicitly turn outbound sending on.

6 min read12 min setupUpdated
Botanical skincare founder in a cream linen dress packing a customer gift box at a sunlit pale stone counter.
Send every real completed Shopify order back to Meta Conversions API server-side without losing buyers to browser blockers.

Interactive Shopify -> Meta CAPI event mapper

Inspect exact Meta CAPI payloads, SHA-256 hashing, and Test Events routing

Pick a Shopify event, toggle Meta's Test Events code, and inspect the hashed email/phone + fbclid payload Apex sends before turning live delivery on.

Illustrative Shopify store · Meta Conversions API
ApexIntegrations -> Meta Ads -> Sending conversions
Shopify completed order (orders/paid)Meta: Purchase

Only completed money counts. Failed or unfinished checkouts are excluded.

Include Meta Test Events code (TEST41820)

Routes strictly into Meta Events Manager Test Events while keeping live ad reporting untouched.

2,500

Illustrative ~1,200 Meta-attributed orders/mo.

25%

+300 illustrative orders recovered server-side.

Server payload to Meta CAPI

SHA-256 em/ph + fbclid
{
  "event_name": "Purchase",
  "action_source": "website",
  "test_event_code": "TEST41820",
  "user_data": {
    "em": [
      "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
    ],
    "ph": [
      "4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce"
    ],
    "fbc": "fb.1.1733328000.IwAR2x7kQ9mN4pL0vB8cD1fG3hJ5k"
  },
  "custom_data": {
    "currency": "USD",
    "value": 142
  }
}
Apex hashes email and phone (SHA-256); the fbclid goes with them. Apex never creates or pauses your Meta campaigns or changes your budgets or bids. Configure under Integrations -> Meta Ads -> Sending conversions.
Nothing sends until you switch it on

The complete playbook

Step-by-step setup, worked math, and real limits.

Steps, technical details, and live pricing.

How it works without Apex

Connect both Shopify and Meta Ads in Apex via OAuth (Apex exchanges Meta's token automatically for a 60-day long-lived token and sends nothing until you explicitly turn outbound sending on). Choose your target Meta pixel under Integrations -> Meta Ads -> Sending conversions, enable Purchase (and any upper-funnel events you want under Meta's own names), verify delivery with Meta's Test Events code using the built-in Test button, then switch live sending on.

How Apex does it for you

Apex captures fbclid first-party on arrival, sends completed Shopify orders (only completed money counts, excluding failed checkouts), hashes email and phone (SHA-256) with fbclid going along with them, and never edits or pauses your Meta campaigns or budgets.

How to set this up in 5 steps

  1. Connect Shopify and Meta Ads in Apex

    Connect your Shopify store and sign in with Meta Ads OAuth (requesting ads_read, ads_management, and business_management). Apex exchanges the token automatically for a 60-day long-lived token and sends nothing to Meta until you turn outbound sending on.

  2. Keep the Apex snippet live on your storefront for fbclid capture

    When shoppers tap your Facebook or Instagram ads, the Apex storefront script stores fbclid first-party so it links cleanly when Shopify fires the completed order webhook.

  3. Pick your target Meta pixel and toggle Purchase on

    Open Integrations -> Meta Ads -> Sending conversions, pick your target pixel, and switch Purchase (plus optional Lead or AddToCart events under Meta's standard event names) on.

  4. Verify with Meta's Test Events code before going live

    Paste your Test Events code from Meta Events Manager and click the built-in Test button. Confirm the server event lands in Meta Test Events with high match parameters while keeping live ad reporting untouched.

  5. Enable live delivery and monitor verified ROAS

    Clear the test code to start live CAPI dispatch on completed Shopify orders. Apex never creates or pauses Meta campaigns or changes bids, and shows verified Shopify ROAS beside Meta's reported numbers.

Why the browser pixel misses orders

When a Shopify shopper taps an Instagram ad on iOS, completes Apple Pay or Shop Pay checkout, and closes the tab quickly, browser-only Meta Pixels can drop the Purchase event. Between Safari ITP, ad blockers, and express-checkout redirects, a browser-only pixel can miss a meaningful slice of completed purchases (for example, 20% to 30% in an illustrative mobile-heavy storefront), starving Meta's optimization engine of the exact buyers it should find more of.

Shopper smiling in a bright sunlit apartment hallway as she opens a freshly delivered boutique skincare parcel.
Shopify streams completed orders via webhook while Apex hashes email and phone (SHA-256) and sends fbclid alongside them.

How Shopify + Meta CAPI fit together

Apex replaces fragile server-side GTM containers with a direct Shopify-to-Meta Conversions API pipeline:

  1. First-party `fbclid` capture: The Apex storefront script stores fbclid cleanly when the shopper lands from Facebook or Instagram.
  2. Completed money only: Shopify streams completed orders via real-time webhooks so only completed money counts (failed or abandoned checkouts never fire false purchases).
  3. SHA-256 hashed matching: Apex hashes email and phone (SHA-256); the fbclid goes with them alongside order value and currency.
  4. Zero campaign interference: Apex never creates or pauses Meta campaigns and never changes budgets or bids.
Ecommerce fulfillment lead in a tan canvas apron applying shipping labels to packed cartons along sunlit timber warehouse shelves.
Verify every payload safely with Meta's Test Events code using Apex's built-in Test button before turning live sending on.

Testing safely before going live

Connecting Meta Ads in Apex only syncs spend; nothing is sent to Meta until you explicitly turn outbound sending on. Open Integrations -> Meta Ads -> Sending conversions, pick your Meta pixel, choose which events to enable under Meta's standard names (Purchase, Lead, AddToCart), paste your Test Events code from Meta Events Manager, and click Test. Once you see the test event land cleanly inside Meta's Test Events tab, clear the code and switch live sending on.

What this costs on Apex

Live Apex pricing · Pay-as-you-go

Estimated Apex cost for Shopify store with 25,000 monthly visits and 2,500 completed orders sent via Meta CAPI

$0 / month

Covered by monthly free allowances.

Apex meter / scheduleScenario volumeFree allowance / basisRateApex cost
Events
Storefront visits and fbclid capture (25,000 monthly web events)
25,000 / mo1M / month$5 per 100K events$0
Attribution
Attributed paid-channel Shopify orders (1,200 Meta-attributed orders tracked in Attribution)
1,200 / mo1.5K / month$0.05 per attributed conversion$0
Ad platform activations
Server-side Meta Conversions API sends (Completed Shopify orders dispatched with hashed email/phone and fbclid)
2,500 / mo100K / month$10 per 100K sends$0

Shopify webhooks, Meta Ads spend sync, and Meta CAPI outbound delivery live inside one Apex workspace. History: 13 months no card, 3 years with card, 7 years once you've paid an invoice. Live pricing.

Third-party and campaign costs (not paid to Apex)

ExpenseTypical rangeNotes
Meta Conversions API & Shopify webhooks$0/moNo separate sGTM server hosting or third-party CAPI gateway needed

Launch with your AI agent

Preview and configure Meta CAPI outbound sends via MCP

After connecting Shopify and Meta Ads, ask your coding agent to preview your Meta Conversions API payload and confirm the Purchase rule is active.

1Add Apex to your editor

Install in Grok Build

Opens Grok Build and adds Apex. Nothing to configure.

2Tell your agent

Prompt for your AI editor

In my Apex workspace, call list_ad_platform_sends and preview_ad_platform_send for meta-ads so I can verify our Shopify Purchase events, fbclid capture, and SHA-256 hashed fields before enabling live Meta CAPI delivery.

The first time your agent calls Apex, it gives you a link to approve in the browser. There is no key to paste. In Grok Build you can also run /setup-apex.

See how editor setup works step by step

shopify-storefront · Grok BuildWaiting for approval
Agent
You

Set up Apex in this repo.

Set up Apex · 0 of 4
  • Signed in
  • Workspace named
  • Events arriving
  • Conversion picked
  • Stripe

Your move

Feed Meta's algorithm every real Shopify purchase, not just the ones browsers allow.

Verify your server-side Purchase payload with Meta Test Events in 12 minutes, then turn on continuous CAPI recovery.