> ## Documentation Index
> Fetch the complete documentation index at: https://help.hoopai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Meta Conversion API (CAPI)

> Set up server-side conversion tracking with Meta's Conversion API to improve ad attribution and optimize campaigns despite iOS privacy changes.

Meta's Conversion API (CAPI) sends conversion data from your server directly to Meta, bypassing browser-based tracking limitations. With iOS privacy changes (App Tracking Transparency) and browser cookie restrictions reducing the accuracy of the Facebook Pixel alone, CAPI has become essential for accurate ad attribution and campaign optimization.

***

## What CAPI is

The Conversion API is a server-side tracking method that sends event data (purchases, form submissions, page views) directly from your backend to Meta's servers. Unlike the Facebook Pixel (which runs in the browser), CAPI is not affected by ad blockers, cookie restrictions, or iOS ATT opt-outs.

***

## Why it matters

| Without CAPI                                    | With CAPI                                                  |
| ----------------------------------------------- | ---------------------------------------------------------- |
| iOS ATT opt-outs block pixel tracking           | Server-side events are not affected by ATT                 |
| Ad blockers prevent pixel from firing           | Server-side events bypass ad blockers                      |
| Cookie restrictions reduce attribution window   | Direct server communication maintains full attribution     |
| Campaign optimization suffers from missing data | More complete data improves Meta's optimization algorithms |

***

## Setting up CAPI in HoopAI

<Steps>
  <Step title="Connect your Meta Business account">
    Ensure your Meta Business account is connected in **Marketing > Ad Manager > Settings**.
  </Step>

  <Step title="Navigate to CAPI settings">
    Go to **Settings > Integrations > Facebook** (or **Meta CAPI**) and click **Configure**.
  </Step>

  <Step title="Enter your access token">
    Generate a Conversion API access token in your Meta Events Manager and paste it into the platform.
  </Step>

  <Step title="Select your pixel">
    Choose the Facebook Pixel that will receive server-side events. The CAPI events are matched against your pixel events for deduplication.
  </Step>

  <Step title="Configure events">
    Select which events to send via CAPI:

    * **Lead** — form submissions, contact creation
    * **Purchase** — completed transactions
    * **PageView** — page visits on your funnels/websites
    * **InitiateCheckout** — checkout page visits
    * **CompleteRegistration** — account or membership signups
  </Step>

  <Step title="Test the connection">
    Use Meta's Test Events tool in Events Manager to verify events are being received correctly.
  </Step>
</Steps>

***

## Workflow action for CAPI events

You can fire CAPI events from workflow actions for maximum flexibility:

1. In the Workflow Builder, add a **Send Conversion Event** action
2. Select the event type (Lead, Purchase, Custom)
3. Map contact data fields to event parameters (email, phone, value)
4. The event is sent to Meta when the workflow action fires

This is useful for tracking offline conversions, phone sales, or custom events that do not happen on a tracked web page.

***

## Event deduplication

When you use both the Facebook Pixel and CAPI, the same event may be reported twice. Meta handles deduplication automatically when:

* Both the pixel event and CAPI event include the same `event_id`
* The events occur within a 48-hour window

The HoopAI platform automatically generates matching event IDs for pixel and CAPI events to prevent double-counting.

***

## Testing and troubleshooting

<AccordionGroup>
  <Accordion title="Events not appearing in Events Manager">
    Check that your access token is valid and has the correct permissions. Verify the pixel ID is correct. Use Meta's Test Events tool with a test event code to confirm the connection.
  </Accordion>

  <Accordion title="Duplicate events showing in reports">
    Ensure event deduplication is configured. Both pixel and CAPI events must use the same event\_id parameter. Check that the platform's automatic deduplication is enabled.
  </Accordion>

  <Accordion title="Match rate is low">
    CAPI match rate depends on the quality of customer data sent (email, phone, name, location). Ensure contact records in your CRM have complete data — more parameters improve match rates.
  </Accordion>

  <Accordion title="Events are delayed">
    CAPI events may take a few minutes to appear in Events Manager. This is normal. If delays exceed 1 hour, check your server connection and access token.
  </Accordion>
</AccordionGroup>

<Tip>
  Aim for a CAPI event match rate above 50%. Higher match rates give Meta more data for optimization. Ensure contact email and phone fields are populated for the best results.
</Tip>
