The Conversions API supports advertisers’ efforts to provide consumers with appropriate data transparency and control while also helping them to continue providing personal experiences. With the API, you can share data directly from your server, rather than through a browser.
Deeper-Funnel Visibility: The Conversions API allows you to share a wider array of data when compared to the Meta Pixel. With the API, you can make decisions taking into account more information, such as CRM data, lower funnel events (including qualified leads), and multi-site conversion paths across a website and a physical location.
Data Control: When used via a Server-Only implementation (for example, without the Meta Pixel), the Conversions API gives you added control over what data you share. You can choose to append insights to your events, providing data such as product margins or historical information, like customer value scores.
Signal Reliability and Resiliency: Data sharing through the Conversions API may be more reliable than browser-based methods alone, like the Meta Pixel. The API is designed to be less susceptible to issues like a browser crash or connectivity problems. New industry data transmission restrictions may limit the efficacy of cookies and Pixel tracking, so the Conversions API helps you have control on sharing signals that may no longer be captured by the Pixel.
Additional Resources: View the Conversions API Direct Integration Playbook for Developers (PDF) and Direct Integration Webinar for Developers
You can think about your Conversions API integration in two main stages:
Preparation — Select which type of integration makes sense for you, define which events to send, and review available optimization options.
Execution — Learn how to implement the API. For this stage, you can also use a partner integration.
The following is a snapshot of the complete integration process:
Requirements | Full Integration | Optimization |
---|---|---|
Select events to share with Meta with user consent (if any). Set up your business’ assets: Meta Pixel, Meta Application, Business Manager, Server Connection, System User. | Step 1: One event - Sending any event, manually or automated using the system user's token. Completing this step means you have correctly set up authentication. Step 2: Fully Integrated - You need to be sending some automated events to be considered integrated. Completing this milestone means you are able to optimize for Conversions API even in the event that you stop using the Pixel or the Pixel is blocked. | Once you are fully integrated, send enough automated funnel events to be considered fully onboarded. Then, optimize your match rate based on guidance from Event Match Quality. Make sure:
|
If you have an existing Meta Pixel integration, the Conversion API integration should be built as an extension of the Pixel integration, instead of as an entirely different connection.
If you have logic for controlling consent with respect to sharing Pixel data, use the same logic with respect to sharing data via Conversions API.
To start, select the integration option you would like to implement:
Setup | Approach Description |
---|---|
Redundant Setup (Recommended) | Send all events via both Pixel and Conversions API. This is the recommended setup for those who would like to keep the Pixel on their website, and are able to fully adopt the Conversions API. To succeed, you must be able to generate a persistent This setup provides performance on par or better than using only the browser Pixel. The server can capture events that may not be tracked by the browser, such as purchases that occur on a separate website, lead conversions, or phone calls. |
Split Setup | Send different types of events via Pixel and Conversions API. For example, you could send While this option is not as optimal as a redundant setup, you may consider it if you do not want to use a fully redundant setup. Take into consideration that you may need to complete additional work as browser changes are implemented. |
Server-Only Implementation | Only send events through the Conversions API, instead of through the browser. We recommend implementing either a redundant setup or a split setup before switching to this approach. |
Once you have chosen your integration approach, you can define which events you want to send. Signals are most useful if they are matched to Meta user IDs, so it is important to think through what parameters you are sending us with an event and how often you would like to send them.
Send events that are most relevant to your business. See a full list of supported standard and custom Meta events.
You can send multiple parameters inside each event. See parameters used by Conversions API to learn more about those fields.
You can add multiple types of IDs to your events, including event_id
, external_id
and order_id
. It’s important to know the difference between these parameters:
ID | Description | How It Is Used |
---|---|---|
Your unique ID for a specific customer. | Learn more about External ID. | |
Event ID | A unique ID for a given event. | Used on event deduplication. This field is very important if you are sending events via both browser Pixel and conversions API. |
Order ID | A unique ID for a given order. This parameter only works for purchase events and expects an | This implementation is limited to select Meta partners. Contact your Meta representative for access. Used on purchase event deduplication, if you send events via both browser Pixel and conversions API.
You can deduplicate purchase events within two windows: 48 hours (recommended) or 28 days. This is the window between the first and second instances of the same event. |
We recommend that you send events in real time or in batches based on a specific timeline via the Conversions API. Sending your events in real time or within 1 hour helps ensure that they can be used for attribution and optimized for ad delivery.
Sending your events more than 2 hours after they occurred can cause a significant decrease in performance for ads optimized for those events. Events sent with a delay of 24 hours or more may experience significant issues with attribution and optimized ad delivery.
If you’re sending events with long conversion windows, send the event as close to real time as possible from the point at which the full conversion is completed.
Move on to the next step once you have:
The Conversions API offers the following optimization types:
Optimization Option | Description |
---|---|
Conversions Optimization | Optimize ad delivery to show ads to people most likely to make a conversion. |
Value Optimization (also known as Return on Ads Spend Optimization) | Optimize ad delivery to show ads to people most likely to make a conversion of a specified value, such as purchases over $50. |
Dynamic Product Ads | Optimize ad delivery to show ads for specific products to people most likely to purchase those specific products. |
There are two ways to implement your integration:
Advertisers using conversions API through one of our marketing partners should follow our partner’s implementation guidelines.
Prior to using the Conversions API, set up the following assets:
Asset | Description |
---|---|
When you send events through the Conversions API, they’re processed and stored in the same way as the events you send through your Pixel. When you implement the Conversions API, you select which Pixel you want to send your events to. Sending your Conversions API events to a Pixel lets you use your Conversions API events in the same way you use your browser-based Pixel events for measurement, attribution, and ad delivery optimization. We recommend sending events from the browser and your server to the same Meta Pixel ID. | |
You need a Business Manager to use the API. Business Manager helps advertisers integrate Meta marketing efforts across their business and with external partners. If you don't have a Business Manager, see the Help Center article on how to Create a Business Manager. | |
Access Token | To use the Conversions API, you need an access token. There are two ways of getting your access token:
|
Move on to Implement the API once you have the assets ready. Remember to save IDs for your assets, since you use those on your API calls.
Once you are done with the requirements, start the implementation process. While building on the Conversions API, always check the developer documentation.
If this is your first time using the API, start with a test call. To do that, you need a payload and a method for making API calls. After the call is completed, check Events Manager to verify the call worked as expected.
Payload | API Call Method |
---|---|
Use the Payload Helper to generate a sample payload to be sent with your call. Follow the instructions listed on the tool. Your payload should look something like this: { "data": [ { "event_name": "Purchase", "event_time": 1601673450, "user_data": { "em": "7b17fb0bd173f625b58636fb796407c22b3d16fc78302d79f0fd30c2fc2fc068", "ph": null }, "custom_data": { "currency": "USD", "value": "142.52" } } ] } If you want to test your payload from the Payload Helper, add your Pixel ID under Test this Payload and click on Send to Test Events. You should be able to see the event on Events Manager > Your Pixel > Test Events. Learn more about the Test Events Tool. | Once you are satisfied with your payload, decide how you want to make your call. You can use our Graph API Explorer (see Guide) or your own servers. If you are using your servers, you can use CURL or the Meta Business SDK—We highly recommend using the Meta Business SDK. Independently on your call method, you should call the { "events_received": 1, "messages": [], "fbtrace_id": <FB-TRACE-ID> } |
After you complete your first call, verify your events on Events Manager > Your Pixel > Overview.
Move on to Send and Verify Events once you have checked your test events in Events Manager.
To start sending events, make a POST
request to the API’s /events
edge. Attach a payload to your call —if you need help generating your payload, visit the Payload Helper. See the following resources for more information and code samples:
After you start sending events, go to Events Manager and confirm that we have received the events you sent. Learn how to Verify Your Events.
If your implementation is complementary to a browser Pixel, move on to deduplication settings. Otherwise, you are all set! Check Support if you still have questions.
If you’re sending identical events from your Pixel and through the Conversions API, you need to set up deduplication for your events sent via both channels. First, read developer documentation to understand the deduplication logic.
If we find the same server key combination (event_id
, event_name
) and browser key combination (eventID
, event
) sent to the same Pixel ID within 48 hours, we discard the later sent duplicate events.
To help ensure your events are deduplicated:
event_id
from your server event and eventID
from your browser eventevent_name
from your server and browser eventsevent_id
. This ID should not be shared with other events.While Event ID will always be the best way to deduplicate events, it's a fairly complex implementation. You can leverage alternative solutions by using external_id or fbp parameters. If you have configured the external_id or fbp parameters to be passed via both browser and server, we will deduplicate events automatically if we see the same event with same external_id or fbp parameters within 48 hours.
The Meta Business SDK has advanced features designed especially for Conversions API users:
The following instructions are for partners offering conversions API as a service to advertisers.
Your app should get the following features and permissions:
ads_management
and pages_read_engagement
and ads_read
. First, follow the direct integration steps and test your integration. Then, you can request authorization to send events on behalf of your clients. You have the following authentication options:
Meta Business Extension returns all the necessary information needed to send events on behalf of the client via the following process. Meta Business Extension provides an endpoint to retrieve system user access tokens created in the client’s Business Manager. This process includes permissions to send server events and is done automatically and in a secured way.
The endpoint requires an user access token as input parameter. For new Meta Business Extension users, call this endpoint the endpoint to fetch the system user access token after you finish setting up Meta Business Extension. Existing users need to ask for re-authentication before calling the new API endpoint.
Facebook Business 扩展程序目前仅供已获批准的合作伙伴使用。如果您有兴趣成为我们的合作伙伴,请联系您的 Meta 代表,要求获取使用权限。
Have your client manually create a System User Access Token via Conversions API inside the Pixel Settings. Then, send events to the advertiser’s Pixel with that token.
A system user or an admin system user must install the app that will be used to generate the access token. With this setup, your app is allowed to call APIs on behalf of this system user or admin system user.
With this option, the client shares their Pixel to partner via Business Manager settings or via API, then you can assign the partner system user to the client Pixel and you can generate an access token to send server events.
To attribute conversions API events to your platform, use the partner_agent
field. This allows you to set your own platform identifier when sending events on behalf of a client. If you are a managed partner, work with your Meta Representative to agree on an identifier for your platform. This value should be in a format that is less than 23 characters and includes at least two alphabetical characters. Then, send it with each server event.
Always provide an up-to-date setup guide for advertisers looking to activate the integration on your platform.
See information about debugging and Business Help Center articles.
Provide the following information to your Meta Representative, so they can help with testing integrations and troubleshooting: Business Manager ID, App ID, Pixel IDs.