askvity

How to Set Up CAPI?

Published in Meta Conversions API Setup 4 mins read

Setting up Meta's Conversions API (CAPI) allows you to send web events directly from your server to Meta's servers, providing a more reliable way to track customer actions compared to browser-based methods like the Meta Pixel alone. This process begins in Events Manager and involves subsequent server-side implementation.

Initial Setup in Events Manager

The first step in setting up CAPI, similar to setting up a Meta Pixel, involves configuring your events within Facebook's (Meta's) Events Manager.

Based on the reference:

  • Go to the "Events Manager" tab and select "Create Event." This is where you initiate the setup process for tracking actions.
  • Select the pixel you want to use and enter the details of your event. Although CAPI sends events from your server, it is often connected to a specific Pixel or Data Source ID in Events Manager for consolidation and management. You define the standard or custom event details here (e.g., Purchase, AddToCart, Lead).

Note: The reference also states, "Add the event code to your website or mobile app. After setting up your event in the Facebook Events Manager, you will be given a code that you need to add to your website or mobile app." This specific step describes the implementation for the Meta Pixel (client-side tracking), not CAPI. CAPI involves sending event data directly from your server environment, not via client-side code on your website or app.

Understanding CAPI vs. Pixel

It's crucial to understand the difference:

Feature Meta Pixel (Browser-Side) Conversions API (CAPI - Server-Side)
Data Source User's web browser or mobile app Your server or a partner integration
Implementation Add code snippet to website/app front-end Server-side code or dedicated integration/platform setup
Reliability Can be affected by browser issues, ad blockers Generally more reliable, less susceptible to browser factors
Data Sent Browser/app context data Can send more robust customer data (hashed) direct from server

Subsequent Steps for CAPI Setup

After defining your events in Events Manager, the process for CAPI diverges from the Pixel. You will need to implement the CAPI calls from your server environment.

Here's a general outline of the remaining steps:

  1. Choose Your Implementation Method:

    • Direct Integration: Build a server-side integration using Meta's API documentation to send event data directly from your backend code.
    • Partner Integrations: Utilize platforms like Shopify, WooCommerce, or dedicated marketing automation tools that offer built-AIn integrations for CAPI.
    • Tag Management Systems: Some server-side tag managers (like Server-Side Google Tag Manager) can facilitate CAPI setup.
  2. Prepare Event Data: Collect relevant customer and event data (e.g., email, phone number, item details, value, currency). For enhanced matching accuracy, hash sensitive customer information (like email or phone number) before sending it.

  3. Implement the API Call: Write or configure the code on your server or platform to send HTTP POST requests to Meta's Conversions API endpoint. Each request contains the event data you want to track.

  4. Set Up Deduplication: If you are using both the Meta Pixel and CAPI for the same events, you must implement deduplication using the event_id and event_name parameters to prevent double-counting events.

  5. Test Your Setup:

    • Use the "Test Events" tab in Events Manager to send test events from your server and verify that they are received correctly.
    • Confirm event parameters and deduplication are working as expected.
  6. Monitor Performance: Regularly check Events Manager to monitor event reception, matching quality, and error rates.

Implementing CAPI often requires technical resources to handle server-side coding and data management. However, it provides a more resilient and comprehensive tracking solution.

Related Articles