Skip to main content

Thread Transfer

Conversions API (CAPI) Explained: Why Server-Side Tracking Matters

Your pixel reports 60 purchases but Shopify shows 95. That 37% gap is costing you optimized delivery. Here's why CAPI closes the tracking gap.

Jorgo Bardho

Founder, Meta Ads Audit

June 3, 202513 min read
conversions apiCAPIserver-side trackingmeta tracking
Diagram comparing browser pixel vs server-side CAPI tracking

Your pixel reports 60 purchases. Shopify shows 95 actual sales. That 37% gap represents lost optimization signal, broken attribution, and campaigns running partially blind. Browser-side tracking—the Meta Pixel—loses conversions to ad blockers, browser privacy features, and iOS App Tracking Transparency. The Conversions API (CAPI) sends events directly from your server, bypassing these blocks.

CAPI isn't a replacement for the pixel—it's a complement that fills tracking gaps. Together, they provide more complete conversion data than either alone. This guide explains why server-side tracking matters, how CAPI works technically, and what you need to implement it correctly.

Why Browser-Side Tracking Is Failing

Ad Blockers

An estimated 30-40% of users run ad blockers that specifically target tracking pixels. When a user with an ad blocker purchases from your site, the pixel never fires. Meta never learns about the conversion. Your campaigns lose optimization signal and your reported ROAS drops even though actual ROAS hasn't changed.

iOS App Tracking Transparency (ATT)

Since iOS 14.5, Apple requires apps to get explicit user consent before tracking. Only about 25% of users opt in. When users opt out, the Meta Pixel can still fire, but Meta can't use that data for attribution or optimization as effectively. Cross-device tracking becomes nearly impossible.

Browser Privacy Features

Safari's Intelligent Tracking Prevention (ITP) limits cookie lifespans to 7 days for third-party contexts. Firefox Enhanced Tracking Protection blocks known trackers. Chrome is phasing out third-party cookies. Each privacy feature chips away at pixel reliability.

JavaScript Errors

The pixel is JavaScript. Any JavaScript error on your page can prevent it from executing. Slow page loads, conflicting scripts, or user-initiated page exits can all stop the pixel from firing even without any blocking software.

How CAPI Solves These Problems

The Conversions API sends event data from your server directly to Meta's servers. This server-to-server communication bypasses all browser-level blocking:

  • Ad blockers can't block requests from your server
  • Browser privacy features don't affect server requests
  • iOS ATT doesn't block server-side data transmission
  • JavaScript errors don't prevent server-side event sending

The Data Flow

When a user makes a purchase, two things happen:

  1. Browser-side (Pixel): JavaScript fires on the thank-you page, sending event data from the user's browser to Meta
  2. Server-side (CAPI): Your server sends the same event data directly to Meta's Conversions API endpoint

Meta receives both signals and uses deduplication (explained below) to count the conversion only once while having higher confidence in its accuracy.

CAPI Technical Overview

API Endpoint

CAPI events are sent via HTTP POST to Meta's Graph API:

POST https://graph.facebook.com/v18.0/{pixel_id}/events
Authorization: Bearer {access_token}
Content-Type: application/json

Event Payload Structure

Each CAPI request contains an array of events with customer information and event details:

{
  "data": [{
    "event_name": "Purchase",
    "event_time": 1699564800,
    "event_id": "order_12345",
    "event_source_url": "https://yoursite.com/thank-you",
    "action_source": "website",
    "user_data": {
      "em": ["hashed_email"],
      "ph": ["hashed_phone"],
      "fn": ["hashed_first_name"],
      "ln": ["hashed_last_name"],
      "ct": ["hashed_city"],
      "st": ["hashed_state"],
      "zp": ["hashed_zip"],
      "country": ["hashed_country"],
      "external_id": ["hashed_customer_id"],
      "client_ip_address": "192.168.1.1",
      "client_user_agent": "Mozilla/5.0...",
      "fbc": "_fbc_cookie_value",
      "fbp": "_fbp_cookie_value"
    },
    "custom_data": {
      "value": 99.99,
      "currency": "USD",
      "content_ids": ["SKU123"],
      "content_type": "product",
      "order_id": "order_12345"
    }
  }]
}

