Meta Conversions API (CAPI)
The Meta Conversions API (CAPI) sends purchase-funnel events directly from the Globber server to Meta — independently of the browser. This means ad attribution data is captured even when the Meta Pixel is blocked by browsers, ad-blockers, or iOS privacy restrictions.
The browser-side Meta Pixel fires via Google Tag Manager (GTM) as usual. CAPI sends a server-side mirror of the same events. Meta uses a shared event_id to deduplicate both signals so events are not counted twice.
Events Tracked
| Event | Trigger | event_id format |
|---|---|---|
ViewContent | Single product page load | vc_{product_id}_{unique} |
InitiateCheckout | WooCommerce checkout order created | initiate_checkout_{order_id} |
Purchase | WooCommerce payment complete | purchase_{order_id} |
Configuration
Credentials are stored in WordPress → Theme Options → General Settings (ACF options page).
| Field | Description |
|---|---|
Meta Pixel ID (meta_pixel_id) | Your numeric Meta Pixel ID |
CAPI Access Token (meta_capi_access_token) | System user access token from Meta Events Manager |
Test Event Code (meta_capi_test_event_code) | Optional — use during testing; remove before going live |
If a test event code is set, all CAPI hits will be routed to the Meta Test Events tool and will not be counted as real conversions. Always clear this field in production.
To find or generate your credentials:
- Go to Meta Events Manager
- Select your Pixel → Settings
- Under Conversions API, click Generate Access Token
- Copy the token and your Pixel ID into the ACF settings fields above
How Deduplication Works
Both the browser Pixel (via GTM) and the server CAPI hit carry the same deterministic event_id.
Browser (GTM Pixel tag) ──┐
├──► Meta ──► deduplicated ──► 1× conversion
Server (CAPI) ──┘
For Purchase, the event_id (purchase_{order_id}) is pushed into the dataLayer by the theme alongside the purchase GA4 event. The GTM Pixel tag is configured to read meta_event_id from that dataLayer push.
For ViewContent, a unique event_id is generated per page load and injected into window.dataLayer as meta_vc_event_id so the GTM tag can read it.
User Data & Privacy
All personally identifiable information (PII) sent to Meta is SHA-256 hashed before transmission. Fields hashed include:
- Email address
- Phone number
- First name / Last name
- City, postcode, country
Cookie-based identifiers (_fbp browser ID and _fbc click ID) are captured at checkout and stored on the order. They are forwarded as-is (unmodified) to Meta as required by the CAPI spec.
No raw PII is ever sent in plaintext.
Cookie Capture
When a customer submits the checkout form, the theme captures and saves the following cookies to the WooCommerce order:
| Cookie | Stored as | Purpose |
|---|---|---|
_fbp | _meta_fbp order meta | Meta Pixel browser ID |
_fbc | _meta_fbc order meta | Meta click ID (visitors from Meta ads) |
_ga | _ga_client_id order meta | GA4 client ID (used for GA4 Measurement Protocol refund tracking) |
This ensures that even on server-side hooks (which run outside the browser session), the correct user identifiers are available for attribution.
Idempotency
The Purchase event includes an idempotency guard: once the CAPI hit fires successfully, _meta_capi_purchase_tracked is saved on the order. If the woocommerce_payment_complete hook fires more than once for the same order (e.g. webhook retries), no duplicate event is sent.
Out of Scope (Deferred)
The following events were intentionally excluded from this implementation:
| Event | Reason deferred |
|---|---|
AddToCart | Requires a dedicated AJAX endpoint and mid-session cookie handling |
PageView | High volume, low marginal attribution value compared to Purchase |