Best Practices - Conversions API

Use these best practices as general recommendations to successfully integrate the Conversions API. These recommendations are designed to help you make the most effective use of the Conversions API. Follow the implementation and post-implementation recommendations to ensure a smooth integration and optimal results when sharing data with Facebook.

In addition to the following best practices, we recommend that you watch this video for a more hands-on tutorial on using the Conversions API. The video guides you through how to:

Website events shared using the Conversions API require the following data parameters: client_user_agent, action_source, and event_source_url, while non-web events require only action_source. These parameters contribute to improving the quality of events used for ad delivery and may improve campaign performance.

Implementation

When setting up your campaign, simplify the account structure and use the following established campaign best practices:

Set Up Redundant Events

We recommend that you use the Conversions API in addition to the Facebook pixel, and that you share the same events using both tools. We call this a redundant event setup. For example, if you share Purchase, Initiate Checkout, and Contact events using the Facebook pixel, you should also share those same events from your server using the Conversions API.

The Conversions API allows you to share website events that the pixel may lose due to network connectivity issues or page loading errors. The Conversions API can also be used to share other types of important events and data that occur offline or at a later time that the pixel cannot.

Ensure Redundant Events Can Be Deduplicated

When sending redundant events using the Facebook pixel and Conversions API, ensure that both events use the identical event_name and that either event_id or a combination of external_id and fbp are included. We recommend including all of these parameters to help Facebook properly deduplicate events and reduce double reporting of identical events. Learn more about deduplication, when it’s necessary and how to set it up.

Send Required and Recommended Parameters

The following server event and customer information parameters are required:

ParameterTypeWhen Required

action_source

Server event

All events

event_source_url

Server event

All website events

client_user_agent

Customer information

All website events

We also recommend including the external_id and event_id event parameters for all events.

Sending additional customer information parameters may help increase Event Match Quality. Only matched events can be used for ads attribution and ad delivery optimization, and the higher the matching quality, the better. While unmatched events cannot be used for attribution or ad delivery optimization, they can still be used for basic measurement. Examples of high-quality customer information parameters include:

  • email address (em)
  • IP address (client_ip_address)
  • name (fn and ln)
  • phone number (ph)

Ensure fbp and fbc Parameters Are Refreshed

The fbp and fbc parameters are cookie values typically set on your site visitors’ browsers in connection with Facebook’s first-party cookie solution, and are subject to change. If you send them as user parameters, you should regularly refresh their values.

Share Events Closer to Real Time

Sharing events when they happen can help your campaigns achieve the best results. You can share server events using the Conversions API in real time or in batches close to real time.

Use Test Events

We recommend using the Test Events tool to validate your Conversions API connection. Typically, developers should use their own customer information parameters (for example, name, email address, phone number) for test events, because these events may get discarded if they don't match a Facebook account.

You can use the Test Events tool to:

  • Verify that you’ve set up your server events correctly and we’ve received them.
  • Verify that you’ve deduplicated events correctly by seeing which events were processed and deduplicated.
  • Debug any unusual activity.

Learn how to test your server events using the Test Events tool.

Use Payload Helper

Fill out the required and recommended data parameter fields in the Payload Helper tool to see how your payload should be structured and to get recommendations for which parameters to include.

Use Our Business SDK

The code samples in our documentation include Business SDK examples in Python, Java, Ruby, PHP, and Node. They can save some development effort, such as hashing user parameters, which is done automatically in the Business SDK.

If you are not planning to use the Business SDK, we recommend that you implement hashing.

Use the Conversions API for Offline Events

The Conversions API supports all offline events, except for physical store sales, and should be used as the comprehensive container for these types of events. Examples include phone calls, actions taken on devices (such as smart TVs or game consoles), and offline subscriptions.

When sending offline events, be sure to include the action_source event parameter, and choose the appropriate value (should not be website). The action source is required to determine the campaign objectives for which the event is intended.

If your campaign objective is store sales, use the Offline Conversions API to share physical store sales or store visits. Events shared using this API go to a different offline event set container, and are specifically used for the store sales campaign objective.

Additional Best Practices for Partners

Agencies: Send partner_agent String

Partners or agencies that share events on behalf of their advertisers should send a unique partner_agent string, including platform name as documented. If applicable, work with your dedicated Facebook representative to decide on a suitable agent string.

Website Platforms: Onboarding Advertisers

By default, website platform partners may consider whether to offer Conversions API selectively or to opt-in advertisers. The Facebook pixel and Conversions API share the same business terms, and we recommend that you opt-in your customers to also share their data using the Conversions API when they set up the Facebook pixel. While we believe using both tools will strengthen and secure their data-sharing for the long term, we also suggest that you provide your customers with information about both the Conversions API and Facebook pixel to help inform their choice.

Post-Implementation

Check Event Match Quality

If you share server events using the Conversions API, you can see the Event Match Quality (EMQ) for each event in Events Manager. An event’s EMQ score (out of 10) indicates how effective your server event’s customer information may be at matching it to a Facebook account. One of the easiest and most effective ways to improve EMQ is to include client_user_agent with all of your website events.

Run a Test

When using the Conversions API, we recommend that you test and optimize your Facebook advertising strategy. Some testing options include:

  • Conversion Lift Study: Understand the incremental performance impact of using server events.

  • Split Testing: Understand which campaign strategy achieves the best and most efficient outcomes to optimize performance.