Required vs Optional Parameters

ParameterRequiredImpact on Matching
event_nameYesDefines the event type
event_timeYesMust be within 7 days
action_sourceYesUsually "website"
email (em)Highly recommendedStrongest matching signal
phone (ph)RecommendedStrong matching signal
fbc, fbp cookiesRecommendedCritical for attribution
IP address, user agentRecommendedHelps with matching
external_idOptionalUseful for CRM integration

Data Hashing

Customer identifiers (email, phone, name, address) must be hashed using SHA-256 before transmission. Meta never receives raw customer data—only hashed versions that can be matched against their user database.

// Example: Hashing email in Node.js
const crypto = require('crypto');
const hashedEmail = crypto
  .createHash('sha256')
  .update(email.toLowerCase().trim())
  .digest('hex');

Always normalize data before hashing: lowercase, trim whitespace, remove country codes from phones.

Deduplication: How Pixel + CAPI Work Together

When both pixel and CAPI send the same event, Meta needs to count it only once. Deduplication uses the event_id parameter:

  1. Pixel fires with event_id: "order_12345"
  2. CAPI sends with event_id: "order_12345"
  3. Meta sees matching event_ids and counts one conversion

If event_ids don't match or are missing, Meta may count duplicate conversions—inflating your numbers and confusing the algorithm.

Deduplication Best Practices

  • Use consistent, unique identifiers (order ID, transaction ID)
  • Generate event_id on page load or in backend, share with both pixel and CAPI
  • For non-purchase events, use session-based identifiers plus timestamp
  • Test deduplication in Events Manager before going live

Event Match Quality (EMQ)

Event Match Quality measures how well Meta can match your events to Facebook users. It's scored 1-10, where higher is better:

  • 1-3 (Poor): Limited matching, weak optimization
  • 4-6 (OK): Basic matching, room for improvement
  • 7-8 (Good): Strong matching, solid optimization
  • 9-10 (Great): Excellent matching, maximum optimization

How to Improve EMQ

EMQ improves when you send more and better customer data:

  • Email: Single biggest EMQ booster. Send hashed email whenever available.
  • Phone: Second strongest signal. Normalize format before hashing.
  • fbc/fbp cookies: Critical for linking server events to browser sessions. Capture and pass these cookies.
  • Name + Address: Help with matching when email isn't available
  • IP + User Agent: Provide additional matching signals

Most accounts should aim for EMQ of 7+. Below 6 indicates significant matching issues that hurt optimization.

When CAPI Captures Events the Pixel Misses

Ad Blocker Scenario

User with ad blocker completes purchase. Pixel blocked—no browser event. CAPI fires from your server with order details and hashed email. Meta matches via email, attributes conversion, updates optimization.

iOS Opted-Out Scenario

iOS user who declined ATT completes purchase. Pixel fires but with limited attribution capability. CAPI fires with full customer data. Meta combines signals for better matching than pixel alone.

Page Exit Before Pixel Load

User completes purchase but navigates away before thank-you page fully loads. Pixel never fires. Server processes order and triggers CAPI with full details. Conversion captured.

CAPI Implementation Approaches

Platform Native Integrations

The easiest approach. Shopify, WooCommerce, and other platforms offer built-in CAPI connections that handle all technical details:

  • Automatic event capture on standard actions
  • Built-in deduplication with their pixel integration
  • Proper data hashing and formatting
  • Minimal technical implementation required

Gateway Solutions

Tools like Stape, Elevar, or server-side GTM act as intermediaries:

  • Capture events from your site or data layer
  • Transform and hash data appropriately
  • Send to Meta's CAPI endpoint
  • Handle deduplication logic

More flexible than native integrations, works with custom setups, but adds another vendor dependency.

Custom Implementation

Direct API integration for full control:

  • Build server-side code to capture events
  • Hash and format data per Meta specifications
  • Send events via HTTP POST to Graph API
  • Implement retry logic and error handling

Most flexible but requires development resources. Recommended for custom platforms or when native integrations don't meet needs.

CAPI for Different Event Types

Purchase Events

Most critical for ecommerce. Include:

  • Order ID as event_id (for deduplication)
  • Total value and currency
  • Product content_ids for catalog matching
  • Customer email and phone when available

Lead Events

Essential for lead gen businesses:

  • Form submission ID as event_id
  • Lead value if known
  • All captured contact info (email, phone, name)

Add to Cart Events

Important for optimization but not always server-triggerable:

  • If cart is server-managed, send via CAPI
  • If cart is client-side only, rely on pixel
  • Use session ID + timestamp for deduplication

View Content Events

Typically browser-only (user viewing page):

  • Most implementations rely on pixel for ViewContent
  • CAPI can supplement if you have server-side page view tracking
  • Less critical than conversion events for CAPI coverage

Testing and Verification

Test Events Tool

  1. Go to Events Manager → Your Pixel → Test Events
  2. Scroll to "Server Events"
  3. Trigger a test transaction
  4. Verify CAPI event appears with correct parameters
  5. Check deduplication with matching pixel event

What to Verify

  • Events appear in both browser and server sections
  • Event_ids match for deduplication
  • Parameters (value, currency, content_ids) are correct
  • User data is present and properly hashed
  • No duplicate events showing (indicates dedup failure)

Monitoring After Launch

After implementation:

  • Compare pixel events vs CAPI events—CAPI should capture more
  • Monitor Event Match Quality—should improve with CAPI data
  • Watch for conversion count changes in Ads Manager
  • Check for any duplicate event warnings in Events Manager

Common CAPI Implementation Mistakes

Missing Event_ID

Without event_id, deduplication fails. Both pixel and CAPI report the conversion—you see 2x actual conversions. Always include matching event_ids in both.

Mismatched Event_IDs

Pixel sends event_id: "abc123", CAPI sends event_id: "order-abc123". Different IDs = no deduplication. Ensure exact string match.

Improper Data Hashing

Hashing "John@Email.com" and "john@email.com" produces different hashes. Normalize before hashing: lowercase, trim whitespace, consistent formatting.

Missing fbc/fbp Cookies

These cookies link CAPI events to browser sessions. Without them, attribution suffers even with other user data. Capture and pass these cookies from the browser to your server.

Delayed Event Sending

CAPI events must be sent within 7 days of occurrence. Batch processing that delays beyond this window results in rejected events.

Key Takeaways

  • Browser-side tracking loses 20-40% of conversions to blocking and privacy features
  • CAPI sends events server-to-server, bypassing all browser-level blocks
  • Use pixel + CAPI together with matching event_ids for deduplication
  • Event Match Quality measures matching effectiveness—aim for 7+
  • Include email, phone, and fbc/fbp cookies to maximize EMQ
  • Platform integrations simplify setup; custom implementations offer flexibility
  • Test thoroughly in Events Manager before relying on CAPI data

FAQ

Does CAPI replace the pixel?

No. CAPI complements the pixel. The pixel captures browser-side signals (like ViewContent on page load) that servers can't easily track. CAPI captures conversions that ad blockers and privacy features hide from the pixel. Together they provide more complete data than either alone.

Will CAPI double-count my conversions?

Not if you implement deduplication correctly. Use matching event_ids in both pixel and CAPI events. Meta uses these IDs to count each conversion only once. Test in Events Manager to confirm deduplication works.

How much will CAPI improve my tracking?

Results vary by audience. Sites with high ad blocker usage (tech-savvy audiences) see the biggest gains—sometimes 30-50% more conversions captured. Sites with less tech-savvy audiences may see 10-20% improvement. Either way, more data means better optimization.

Do I need a developer to implement CAPI?

Platform integrations (Shopify, WooCommerce plugins) require no development. Gateway solutions (Stape, server GTM) require some technical setup but no custom coding. Direct API implementation requires development resources. Choose based on your technical capacity.